Mercurial > noffle
comparison src/util.c @ 109:2bedacfe1ba7 noffle
[svn] Fix header line reading buf
| author | bears |
|---|---|
| date | Mon, 19 Jun 2000 22:56:12 +0100 |
| parents | 93cc929329eb |
| children | 3c71e28c8eef |
comparison
equal
deleted
inserted
replaced
| 108:8eb2975c8c1a | 109:2bedacfe1ba7 |
|---|---|
| 1 /* | 1 /* |
| 2 util.c | 2 util.c |
| 3 | 3 |
| 4 $Id: util.c 110 2000-05-19 15:12:45Z bears $ | 4 $Id: util.c 149 2000-06-19 21:56:12Z bears $ |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #if HAVE_CONFIG_H | 7 #if HAVE_CONFIG_H |
| 8 #include <config.h> | 8 #include <config.h> |
| 9 #endif | 9 #endif |
| 125 Utl_getHeaderLn( Str result, const char *p ) | 125 Utl_getHeaderLn( Str result, const char *p ) |
| 126 { | 126 { |
| 127 const char * res = Utl_getLn( result, p ); | 127 const char * res = Utl_getLn( result, p ); |
| 128 | 128 |
| 129 /* Look for followon line if this isn't a blank line. */ | 129 /* Look for followon line if this isn't a blank line. */ |
| 130 if ( res != NULL && !isspace( result[ 0 ] ) ) | 130 if ( res != NULL && result[ 0 ] != '\0' && ! isspace( result[ 0 ] ) ) |
| 131 for(;;) | 131 for(;;) |
| 132 { | 132 { |
| 133 Str nextLine; | 133 Str nextLine; |
| 134 const char *here; | 134 const char *here; |
| 135 | 135 |
| 136 here = res; | 136 here = res; |
| 137 nextLine[ 0 ] = '\0'; | 137 nextLine[ 0 ] = '\0'; |
| 138 res = Utl_getLn( nextLine, res ); | 138 res = Utl_getLn( nextLine, res ); |
| 139 if ( res == NULL || nextLine[ 0 ] == '\0' | 139 if ( res == NULL || nextLine[ 0 ] == '\0' |
| 140 || !isspace( nextLine[ 0 ] ) ) | 140 || ! isspace( nextLine[ 0 ] ) ) |
| 141 { | 141 { |
| 142 res = here; | 142 res = here; |
| 143 break; | 143 break; |
| 144 } | 144 } |
| 145 else | 145 else |
