From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id CAA04043 for ; Sun, 25 Aug 1996 02:47:25 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id MAA02969; Sat, 24 Aug 1996 12:42:58 -0400 (EDT) Resent-Date: Sat, 24 Aug 1996 12:42:58 -0400 (EDT) Date: Sat, 24 Aug 1996 18:41:23 +0200 (MET DST) From: Janos Farkas Reply-To: Janos Farkas To: zsh-workers@math.gatech.edu Subject: umask builtin with unfortunate args Message-ID: X-Mood: in love MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"7DnfB1.0.Jk.H4p7o"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2061 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Another trivial feature-fix; the result of a mistyped umask command :) Let's take a look at a bored user at the keyboard: iceq% umask e umask: bad symbolic mode operator: e [Ok, that makes sense, but let's look at it closer...] iceq% umask "" umask: bad symbolic mode operator: ^@ [That's almost ok, I wanted it to puke...] iceq% umask g umask: bad symbolic mode operator: ^@ [What?] iceq% umask a umask: bad symbolic mode operator: ^@ [And this is really not straightforward... :)] See for trivial fix at the end... Or maybe, would it be better to `quote' that character? I'm thinking of an umask " ". [BTW, this is happening almost exactly in bash too.. :)] Janos A ChangeLog entry guess... * Src/builtin.c: umask reported not sensible errors for some incorrect parameters. diff -urN zsh-3.0-pre1.orig/Src/builtin.c zsh-3.0-pre1/Src/builtin.c --- zsh-3.0-pre1.orig/Src/builtin.c Fri Jun 28 15:43:49 1996 +++ zsh-3.0-pre1/Src/builtin.c Fri Jun 28 23:15:55 1996 @@ -5481,7 +5483,10 @@ /* Operation may be +, - or =. */ umaskop = (int)*s; if (!(umaskop == '+' || umaskop == '-' || umaskop == '=')) { - zwarnnam(nam, "bad symbolic mode operator: %c", NULL, umaskop); + if (umaskop) + zwarnnam(nam, "bad symbolic mode operator: %c", NULL, umaskop); + else + zwarnnam(nam, "bad umask", NULL, 0); return 1; } /* Permissions mask -- r=read, w=write, x=execute. */