mirror of
https://github.com/samba-team/samba.git
synced 2025-08-06 17:32:29 +03:00
r7743: be consistent in how stdin is supported for ldbadd and ldbmodify
(This used to be commit 3d60b3a8ee
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
225d5a334f
commit
e485e80b51
@ -101,25 +101,17 @@ static int process_file(struct ldb_context *ldb, FILE *f)
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
if (options->argc == 0) {
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for (i=0;i<options->argc;i++) {
|
||||
const char *fname = options->argv[i];
|
||||
FILE *f;
|
||||
if (strcmp(fname,"-") == 0) {
|
||||
f = stdin;
|
||||
} else {
|
||||
count += process_file(ldb, stdin);
|
||||
} else {
|
||||
for (i=0;i<options->argc;i++) {
|
||||
const char *fname = options->argv[i];
|
||||
FILE *f;
|
||||
f = fopen(fname, "r");
|
||||
}
|
||||
if (!f) {
|
||||
perror(fname);
|
||||
exit(1);
|
||||
}
|
||||
count += process_file(ldb, f);
|
||||
if (f != stdin) {
|
||||
fclose(f);
|
||||
if (!f) {
|
||||
perror(fname);
|
||||
exit(1);
|
||||
}
|
||||
count += process_file(ldb, f);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user