diff --git a/lib/util.C b/lib/util.C index 0a7d176a85..33d162b5dc 100755 --- a/lib/util.C +++ b/lib/util.C @@ -248,6 +248,18 @@ void c2x(char *what) { strcpy(what, buf); } +void strip_whitespace(char *str) { + int read_pos, write_pos; + read_pos = write_pos = 0; + while(str[read_pos] != 0) { + if (!isspace(str[read_pos])) { + str[write_pos] = str[read_pos]; + write_pos++; + } + read_pos++; + } +} + void unescape_url(char *url) { register int x,y; diff --git a/lib/util.h b/lib/util.h index e5b4bbbe5e..3b6c65e5d5 100755 --- a/lib/util.h +++ b/lib/util.h @@ -26,6 +26,7 @@ extern int parse_command_line( char *, char ** ); extern int lock_file(char*); extern double drand(); extern void c2x(char *what); +extern void strip_whitespace(char *str); extern void unescape_url(char *url); extern void escape_url(char *in, char*out); extern void safe_strncpy(char*, char*, int);