zsh-workers
 help / color / mirror / code / Atom feed
* umask builtin with unfortunate args
@ 1996-08-24 16:41 Janos Farkas
  0 siblings, 0 replies; only message in thread
From: Janos Farkas @ 1996-08-24 16:41 UTC (permalink / raw)
  To: zsh-workers


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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-08-24 16:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-24 16:41 umask builtin with unfortunate args Janos Farkas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).