mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-23 14:09:39 +08:00
Import ITS#1071 -c fix
This commit is contained in:
parent
63791721eb
commit
e67f0c5d04
@ -626,18 +626,23 @@ main( int argc, char **argv )
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
|
||||
if ( fp == NULL ) {
|
||||
for ( ; optind < argc; ++optind ) {
|
||||
rc = dodelete( ld, argv[ optind ] );
|
||||
for ( ; optind < argc; ++optind ) {
|
||||
rc = dodelete( ld, argv[ optind ] );
|
||||
|
||||
/* Stop on error and no -c option */
|
||||
if( rc != 0 && contoper == 0) break;
|
||||
}
|
||||
} else {
|
||||
while ((rc == 0 || contoper) && fgets(buf, sizeof(buf), fp) != NULL) {
|
||||
buf[ strlen( buf ) - 1 ] = '\0'; /* remove trailing newline */
|
||||
|
||||
if ( *buf != '\0' ) {
|
||||
rc = dodelete( ld, buf );
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
while ((rc == 0 || contoper) && fgets(buf, sizeof(buf), fp) != NULL) {
|
||||
buf[ strlen( buf ) - 1 ] = '\0'; /* remove trailing newline */
|
||||
if ( *buf != '\0' ) {
|
||||
rc = dodelete( ld, buf );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ldap_unbind( ld );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user