summaryrefslogtreecommitdiff
path: root/Test/W01history.ztst
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2021-11-28 20:49:30 +0100
committerOliver Kiddle <opk@zsh.org>2021-11-28 20:49:30 +0100
commit78958c08bfdb37d2eafaf14a33b93229b1fa9e31 (patch)
tree7dbb26574f0a738ad7920fd1cc3e0b8e134b965d /Test/W01history.ztst
parent5fe498124d6469fadded7b9ad9eb64649b93f2de (diff)
downloadzsh-78958c08bfdb37d2eafaf14a33b93229b1fa9e31.tar.gz
zsh-78958c08bfdb37d2eafaf14a33b93229b1fa9e31.zip
49601: don't create ambiguous history file entries for lines ending with a backslash
Diffstat (limited to 'Test/W01history.ztst')
-rw-r--r--Test/W01history.ztst22
1 files changed, 22 insertions, 0 deletions
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