Skip to content

Commit

Permalink
Detect a trailing -f or -o with no following argument
Browse files Browse the repository at this point in the history
  • Loading branch information
rc0 committed Jan 28, 2008
1 parent ae19fd8 commit 7753eb0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mairix.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 495,10 @@ int main (int argc, char **argv)/*{{{*/
break;
} else if (!strcmp(*argv, "-f") || !strcmp(*argv, "--rcfile")) {
argv, --argc;
if (!argc) {
fprintf(stderr, "No filename given after -f argument\n");
exit(1);
}
arg_rc_file_path = *argv;
} else if (!strcmp(*argv, "-t") || !strcmp(*argv, "--threads")) {
do_search = 1;
Expand All @@ -504,6 508,10 @@ int main (int argc, char **argv)/*{{{*/
do_augment = 1;
} else if (!strcmp(*argv, "-o") || !strcmp(*argv, "--mfolder")) {
argv, --argc;
if (!argc) {
fprintf(stderr, "No folder name given after -o argument\n");
exit(1);
}
arg_mfolder = *argv;
} else if (!strcmp(*argv, "-p") || !strcmp(*argv, "--purge")) {
do_purge = 1;
Expand Down

0 comments on commit 7753eb0

Please sign in to comment.