summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2012-02-29 17:06:07 +0000
committerMikael Magnusson <mikachu@gmail.com>2012-02-29 17:06:07 +0000
commit47a48ced0e498e6e90671045617a2152c0d9ae7a (patch)
tree2eb6081fbd93820e25b81b61f7f7f67ee72409ac /Src
parent6f93994a5aeb3a8290153ec159af35bbd96a6673 (diff)
downloadzsh-47a48ced0e498e6e90671045617a2152c0d9ae7a.tar.gz
zsh-47a48ced0e498e6e90671045617a2152c0d9ae7a.tar.xz
zsh-47a48ced0e498e6e90671045617a2152c0d9ae7a.zip
30276: Src/glob.c: Use zlong rather than int when calculating brace expansions of the form {1..9}.
Diffstat (limited to 'Src')
-rw-r--r--Src/glob.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Src/glob.c b/Src/glob.c
index d003d95da..55983815f 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -2089,7 +2089,8 @@ xpandbraces(LinkList list, LinkNode *np)
 	char *dots, *p, *dots2 = NULL;
 	LinkNode olast = last;
 	/* Get the first number of the range */
-	int rstart = zstrtol(str+1,&dots,10), rend = 0, err = 0, rev = 0, rincr = 1;
+	zlong rstart = zstrtol(str+1,&dots,10), rend = 0;
+	int err = 0, rev = 0, rincr = 1;
 	int wid1 = (dots - str) - 1, wid2 = (str2 - dots) - 2, wid3 = 0;
 	int strp = str - str3;
 
@@ -2134,7 +2135,7 @@ xpandbraces(LinkList list, LinkNode *np)
 	    }
 	    if (rstart > rend) {
 		/* Handle decreasing ranges correctly. */
-		int rt = rend;
+		zlong rt = rend;
 		rend = rstart;
 		rstart = rt;
 		rev = !rev;
@@ -2147,7 +2148,7 @@ xpandbraces(LinkList list, LinkNode *np)
 	    for (; rend >= rstart; rend -= rincr) {
 		/* Node added in at end, so do highest first */
 		p = dupstring(str3);
-		sprintf(p + strp, "%0*d", minw, rend);
+		sprintf(p + strp, "%0*ld", minw, (long)rend);
 		strcat(p + strp, str2 + 1);
 		insertlinknode(list, last, p);
 		if (rev)	/* decreasing:  add in reverse order. */