diff options
author | Eduardo Chappa <chappa@washington.edu> | 2013-05-31 17:16:44 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2013-05-31 17:16:44 -0600 |
commit | a46157ba61f2c65f88b42abb31db60c4a714f87b (patch) | |
tree | e37bc41ad2f57b3fd2bad310576cc155a58ca6b7 /pith/string.c | |
parent | 81e994d7907f850506ddc248f84761a54995e58c (diff) | |
download | alpine-a46157ba61f2c65f88b42abb31db60c4a714f87b.tar.xz |
* somehow all.patch got here. Reversing.
Diffstat (limited to 'pith/string.c')
-rw-r--r-- | pith/string.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/pith/string.c b/pith/string.c index 2cd43d7d..84717c3e 100644 --- a/pith/string.c +++ b/pith/string.c @@ -20,7 +20,6 @@ static char rcsid[] = "$Id: string.c 910 2008-01-14 22:28:38Z hubert@u.washingto string.c Misc extra and useful string functions - rplstr replace a substring with another string - - collspaces consecutive spaces are reduced to one space. - sqzspaces Squeeze out the extra blanks in a string - sqznewlines Squeeze out \n and \r. - removing_trailing_white_space @@ -133,31 +132,6 @@ rplstr(char *os, size_t oslen, int dl, char *is) return(x3); } -/*---------------------------------------------------------------------- - collapse blank space - ----------------------------------------------------------------------*/ -void -collspaces(char *string) -{ - char *p = string; - int only_one_space = 0; - - if(!string) - return; - - for(;isspace(*p); p++); - - while(*string = *p++) - if(!isspace((unsigned char)*string)){ - only_one_space = 0; - string++; - } - else if(!only_one_space){ - string++; - only_one_space++; - } - *string = '\0'; -} /*---------------------------------------------------------------------- @@ -2886,35 +2860,3 @@ free_strlist(STRLIST_S **strp) fs_give((void **) strp); } } - - -void -removing_extra_stuff(string) - char *string; -{ - char *p = NULL; - int change = 0, length = 0; - - - if(!string) - return; - - for(; *string; string++, length++) - p = ((unsigned char)*string != ',') ? NULL : (!p) ? string : p; - - if(p) - *p = '\0'; - - string -= length; - for (; *string; string++){ - if (change){ - *string = ' '; - change = 0; - } - if ((((unsigned char)*string == ' ') || - ((unsigned char)*string == ',')) && - ((unsigned char)*(string + 1) == ',')) - change++; - } -} - |