diff options
author | Werner Koch <wk@gnupg.org> | 1999-05-20 14:11:41 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-05-20 14:11:41 +0200 |
commit | 77d6309e2189254cf7a45884fb7ef6a415761988 (patch) | |
tree | 60da5c2556a5b7cb9c8d65dedd7a293eec2a35e8 /util/strgutil.c | |
parent | See ChangeLog: Wed May 19 16:04:30 CEST 1999 Werner Koch (diff) | |
download | gnupg2-77d6309e2189254cf7a45884fb7ef6a415761988.tar.xz gnupg2-77d6309e2189254cf7a45884fb7ef6a415761988.zip |
See ChangeLog: Thu May 20 14:04:08 CEST 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r-- | util/strgutil.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/util/strgutil.c b/util/strgutil.c index 5cef77bf6..ab0d2234a 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -213,17 +213,14 @@ trim_spaces( char *str ) -/**************** - * remove trailing white spaces and return the length of the buffer - */ unsigned -trim_trailing_ws( byte *line, unsigned len ) +trim_trailing_chars( byte *line, unsigned len, const char *trimchars ) { byte *p, *mark; unsigned n; for(mark=NULL, p=line, n=0; n < len; n++, p++ ) { - if( strchr(" \t\r\n", *p ) ) { + if( strchr(trimchars, *p ) ) { if( !mark ) mark = p; } @@ -238,6 +235,15 @@ trim_trailing_ws( byte *line, unsigned len ) return len; } +/**************** + * remove trailing white spaces and return the length of the buffer + */ +unsigned +trim_trailing_ws( byte *line, unsigned len ) +{ + return trim_trailing_chars( line, len, " \t\r\n" ); +} + int |