summaryrefslogtreecommitdiff
path: root/Src/hist.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2015-08-22 01:55:58 +0200
committerAxel Beckert <abe@deuxchevaux.org>2015-08-22 01:55:58 +0200
commit02f6e25bfcd5feb9a093377dda0dd549cdf5c309 (patch)
tree9a25e61122b3fa0d0a1ff68b5ef05c775ff78b1e /Src/hist.c
parente04a19735ffc8523b93b33074f685ad4e2c92e0c (diff)
parent881474edcb223ac22a08d81a824809c33ca3a9c9 (diff)
downloadzsh-02f6e25bfcd5feb9a093377dda0dd549cdf5c309.tar.gz
zsh-02f6e25bfcd5feb9a093377dda0dd549cdf5c309.zip
Merge tag 'zsh-5.0.8-test-2' into debian
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Src/hist.c b/Src/hist.c
index bd03c4f11..75e809c48 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -136,6 +136,7 @@ mod_export int hist_skip_flags;
#define HA_NOINC (1<<1) /* Don't store, curhist not incremented */
#define HA_INWORD (1<<2) /* We're inside a word, don't add
start and end markers */
+#define HA_UNGET (1<<3) /* Recursively ungetting */
/* Array of word beginnings and endings in current history line. */
@@ -904,8 +905,14 @@ ihungetc(int c)
while (!lexstop && !errflag) {
if (hptr[-1] != (char) c && stophist < 4 &&
- hptr > chline + 1 && hptr[-1] == '\n' && hptr[-2] == '\\')
- hungetc('\n'), hungetc('\\');
+ hptr > chline + 1 && hptr[-1] == '\n' && hptr[-2] == '\\' &&
+ !(histactive & HA_UNGET) &&
+ (inbufflags & (INP_ALIAS|INP_HIST)) != INP_ALIAS) {
+ histactive |= HA_UNGET;
+ hungetc('\n');
+ hungetc('\\');
+ histactive &= ~HA_UNGET;
+ }
if (expanding) {
zlemetacs--;
@@ -2000,7 +2007,7 @@ casemodify(char *str, int how)
VARARR(char, mbstr, MB_CUR_MAX);
mbstate_t ps;
- mb_metacharinit();
+ mb_charinit();
memset(&ps, 0, sizeof(ps));
while (*str) {
wint_t wc;