Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

getopts patch



getopts broke in 3.0.2; it was ok in 3.0.1.  The problem is the
handling of required paramtetrs.  Here is the patch, courtesy of
Andrew Robinson.  (it's against 3.0.2 and 3.1.1)

--- Src/builtin.c.orig	Wed Jan 29 10:22:40 1997
+++ Src/builtin.c	Wed Jan 29 11:09:08 1997
@@ -4512,7 +4512,7 @@
     /* copy option into specified parameter, with + if required */
     setsparam(var, metafy(opch - (*str == '+'), 1 + (*str == '+'), META_DUP));
     /* handle case of an expected extra argument */
-    if (optstr[1] == ':') {
+    if (optstr[i + 1] == ':') {
 	if (!args[zoptind - 1]) {
 	    /* no extra argument was provided */
 	    if (quiet) {

-- 
Blaise Tarr
btarr@xxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author