Permalink
Browse files

Handle unknown options

Unknown options in the command line arguments are passed to 'sh'. Fix
this by terminating the program on an unknown option.
  • Loading branch information...
1 parent 77a8238 commit 4574ae31e1aa178637982cd9e006ea8a5503594a @jvirtanen committed Nov 14, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/watch.c
View
@@ -193,6 +193,9 @@ main(int argc, const char **argv){
continue;
}
+ // unknown option
+ if (arg[0] == '-') usage();
+
// cmd args
if (len == ARGS_MAX) {
fprintf(stderr, "number of arguments exceeded %d\n", len);

0 comments on commit 4574ae3

Please sign in to comment.