From 78958c08bfdb37d2eafaf14a33b93229b1fa9e31 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 28 Nov 2021 20:49:30 +0100 Subject: 49601: don't create ambiguous history file entries for lines ending with a backslash --- Test/W01history.ztst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Test') diff --git a/Test/W01history.ztst b/Test/W01history.ztst index 0b2f60d1e..1d3f3cf6f 100644 --- a/Test/W01history.ztst +++ b/Test/W01history.ztst @@ -88,3 +88,25 @@ F:Check that a history bug introduced by workers/34160 is working again. 0:Modifier :P >/my/path/for/testing >/my/path/for/testing + + $ZTST_testdir/../Src/zsh -fgis <<<' + SAVEHIST=7 + print -rs "one\\" + print -rs "two\\\\" + print -rs "three\\\\\\" + print -rs "four\\\\\\\\" + print -rs "five\\\\\\\\\\" + print -s "while false\ndo\ntrue\\\\\n && break\ndone" + print -s "echo one\\\\\ntwo" + fc -W hist + fc -p -R hist + fc -l + rm hist' 2>/dev/null +0:Lines ending in backslash saved and restored to history +> 1 one\ +> 2 two\\ +> 3 three\\\ +> 4 four\\\\ +> 5 five\\\\\ +> 6 while false\ndo\ntrue\\n && break\ndone +> 7 echo one\\ntwo -- cgit 1.4.1