From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2347 invoked from network); 30 Jan 1997 14:45:44 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 30 Jan 1997 14:45:44 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id JAA14531; Thu, 30 Jan 1997 09:31:20 -0500 (EST) Resent-Date: Thu, 30 Jan 1997 09:31:20 -0500 (EST) From: blaise@zenith.att.com Original-From: blaise@zenith.uucp Date: Thu, 30 Jan 1997 09:35:14 -0500 Message-Id: <9701301435.AA26670@jbond.zenith.att.com> Original-From: blaise@zenith.att.com (Blaise Tarr(457-4233) 51E61 catwoman ) To: zsh-workers@math.gatech.edu Subject: getopts patch Resent-Message-ID: <"UsJjy1.0.-Y3.t2Byo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2846 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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@attmail.com