summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-02-08 23:32:34 +0100
committerGuillem Jover <guillem@debian.org>2015-02-11 04:42:40 +0100
commit7720ab422764ce9d24977ad541dc7ed825d933be (patch)
treea829d6d07d4c5666c0b9d192df772d41bf9c4548 /lib
parent76bfda78aacf06ca01b9b4b813689193b21910dc (diff)
downloaddpkg-7720ab422764ce9d24977ad541dc7ed825d933be.tar.gz
libdpkg: Do not silently eat a standalone ‘-’ in the command-line parser
A single dash is commonly used to refer to standard input, and having to use ‘--’ to stop the parser is very cumbersome. Besides, there's no reason a standalone ‘-’ should be silently ignored.
Diffstat (limited to 'lib')
-rw-r--r--lib/dpkg/options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dpkg/options.c b/lib/dpkg/options.c
index 43d1fdb1d..3161dec8b 100644
--- a/lib/dpkg/options.c
+++ b/lib/dpkg/options.c
@@ -221,7 +221,7 @@ dpkg_options_parse(const char *const **argvp, const struct cmdinfo *cmdinfos,
printforhelp = help_str;
++(*argvp);
- while ((p= **argvp) && *p == '-') {
+ while ((p = **argvp) && p[0] == '-' && p[1] != '\0') {
++(*argvp);
if (strcmp(p, "--") == 0)
break;