]> git.sur5r.net Git - openldap/commitdiff
Ignore lines that begin with "#".
authorKurt Zeilenga <kurt@openldap.org>
Thu, 29 Jul 1999 18:39:32 +0000 (18:39 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 29 Jul 1999 18:39:32 +0000 (18:39 +0000)
libraries/libldif/line64.c

index 527bd4f9d9c46960794302a481f2d4dbd103dc0b..b279560917c4f3348e23a7179b010869cd0c5fa4 100644 (file)
@@ -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