diff mbox series

[6/6] mergetools: vimdiff: check for empty fields

Message ID 20230328173932.3614601-7-felipe.contreras@gmail.com (mailing list archive)
State New, archived
Headers show
Series test: make the test suite work with zsh | expand

Commit Message

Felipe Contreras March 28, 2023, 5:39 p.m. UTC
In zsh 'foo#bar#' produces an empty field at the end.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 mergetools/vimdiff | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/mergetools/vimdiff b/mergetools/vimdiff
index 06937acbf5..27d1644faf 100644
--- a/mergetools/vimdiff
+++ b/mergetools/vimdiff
@@ -87,7 +87,7 @@  gen_cmd_aux () {
 	IFS=#
 	for c in $(echo "$LAYOUT" | sed 's:.:&#:g')
 	do
-		if test "$c" = " "
+		if test "$c" = " " || test -z "$c"
 		then
 			continue
 		fi
@@ -155,7 +155,7 @@  gen_cmd_aux () {
 	do
 		i=$(( i + 1 ))
 
-		if test "$c" = " "
+		if test "$c" = " " || test -z "$c"
 		then
 			continue
 		fi