Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH Re: 5.3: printf -



Apparently this was introduced in 37467 when I changed "printf" from
having no options at all to having the -v option for print-to-variable.

There's some documentation saying that ideally we would not create any
new builtins with BINF_SKIPINVALID but I don't see any other way to get
back the old behavior.

diff --git a/Src/builtin.c b/Src/builtin.c
index 65e0cb1..0f04d14 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -100,7 +100,7 @@ static struct builtin builtins[] =
 
     BUILTIN("popd", BINF_SKIPINVALID | BINF_SKIPDASH | BINF_DASHDASHVALID, bin_cd, 0, 1, BIN_POPD, "q", NULL),
     BUILTIN("print", BINF_PRINTOPTS, bin_print, 0, -1, BIN_PRINT, "abcC:Df:ilmnNoOpPrRsSu:v:x:X:z-", NULL),
-    BUILTIN("printf", 0, bin_print, 1, -1, BIN_PRINTF, "v:", NULL),
+    BUILTIN("printf", BINF_SKIPINVALID | BINF_SKIPDASH, bin_print, 1, -1, BIN_PRINTF, "v:", NULL),
     BUILTIN("pushd", BINF_SKIPINVALID | BINF_SKIPDASH | BINF_DASHDASHVALID, bin_cd, 0, 2, BIN_PUSHD, "qsPL", NULL),
     BUILTIN("pushln", 0, bin_print, 0, -1, BIN_PRINT, NULL, "-nz"),
     BUILTIN("pwd", 0, bin_pwd, 0, 0, 0, "rLP", NULL),



Messages sorted by: Reverse Date, Date, Thread, Author