From: Pierangelo Masarati Date: Wed, 23 Jan 2002 16:28:48 +0000 (+0000) Subject: allow trailing '\' to continue a config line (ITS#1551) X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~35 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cb8299d124cb44e7551dc8ff92827d1f395cdfcf;p=openldap allow trailing '\' to continue a config line (ITS#1551) --- diff --git a/servers/slapd/config.c b/servers/slapd/config.c index eb3efa04aa..1faa1a8134 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -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)++;