about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-06-18 09:05:01 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-06-18 09:05:01 +0000
commitc3fb9dbfa35043d4cb4c737032371df926ae6d3e (patch)
tree29588bece3bf660231d7b3143953709fb55b4c94 /Src/glob.c
parent38a4364db5ff298558fea28334a49c41f5921e7e (diff)
downloadzsh-c3fb9dbfa35043d4cb4c737032371df926ae6d3e.tar.gz
zsh-c3fb9dbfa35043d4cb4c737032371df926ae6d3e.tar.xz
zsh-c3fb9dbfa35043d4cb4c737032371df926ae6d3e.zip
Dima Kogan: 30515: fix globbing problem with large files:
failure owing to bad cast with large integers
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/glob.c b/Src/glob.c
index d3ce73310..ca2ffaf51 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -997,7 +997,9 @@ gmatchcmp(Gmatch a, Gmatch b)
 	    break;
 	}
 	if (r)
-	    return (int) ((s->tp & GS_DESC) ? -r : r);
+	    return (s->tp & GS_DESC) ?
+	      (r < 0L ? 1 : -1) :
+	      (r > 0L ? 1 : -1);
     }
     return 0;
 }