about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@ipost.com>2021-02-04 17:52:22 -0800
committerBart Schaefer <schaefer@ipost.com>2021-02-04 17:52:22 -0800
commit465738fc2594ac4629de341738a106184858c678 (patch)
tree8a5821b69fe7fc84215d26cde0f6c1b7b49e4775
parentb803fbaa145e2d6eb7a427749fc03e3ead4da913 (diff)
downloadzsh-465738fc2594ac4629de341738a106184858c678.tar.gz
zsh-465738fc2594ac4629de341738a106184858c678.tar.xz
zsh-465738fc2594ac4629de341738a106184858c678.zip
47895: Remove trailing spaces from "print -ac" output lines.
-rw-r--r--ChangeLog3
-rw-r--r--Src/builtin.c2
-rw-r--r--Test/D02glob.ztst6
3 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index cd24c23d3..6b4855d7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2021-02-04  Bart Schaefer  <schaefer@zsh.org>
 
+	* 47895: Src/builtin.c, Test/D02glob.ztst: Remove trailing spaces
+	from "print -ac" output lines.
+
 	* 47865: Test/D02glob.ztst: More tests for restricted directories
 
 	* 47889: Etc/FAQ.yo: Update csh alias equivalences (section 2.3)
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);
 		}
diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index d3b2e9ec2..72891a2a7 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -750,9 +750,9 @@
  done
  print -raC 2 -- glob.tmp/secret-*/* glob.tmp/secret-*/file
 0:names inside unreadable directories can be globbed if searchable
->glob.tmp/secret-d444/dir   glob.tmp/secret-d444/file  
->glob.tmp/secret-s444/dir   glob.tmp/secret-s444/file  
->glob.tmp/secret-d111/file  glob.tmp/secret-s111/file  
+>glob.tmp/secret-d444/dir   glob.tmp/secret-d444/file
+>glob.tmp/secret-s444/dir   glob.tmp/secret-s444/file
+>glob.tmp/secret-d111/file  glob.tmp/secret-s111/file
 
  print -rC 2 -- glob.tmp/secret-*/dir/*
 0:glob files in readable directories inside unreadable directories