mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-05 13:40:08 +08:00
allow trailing '\' to continue a config line (ITS#1551)
This commit is contained in:
parent
f74e81aa99
commit
cb8299d124
@ -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)++;
|
||||
|
Loading…
Reference in New Issue
Block a user