Mercurial > noffle
diff src/util.c @ 87:bf8c97460fd7 noffle
[svn] Preserve newslines and spaces in header lines
author | bears |
---|---|
date | Thu, 18 May 2000 13:11:05 +0100 |
parents | e612b263934f |
children | 93cc929329eb |
line wrap: on
line diff
--- a/src/util.c Wed May 17 18:09:04 2000 +0100 +++ b/src/util.c Thu May 18 13:11:05 2000 +0100 @@ -1,7 +1,7 @@ /* util.c - $Id: util.c 65 2000-05-12 16:52:41Z enz $ + $Id: util.c 99 2000-05-18 12:11:05Z bears $ */ #if HAVE_CONFIG_H @@ -122,25 +122,24 @@ /* Look for followon line if this isn't a blank line. */ if ( res != NULL && !isspace( result[ 0 ] ) ) - while ( res != NULL && res[ 0 ] != '\n' && isspace( res[ 0 ] ) ) + for(;;) { Str nextLine; const char *here; - char *next; here = res; + nextLine[ 0 ] = '\0'; res = Utl_getLn( nextLine, res ); - next = Utl_stripWhiteSpace( nextLine ); - - if ( next[ 0 ] != '\0' ) + if ( res == NULL || nextLine[ 0 ] == '\0' + || !isspace( nextLine[ 0 ] ) ) { - Utl_catStr( result, " " ); - Utl_catStr( result, next ); + res = here; + break; } else { - res = here; - break; + Utl_catStr( result, "\n" ); + Utl_catStr( result, nextLine ); } }