]> git.sur5r.net Git - openldap/commitdiff
allow trailing '\' to continue a config line (ITS#1551)
authorPierangelo Masarati <ando@openldap.org>
Wed, 23 Jan 2002 16:28:48 +0000 (16:28 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 23 Jan 2002 16:28:48 +0000 (16:28 +0000)
servers/slapd/config.c

index eb3efa04aa98d9246f3a996d053349d54ceec276..1faa1a813428a35208de9ae978e470e31f60fc4c 100644 (file)
@@ -2377,12 +2377,22 @@ fp_getline( FILE *fp, int *lineno )
                        if( p > buf && p[-1] == '\r' ) --p;
                        *p = '\0';
                }
-               if ( ! isspace( (unsigned char) buf[0] ) ) {
-                       return( line );
-               }
+               
+               /* trim off trailing \ and append the next line */
+               if ( line[ 0 ] != '\0' 
+                               && (p = line + strlen( line ) - 1)[ 0 ] == '\\'
+                               && p[ -1 ] != '\\' ) {
+                       p[ 0 ] = '\0';
+                       lcur--;
 
-               /* change leading whitespace to a space */
-               buf[0] = ' ';
+               } else {
+                       if ( ! isspace( (unsigned char) buf[0] ) ) {
+                               return( line );
+                       }
+
+                       /* change leading whitespace to a space */
+                       buf[0] = ' ';
+               }
 
                CATLINE( buf );
                (*lineno)++;