diff options
| author | Alexey Zaytsev <alexey.zaytsev@gmail.com> | 2008-12-17 22:01:17 +0300 |
|---|---|---|
| committer | Alexey Zaytsev <alexey.zaytsev@gmail.com> | 2008-12-18 20:30:22 +0300 |
| commit | 4d7c98921a8204501a7c3748dd0c400e469f8356 (patch) | |
| tree | 64e6a34cd662227232923c8c880501bd6a53a309 | |
| parent | 775c9d92e4f9de1c6611bdbc317fdf2d9210ef18 (diff) | |
| download | sparse-dev-4d7c98921a8204501a7c3748dd0c400e469f8356.tar.gz | |
Handle a terminal -o option properly.
Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
| -rw-r--r-- | lib.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -347,10 +347,13 @@ static char **handle_switch_m(char *arg, char **next) static char **handle_switch_o(char *arg, char **next) { - if (!strcmp (arg, "o") && *next) - return next + 1; // "-o foo" - else - return next; // "-ofoo" or (bogus) terminal "-o" + if (!strcmp (arg, "o")) { // "-o foo" + if (!*++next) + die("argument to '-o' is missing"); + } + // else "-ofoo" + + return next; } static const struct warning { |
