zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: PATCH: unset -v (was Re: printf and POSIX compliance)
Date: Tue, 11 Feb 2003 13:09:56 +0100	[thread overview]
Message-ID: <20885.1044965396@finches.logica.co.uk> (raw)
In-Reply-To: <18945.1044452527@csr.com>

On 5 Feb, Peter wrote:
> 
> The Austin Group which is revising the standard is steering it through
> IEEE, SUS and ISO procedures.  If I've followed the developments
> correctly, the 2002 version available at the Open Group site is now
> approved by all relevant bodies, with identical wording.
> 
> Unfortunately we're a bit erratic at following it; nobody's really got
> the time to keep track of it in detail.

It seems from it that one of the things it defines is that unset should
take a -v flag to specify that variables are being unset. If neither -f
nor -v is specified, it unsets variables. bash breaks this last
condition (probably because older versions of the standard didn't define
that) so unset -v is used a bit in bash scripts.
Anyway, all we need to do is ignore any -v option to unset. Unless anyone
says otherwise I'll commit this to 4.0 too because it is sufficiently tiny.

Oliver

diff -ur zsh-4.1-20030211/Doc/Zsh/builtins.yo zsh.new/Doc/Zsh/builtins.yo
--- zsh-4.1-20030211/Doc/Zsh/builtins.yo	Fri Feb  7 18:05:39 2003
+++ zsh.new/Doc/Zsh/builtins.yo	Tue Feb 11 12:04:41 2003
@@ -1391,7 +1391,7 @@
 )
 findex(unset)
 cindex(parameters, unsetting)
-item(tt(unset) [ tt(-fm) ] var(name) ...)(
+item(tt(unset) [ tt(-fmv) ] var(name) ...)(
 Each named parameter is unset.
 Local parameters remain local even if unset; they appear unset within scope,
 but the previous value will still reappear when the scope ends.
@@ -1404,6 +1404,9 @@
 be quoted) and all parameters with matching names are unset.  Note that this
 cannot be used when unsetting associative array elements, as the subscript
 will be treated as part of the pattern.
+
+The tt(-v) flag specifies that var(name) refers to parameters. This is the
+default behaviour.
 
 tt(unset -f) is equivalent to tt(unfunction).
 )
diff -ur zsh-4.1-20030211/Src/builtin.c zsh.new/Src/builtin.c
--- zsh-4.1-20030211/Src/builtin.c	Fri Feb  7 18:05:41 2003
+++ zsh.new/Src/builtin.c	Tue Feb 11 11:53:43 2003
@@ -126,7 +126,7 @@
     BUILTIN("unalias", 0, bin_unhash, 1, -1, 0, "m", "a"),
     BUILTIN("unfunction", 0, bin_unhash, 1, -1, 0, "m", "f"),
     BUILTIN("unhash", 0, bin_unhash, 1, -1, 0, "adfm", NULL),
-    BUILTIN("unset", BINF_PSPECIAL, bin_unset, 1, -1, 0, "fm", NULL),
+    BUILTIN("unset", BINF_PSPECIAL, bin_unset, 1, -1, 0, "fmv", NULL),
     BUILTIN("unsetopt", 0, bin_setopt, 0, -1, BIN_UNSETOPT, NULL, NULL),
     BUILTIN("wait", 0, bin_fg, 0, -1, BIN_WAIT, NULL, NULL),
     BUILTIN("whence", 0, bin_whence, 0, -1, 0, "acmpvfsw", NULL),

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.


  reply	other threads:[~2003-02-11 12:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-04 15:44 printf and POSIX compliance Stephane CHAZELAS
2003-02-04 18:26 ` DervishD
2003-02-05 13:10   ` Stephane CHAZELAS
2003-02-05 13:42     ` Peter Stephenson
2003-02-11 12:09       ` Oliver Kiddle [this message]
2003-02-05 14:41     ` DervishD
2003-02-11  8:29 ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20885.1044965396@finches.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).