diff options
author | Peter Stephenson <p.stephenson@samsung.com> | 2019-11-18 15:26:14 +0000 |
---|---|---|
committer | Peter Stephenson <p.stephenson@samsung.com> | 2019-11-18 15:26:17 +0000 |
commit | 88d14451b093cf2f07049ebb264a29eefc790825 (patch) | |
tree | 5db09fcb9c360e8d5d0f0e1be82e5c770ae75f95 /Src/hist.c | |
parent | a8b0d399e5ccb4becb3699fad7e553a39963ebda (diff) | |
download | zsh-88d14451b093cf2f07049ebb264a29eefc790825.tar.gz zsh-88d14451b093cf2f07049ebb264a29eefc790825.tar.xz zsh-88d14451b093cf2f07049ebb264a29eefc790825.zip |
users/24445: Add :P modifier to history code.
This was in the glob qualifier and variable code but got missed out of the separate history modifier function.
Diffstat (limited to 'Src/hist.c')
-rw-r--r-- | Src/hist.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Src/hist.c b/Src/hist.c index fd5606dc3..e47be8e15 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -920,6 +920,16 @@ histsubchar(int c) case 'u': sline = casemodify(sline, CASMOD_UPPER); break; + case 'P': + if (*sline != '/') { + char *here = zgetcwd(); + if (here[strlen(here)-1] != '/') + sline = zhtricat(metafy(here, -1, META_HEAPDUP), "/", sline); + else + sline = dyncat(here, sline); + } + sline = xsymlink(sline, 1); + break; default: herrflush(); zerr("illegal modifier: %c", c); |