1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-06 09:01:13 +02:00

34742: history expansion inside command substitution failed.

Needs the case of alias expansion separating out.
This commit is contained in:
Peter Stephenson 2015-03-19 11:10:49 +00:00
parent e176eff554
commit f48457a695
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2015-03-19 Peter Stephenson <p.stephenson@samsung.com>
* 34742: Src/hist.c: history expansion in command substitution
didn't work. Discriminate the case of an alias expansion
more carefully.
2015-03-19 Daniel Shahaf <d.s@daniel.shahaf.name> 2015-03-19 Daniel Shahaf <d.s@daniel.shahaf.name>
* 34739: Completion/Unix/Command/_git: git completion: Fix * 34739: Completion/Unix/Command/_git: git completion: Fix
@ -12,7 +18,7 @@
2015-03-18 Peter Stephenson <p.stephenson@samsung.com> 2015-03-18 Peter Stephenson <p.stephenson@samsung.com>
* 34723: configure.ac: turn off fixed site function directory if * 34732: configure.ac: turn off fixed site function directory if
site function directory explicitly disabled. site function directory explicitly disabled.
2015-03-17 Peter Stephenson <p.stephenson@samsung.com> 2015-03-17 Peter Stephenson <p.stephenson@samsung.com>

View file

@ -338,7 +338,8 @@ ihwaddc(int c)
* fashion as we never need the expansion in the history * fashion as we never need the expansion in the history
* line, only in the lexer and above. * line, only in the lexer and above.
*/ */
!((histactive & HA_INWORD) && (inbufflags & INP_ALIAS))) { !((histactive & HA_INWORD) &&
(inbufflags & (INP_ALIAS|INP_HIST)) == INP_ALIAS)) {
/* Quote un-expanded bangs in the history line. */ /* Quote un-expanded bangs in the history line. */
if (c == bangchar && stophist < 2 && qbang) if (c == bangchar && stophist < 2 && qbang)
/* If qbang is not set, we do not escape this bangchar as it's * /* If qbang is not set, we do not escape this bangchar as it's *
@ -901,7 +902,8 @@ ihungetc(int c)
zlemetall--; zlemetall--;
exlast++; exlast++;
} }
if (!(histactive & HA_INWORD) || !(inbufflags & INP_ALIAS)) { if (!(histactive & HA_INWORD) ||
(inbufflags & (INP_ALIAS|INP_HIST)) != INP_ALIAS) {
DPUTS(hptr <= chline, "BUG: hungetc attempted at buffer start"); DPUTS(hptr <= chline, "BUG: hungetc attempted at buffer start");
hptr--; hptr--;
DPUTS(*hptr != (char) c, "BUG: wrong character in hungetc() "); DPUTS(*hptr != (char) c, "BUG: wrong character in hungetc() ");