about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/builtin.c3
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))