zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: PATCH: printf --
Date: Mon, 16 Sep 2002 12:44:46 +0100	[thread overview]
Message-ID: <E17quJ5-0002Dp-00@bimbo.logica.co.uk> (raw)

Reluctantly, I here add removal of an inital `--' to printf to satisfy
POSIX.

Except for cd, command (which we knew anyway) and possibly ulimit, I
think we have it right for other standard commands. I'm not sure in the
case of fg, bg and wait. If my understanding of the POSIX standard is
correct, the builtins which should not ignore an initial `--' are:
break, dot, eval, shift, exec, exit, return, test/[ and continue. Zsh
gets all these right. Also, having noticed that `ARGV0=whatever exec
command' is clever enough to change the command name for the command
and not for exec, I don't think we should follow bash and ksh93 in
giving exec arguments. Though zsh can't easily do the -c functionality
which passes an empty environment.

--- Src/builtin.c	2002-08-28 08:22:23.000000000 +0100
+++ Src/builtin.c	2002-09-15 18:52:11.000000000 +0100
@@ -3024,9 +3024,15 @@
     zulong zulongval;
     char *stringval;
     
-    if (func == BIN_PRINTF)
+    if (func == BIN_PRINTF) {
+	if (!strcmp(*args, "--")) {
+	  if (!*++args) {
+	    zwarnnam(name, "not enough arguments", NULL, 0);
+	    return 1;
+          }
+	}
 	fmt = *args++;
-    else if (OPT_HASARG(ops,'f'))
+    } else if (OPT_HASARG(ops,'f'))
 	fmt = OPT_ARG(ops,'f');
     if (fmt)
 	fmt = getkeystring(fmt, &flen, OPT_ISSET(ops,'b') ? 2 : 0, &nnl);

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:[~2002-09-16 11:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=E17quJ5-0002Dp-00@bimbo.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).