diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-03-02 21:21:52 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-03-02 21:21:52 +0000 |
commit | e5a6543e6daeb8cb8e2cd37856814e24ce4407df (patch) | |
tree | 2d9fb6ab29c71f4ef68118193e08c0fbf7b2169d | |
parent | 5707bb5638c68aa4d84fba6af91f71b02830e29c (diff) | |
download | zsh-e5a6543e6daeb8cb8e2cd37856814e24ce4407df.tar.gz zsh-e5a6543e6daeb8cb8e2cd37856814e24ce4407df.tar.xz zsh-e5a6543e6daeb8cb8e2cd37856814e24ce4407df.zip |
overeagnerness to spot integers in cd after - and +
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/builtin.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 3ed1c5673..477084ee8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-02 Peter Stephenson <p.w.stephenson@ntlworld.com> + + * 24656: Src/builtin.c: fix cd overeagerness to find integers + after "-" and "+". + 2008-03-01 Clint Adams <clint@zsh.org> * 24650: Completion/Unix/Type/_path_commands: use zstyle -t instead diff --git a/Src/builtin.c b/Src/builtin.c index 2002339e2..14252efc5 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -835,7 +835,8 @@ cd_get_dest(char *nam, char **argv, int hard, int func) char *end; doprintdir++; - if (argv[0][1] && (argv[0][0] == '+' || argv[0][0] == '-')) { + if (argv[0][1] && (argv[0][0] == '+' || argv[0][0] == '-') + && strspn(argv[0]+1, "0123456789") == strlen(argv[0]+1)) { dd = zstrtol(argv[0] + 1, &end, 10); if (*end == '\0') { if ((argv[0][0] == '+') ^ isset(PUSHDMINUS)) |