projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added wrbuf_cut_right which cuts WRBUF by a number of characters (chop
[yaz-moved-to-github.git]
/
src
/
wrbuf.c
diff --git
a/src/wrbuf.c
b/src/wrbuf.c
index
e8e6434
..
973f080
100644
(file)
--- a/
src/wrbuf.c
+++ b/
src/wrbuf.c
@@
-2,7
+2,7
@@
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: wrbuf.c,v 1.16 2007-02-23 10:15:01 adam Exp $
+ * $Id: wrbuf.c,v 1.17 2007-03-18 12:59:56 adam Exp $
*/
/**
*/
/**
@@
-231,6
+231,13
@@
const char *wrbuf_cstr(WRBUF b)
return b->buf;
}
return b->buf;
}
+void wrbuf_cut_right(WRBUF b, size_t no_to_remove)
+{
+ if (no_to_remove > b->pos)
+ no_to_remove = b->pos;
+ b->pos = b->pos - no_to_remove;
+}
+
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4