diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index e973fa71f..c16c10987 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1422,6 +1422,8 @@ if hero's steed got hit by knockback effect, impossible "no monster to remove" the #saveoptions command included options changed via doset_simple() but not ones changed via full doset() fix 'nethack --scores' as alias for 'nethack -s' +adding command line 'nethack --usage' broke 'nethack -u name' (however, + 'nethack -uname' still worked for names other than "sage") curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index b21220883..15e757608 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -343,7 +343,7 @@ lopt( goto loptnotallowed; l = (int) (p ? (long) (p - arg) : (long) strlen(arg)); - if (!strncmp(arg, optname, l)) { + if ((l > 2 || oneletterok) && !strncmp(arg, optname, l)) { /* "-windowtype[=foo]" */ if (p) ++p; /* past '=' or ':' */ @@ -356,6 +356,10 @@ lopt( /* "-w..." but not "-w[indowtype[=foo]]" */ if (!p) { p = &arg[2]; /* past 'w' of "-wfoo" */ +#if 0 /* -x:value could work but is not supported (callers don't expect it) */ + } else if (p == arg + 2) { + ++p; /* past ':' of "-w:foo" */ +#endif } else { /* "-w...=foo" but not "-w[indowtype]=foo" */ goto loptbail;