Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] size-sorting globs now work for giant files
- X-seq: zsh-workers 30515
- From: Dima Kogan <dima@xxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] size-sorting globs now work for giant files
- Date: Sat, 16 Jun 2012 18:14:40 -0700
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=date:from:to:subject:message-id:mime-version:content-type; s= mesmtp; bh=s1TPLfqmGnZnx9/7rsvEnO8AIGs=; b=MwtYp/6gZh8N322WzAMtr vXcvw7/vMBykPmg/TijgmyiHCcjT6/x/VT2pH1qPopniRuisgpobB2y7wExeyyvB mQuyG9+W+33UsAPNzCpysurn15Z+3y4Z0h3k7AP37arc5phoOnyzUmTjsfzPJbqO yV8uHYTchQ5z+TCxZOY2bQ=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:subject:message-id :mime-version:content-type; s=smtpout; bh=s1TPLfqmGnZnx9/7rsvEnO 8AIGs=; b=IxHYRm0oYu4vFf9vohYEsiVnaUXf8iGC0cgrZDuTFg4HZEIk8B64MF XWSY3smXCXjSOFBgt/hmozK3WIh/xtnKcJk7wO0T+Nlv4K9ZL6yb5eAletG/MS8t 3XAC7CuyQq5rSnVCLwfk69Ze6uG1GwPEMCgC4Y73hCUg5hO2V5OEc=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
There was a bug where globs like *(OL[1]) failed to return the largest
file if it was larger that 4GB in size. The bug was an improper int ->
long cast. Patch attached.
dima
From e0e323f27b48180fe32680e2c6a17930c4e5a7ee Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@xxxxxxxxxxxxxxx>
Date: Sat, 16 Jun 2012 18:04:57 -0700
Subject: [PATCH] zsh glob sorting now works with giant files
globs like *(OL[1]) now correctly expand to the largest file even if its
size is larger that 4GB
---
Src/glob.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Src/glob.c b/Src/glob.c
index d3ce733..ca2ffaf 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;
}
--
1.7.10
Messages sorted by:
Reverse Date,
Date,
Thread,
Author