about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2024-03-13 00:35:10 +0100
committerOliver Kiddle <opk@zsh.org>2024-03-13 00:35:10 +0100
commit37f434498eb626a10e3009216afa306e5ae841c6 (patch)
treec987e9fea74653a8c14551b71749ccb28ceb650c /Src/Modules
parentea5a5d6ec430cad1a73f3179fcc018c90a315c35 (diff)
downloadzsh-37f434498eb626a10e3009216afa306e5ae841c6.tar.gz
zsh-37f434498eb626a10e3009216afa306e5ae841c6.tar.xz
zsh-37f434498eb626a10e3009216afa306e5ae841c6.zip
52724: fix .zle.sgr for empty sequences
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/hlgroup.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/Modules/hlgroup.c b/Src/Modules/hlgroup.c
index 6382f3216..9c0aedcf8 100644
--- a/Src/Modules/hlgroup.c
+++ b/Src/Modules/hlgroup.c
@@ -59,6 +59,10 @@ convertattr(char *attrstr, int sgr)
 	    *t = ';';
 	    c++;
 	}
+	if (t <= s) { /* always return at least "0" */
+	    *s = '0';
+	    t = s + 1;
+	}
 	*t = '\0';
 	len = t - s;
     }