From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3795 invoked by alias); 26 Jul 2016 09:20:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21793 Received: (qmail 9177 invoked from network); 26 Jul 2016 09:20:28 -0000 X-Qmail-Scanner-Diagnostics: from mailout4.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.14):SA:0(-1.3/5.0):. Processed in 0.164477 secs); 26 Jul 2016 09:20:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f5-f792a6d000001302-79-57972b556414 Date: Tue, 26 Jul 2016 10:20:17 +0100 From: Peter Stephenson To: Zsh Users' List Subject: Re: Undocumented numeric globbing flags Message-id: <20160726102017.7e0c8759@pwslap01u.europe.root.pri> In-reply-to: <160725135707.ZM20289@torch.brasslantern.com> References: <20160725173229.7da0a4c6@pwslap01u.europe.root.pri> <160725135707.ZM20289@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsVy+t/xK7qh2tPDDU7v5rbYcXIlowOjx6qD H5gCGKO4bFJSczLLUov07RK4Mpq3NrEV9PJXnN44kbmB8SZ3FyMnh4SAicSpa8sZIWwxiQv3 1rN1MXJxCAksZZRoO/mHGcKZxiQxY2MfK4RzjlHi84uLUGVnGSX+f/nCCtLPIqAqsXrtDmYQ m03AUGLqptlgc0UE1CVWXG9n6mLk4BAWMJB4/N0cJMwrYC9x+s09FhCbU8BKYmrrLzYQW0gg X+L8sjtgcX4BfYmrfz8xQZxnLzHzyhlGiF5BiR+TIXqZBbQkNm9rYoWw5SU2r3nLDDFHXeLG 3d3sExiFZyFpmYWkZRaSlgWMzKsYRVNLkwuKk9JzjfSKE3OLS/PS9ZLzczcxQsL56w7Gpces DjEKcDAq8fBOcJ0WLsSaWFZcmXuIUYKDWUmE94rm9HAh3pTEyqrUovz4otKc1OJDjNIcLEri vDN3vQ8REkhPLEnNTk0tSC2CyTJxcEo1MF57+U53xjLrVWqXbt7UmNvN3dfL7dJy4XV959tL Pe/mPjqZmGl0fz1/6ind/OTbIb9yln3W/rRvntg1+5QF+054itmxsnyYe7ndzuLEprPn6rRe 2D+b/nDjp/6/+6b+twsrX1pg8XF9rvjPOK5pf6I3dZk9N5stVefPLlA6lW+lvbZWm6Xnyz1K LMUZiYZazEXFiQCgwnJCYwIAAA== On Mon, 25 Jul 2016 13:57:07 -0700 Bart Schaefer wrote: > On Jul 25, 5:32pm, Peter Stephenson wrote: > } > } Does anyone use the undocumented globbing flag feature that a number > } with no flag is treated as a set of octal bits to "and" with the file > } mode? > > I can't remember ever having done so. Falstad probably did, 25 years ago. > :-) Sounds like cruft. pws diff --git a/README b/README index d5343db..9de5eb4 100644 --- a/README +++ b/README @@ -79,6 +79,14 @@ Other aspects of EXIT trap handling have not changed --- there is still only one EXIT trap at any point in a programme, so it is not generally useful to combine POSIX and non-POSIX behaviour in the same script. +4) There was an undocumented feature dating from the early days of zsh +that glob qualifiers consisting only of the digits 0 to 7 were treated +as an octal file mode to "and" with the modes of files being tested. +This has been removed in order to be more sensitive to syntax errors. +The "f" qualifier has for many years been the documented way of testing +file modes; it allows the "and" test ("*(f+1)" is the documented +equivalent of "*(1)") as well as many other forms. + Incompatibilities between 5.0.8 and 5.2 --------------------------------------- diff --git a/Src/glob.c b/Src/glob.c index 850405f..a845c5f 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -1282,14 +1282,7 @@ zglob(LinkList list, LinkNode np, int nountok) *ptr = '-'; while (*s && !newcolonmod) { func = (int (*) _((char *, Statptr, off_t, char *)))0; - if (idigit(*s)) { - /* Store numeric argument for qualifier */ - func = qualflags; - data = 0; - sdata = NULL; - while (idigit(*s)) - data = data * 010 + (*s++ - '0'); - } else if (*s == ',') { + if (*s == ',') { /* A comma separates alternative sets of qualifiers */ s++; sense = 0;