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

umask builtin with unfortunate args



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. */





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