about summary refs log tree commit diff
diff options
context:
space:
mode:
authordana <dana@dana.is>2019-05-08 16:35:08 -0500
committerdana <dana@dana.is>2019-05-08 16:35:08 -0500
commitc1a33575b4c522cea71c57664c852727fe6a633c (patch)
tree59729727c427c0bfb146a2fee3c00b652e298dab
parentcd6fd2b0a3641774e7854ff8298d1d82643c4b4a (diff)
downloadzsh-c1a33575b4c522cea71c57664c852727fe6a633c.tar.gz
zsh-c1a33575b4c522cea71c57664c852727fe6a633c.tar.xz
zsh-c1a33575b4c522cea71c57664c852727fe6a633c.zip
44275: Fix compset -p/-s multibyte inconsistency and documentation
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/compwid.yo4
-rw-r--r--Src/Zle/complete.c2
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f7af378b..366a8b984 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-05-08  dana  <dana@dana.is>
+
+	* 44275: Doc/Zsh/compwid.yo, Src/Zle/complete.c: Fix compset -p/-s
+	multibyte inconsistency and documentation
+
 2019-05-07  Oliver Kiddle  <okiddle@yahoo.co.uk>
 
 	* 44274: Completion/Base/Core/_description,
diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo
index 0d8d4cc40..b74db8408 100644
--- a/Doc/Zsh/compwid.yo
+++ b/Doc/Zsh/compwid.yo
@@ -751,8 +751,8 @@ The options are:
 
 startitem()
 item(tt(-p) var(number))(
-If the contents of the tt(PREFIX) parameter is longer than var(number)
-characters, the first var(number) characters are removed from it and
+If the value of the tt(PREFIX) parameter is at least var(number)
+characters long, the first var(number) characters are removed from it and
 appended to the contents of the tt(IPREFIX) parameter.
 )
 item(tt(-P) [ var(number) ] var(pattern))(
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index c2f46c7f5..7d9751fa6 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -1011,7 +1011,7 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
 		}
 	    } else
 #endif
-	    if ((int)strlen(test == CVT_PRENUM ? compprefix : compsuffix) >= na)
+	    if ((int)strlen(test == CVT_PRENUM ? compprefix : compsuffix) < na)
 		return 0;
 	    if (test == CVT_PRENUM)
 		ignore_prefix(na);