From 5695d59007f398ea6f40b9c13b9f5723505f0537 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 29 Jul 1999 18:39:32 +0000 Subject: [PATCH] Ignore lines that begin with "#". --- libraries/libldif/line64.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) 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 -- 2.39.5