diff options
author | cheloha <> | 2022-12-04 23:50:46 +0000 |
---|---|---|
committer | cheloha <> | 2022-12-04 23:50:46 +0000 |
commit | 58332972c8ed662b36fa575355047d2de8b8f319 (patch) | |
tree | 5eb5951f7dde33b16ba81f465c477cccdca9cd8b /src/regress/lib/libc/regex | |
parent | b9ebe1afae8c014cb6a2f888ece3171de1fda423 (diff) | |
download | openbsd-58332972c8ed662b36fa575355047d2de8b8f319.tar.gz openbsd-58332972c8ed662b36fa575355047d2de8b8f319.tar.bz2 openbsd-58332972c8ed662b36fa575355047d2de8b8f319.zip |
userspace: remove vestigial '?' cases from top-level getopt(3) loops
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument. We can
handle this case with the "default" failure case with no loss of
legibility. Hence, remove all the redundant "case '?':" lines.
Prompted by dlg@. With help from dlg@ and millert@.
Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2
ok naddy@ millert@ dlg@
Diffstat (limited to 'src/regress/lib/libc/regex')
-rw-r--r-- | src/regress/lib/libc/regex/main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/regress/lib/libc/regex/main.c b/src/regress/lib/libc/regex/main.c index 50c3f7589e..4501e86b87 100644 --- a/src/regress/lib/libc/regex/main.c +++ b/src/regress/lib/libc/regex/main.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: main.c,v 1.11 2020/02/14 19:17:34 schwarze Exp $ */ | 1 | /* $OpenBSD: main.c,v 1.12 2022/12/04 23:50:46 cheloha Exp $ */ |
2 | /* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */ | 2 | /* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */ |
3 | 3 | ||
4 | #include <stdio.h> | 4 | #include <stdio.h> |
@@ -61,7 +61,6 @@ main(int argc, char *argv[]) | |||
61 | case 'x': /* Debugging. */ | 61 | case 'x': /* Debugging. */ |
62 | debug++; | 62 | debug++; |
63 | break; | 63 | break; |
64 | case '?': | ||
65 | default: | 64 | default: |
66 | errflg++; | 65 | errflg++; |
67 | break; | 66 | break; |