diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2004-04-21 08:31:45 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2004-04-21 08:31:45 +0000 |
commit | f34d9be61b047beadb24748163c1bc59a7eff9d3 (patch) | |
tree | 12eee9a05e946906b7a7286f1101f96a28d011fe | |
parent | c1e47cb71f9f974eba00e780746e092296ceb958 (diff) | |
download | zsh-f34d9be61b047beadb24748163c1bc59a7eff9d3.tar.gz zsh-f34d9be61b047beadb24748163c1bc59a7eff9d3.tar.xz zsh-f34d9be61b047beadb24748163c1bc59a7eff9d3.zip |
19806: fix bug with %v prompt expansion and negative index beyond array start
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | Src/prompt.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 77f5df6c4..7246c1268 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-04-21 Oliver Kiddle <opk@zsh.org> + + * 19806: Src/prompt.c: fix bug with %v expansion and negative index + 2004-04-20 Peter Stephenson <pws@csr.com> * 19801: Src/builtin.c: Autoloading of TRAP functions was never diff --git a/Src/prompt.c b/Src/prompt.c index 7f964aad5..5e80da172 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -579,7 +579,7 @@ putpromptchar(int doprint, int endchar) arg = 1; else if (arg < 0) arg += arrlen(psvar) + 1; - if (arrlen(psvar) >= arg) + if (arg > 0 && arrlen(psvar) >= arg) stradd(psvar[arg - 1]); break; case 'E': |