From 49bfbc12483602937380658d67acd6c009d39159 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 16 Sep 2002 18:24:47 +0000 Subject: 17678: ignore initial `--' argument to printf to satisfy POSIX --- ChangeLog | 5 ++++- Src/builtin.c | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 009fecc55..ae372dfab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2002-09-16 Oliver Kiddle - * Completion/Zsh/Command/_typeset, Doc/Zsh/builtins.yo: + * 17678: Src/builtin.c: ignore initial `--' argument to printf + to satisfy POSIX. + + * 17682: Completion/Zsh/Command/_typeset, Doc/Zsh/builtins.yo: add support for -H and -p options to completion * 17542 (Thomas Stromberg ): diff --git a/Src/builtin.c b/Src/builtin.c index c3951c77f..36b780e8c 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3019,9 +3019,13 @@ bin_print(char *name, char **args, Options ops, int func) zulong zulongval; char *stringval; - if (func == BIN_PRINTF) - fmt = *args++; - else if (func == BIN_ECHO && isset(BSDECHO)) + if (func == BIN_PRINTF) { + if (!strcmp(*args, "--") && !*++args) { + zwarnnam(name, "not enough arguments", NULL, 0); + return 1; + } + fmt = *args++; + } else if (func == BIN_ECHO && isset(BSDECHO)) ops->ind['E'] = 1; else if (OPT_HASARG(ops,'f')) fmt = OPT_ARG(ops,'f'); -- cgit 1.4.1