54 |
* remove leading and trailing white spaces |
* remove leading and trailing white spaces |
55 |
*/ |
*/ |
56 |
static char * |
static char * |
57 |
trim_spaces( char *str ) |
trim_spaces (char *str) |
58 |
{ |
{ |
59 |
char *string, *p, *mark; |
char *string, *p, *mark; |
60 |
|
|
63 |
for( p=string; *p && isspace( *(byte*)p ) ; p++ ) |
for( p=string; *p && isspace( *(byte*)p ) ; p++ ) |
64 |
; |
; |
65 |
/* move characters */ |
/* move characters */ |
66 |
for( (mark = NULL); (*string = *p); string++, p++ ) |
for( (mark = NULL); (*string = *p) != 0; string++, p++ ) |
67 |
if( isspace( *(byte*)p ) ) { |
if( isspace( *(byte*)p ) ) { |
68 |
if( !mark ) |
if( !mark ) |
69 |
mark = string ; |
mark = string ; |
113 |
FILE *fp; |
FILE *fp; |
114 |
|
|
115 |
s1++; |
s1++; |
116 |
if ( !(s2 = strchr (s1, ':')) ) |
if ( (s2 = strchr (s1, ':')) == NULL ) |
117 |
s2 = s1 + strlen(s1); |
s2 = s1 + strlen(s1); |
118 |
p = malloc (s2-s1+1); |
p = malloc (s2-s1+1); |
119 |
if (p) { |
if (p) { |