From: Karel Zak Date: Tue, 29 Jul 2014 09:49:00 +0000 (+0200) Subject: logger: fix -i=ppid X-Git-Tag: v2.26-rc1~574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e598686d3c0925bb79989684ad1034e094f52c4c;p=thirdparty%2Futil-linux.git logger: fix -i=ppid For short options (-i) the optional argument contains '='. Signed-off-by: Karel Zak --- diff --git a/misc-utils/logger.c b/misc-utils/logger.c index af65af2047..a9d21884fd 100644 --- a/misc-utils/logger.c +++ b/misc-utils/logger.c @@ -592,9 +592,13 @@ int main(int argc, char **argv) case 'i': /* log process id also */ ctl.logflags |= LOG_PID; if (optarg) { - if (!strcmp(optarg, "ppid")) + const char *p = optarg; + + if (*p == '=') + p++; + if (!strcmp(p, "ppid")) ctl.ppid = 1; - else if (!strcmp(optarg, "pid")) + else if (!strcmp(p, "pid")) ctl.ppid = 0; else warnx(_("ignoring unknown option argument: %s"), optarg);