From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2418 invoked from network); 16 Sep 2002 11:45:30 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 16 Sep 2002 11:45:30 -0000 Received: (qmail 14122 invoked by alias); 16 Sep 2002 11:45:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17678 Received: (qmail 14111 invoked from network); 16 Sep 2002 11:45:18 -0000 X-VirusChecked: Checked From: Oliver Kiddle To: Zsh workers Subject: PATCH: printf -- MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7725.1032176552.1@logica.com> Date: Mon, 16 Sep 2002 12:44:46 +0100 Sender: kiddleo@logica.com Message-Id: 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.