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

Re: print -C and terminators



On Sun, Jan 31, 2021 at 1:36 AM Stephane Chazelas <stephane@xxxxxxxxxxxx> wrote:
>
> ~$ print -raC2 a b c | sed -n l
> a  b  $
> c  $
>
> could also be improved.

Is that just this?

diff --git a/Src/builtin.c b/Src/builtin.c
index 09eb3728c..35a0fb2db 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -4822,7 +4822,7 @@ bin_print(char *name, char **args, Options ops, int func)
                {
                    fwrite(args[n], len[n], 1, fout);
                    l = widths[n];
-                   if (n < argc)
+                   if (n < argc && ic < nc - 1)
                        for (; l < sc; l++)
                            fputc(' ', fout);
                }




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