From: Kurt Zeilenga Date: Thu, 29 Jul 1999 18:39:32 +0000 (+0000) Subject: Ignore lines that begin with "#". X-Git-Tag: OPENLDAP_REL_ENG_2_BP~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5695d59007f398ea6f40b9c13b9f5723505f0537;p=openldap Ignore lines that begin with "#". --- diff --git a/libraries/libldif/line64.c b/libraries/libldif/line64.c index 527bd4f9d9..b279560917 100644 --- a/libraries/libldif/line64.c +++ b/libraries/libldif/line64.c @@ -21,7 +21,7 @@ int ldif_debug = 0; #define RIGHT4 0x0f #define CONTINUED_LINE_MARKER '\001' -static const char nib2b64[0x40f] = +static const char nib2b64[0x40] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const unsigned char b642nib[0x80] = { @@ -176,26 +176,29 @@ ldif_parse_line( char * ldif_getline( char **next ) { - char *l; + char *line; - if ( *next == NULL || **next == '\n' || **next == '\0' ) { - return( NULL ); - } + do { + if ( *next == NULL || **next == '\n' || **next == '\0' ) { + return( NULL ); + } + + line = *next; - l = *next; - while ( (*next = strchr( *next, '\n' )) != NULL ) { - unsigned char c = *(*next + 1); - if ( isspace( c ) && c != '\n' ) { - **next = CONTINUED_LINE_MARKER; - *(*next+1) = CONTINUED_LINE_MARKER; - } else { - *(*next)++ = '\0'; - break; + while ( (*next = strchr( *next, '\n' )) != NULL ) { + unsigned char c = *(*next + 1); + if ( isspace( c ) && c != '\n' ) { + **next = CONTINUED_LINE_MARKER; + *(*next+1) = CONTINUED_LINE_MARKER; + } else { + *(*next)++ = '\0'; + break; + } + (*next)++; } - (*next)++; - } + } while( *line == '#' ); - return( l ); + return( line ); } void