From a81f280bfa185ba1df9c5ffee535631e4f1736f4 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 24 Nov 2016 06:57:52 +0000 Subject: 40010: builtins: Say 'bad option: +x', not 'bad option: -x', when +x was passed. --- Src/builtin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index ab159ad09..e641a97a1 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -249,7 +249,7 @@ int execbuiltin(LinkList args, LinkList assigns, Builtin bn) { char *pp, *name, *optstr; - int flags, sense, argc, execop, xtr = isset(XTRACE); + int flags, argc, execop, xtr = isset(XTRACE); struct options ops; /* initialise options structure */ @@ -294,6 +294,7 @@ execbuiltin(LinkList args, LinkList assigns, Builtin bn) /* Sort out the options. */ if (optstr) { char *arg = *argv; + int sense; /* 1 for -x, 0 for +x */ /* while arguments look like options ... */ while (arg && /* Must begin with - or maybe + */ @@ -387,7 +388,7 @@ execbuiltin(LinkList args, LinkList assigns, Builtin bn) if (*arg) { if(*arg == Meta) *++arg ^= 32; - zwarnnam(name, "bad option: -%c", *arg); + zwarnnam(name, "bad option: %c%c", "+-"[sense], *arg); return 1; } arg = *++argv; -- cgit v1.2.3