After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728669 - W32: GLocalFile can't measure size of files larger than 2^32 on 32-bit systems
W32: GLocalFile can't measure size of files larger than 2^32 on 32-bit systems
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-21 17:28 UTC by LRN
Modified: 2015-04-16 20:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
W32: use 64-bit stat for localfile size calculation (2.01 KB, patch)
2014-04-21 17:28 UTC, LRN
none Details | Review
W32: use 64-bit stat for localfile size calculation (1.86 KB, patch)
2015-04-05 11:06 UTC, LRN
committed Details | Review

Description LRN 2014-04-21 17:28:17 UTC
It calls g_lstat(), which on Windows just calls g_stat(), which is forced to use 32-bit msvcrt stat even if 64-bit version is available (for ABI compatibility).
Comment 1 LRN 2014-04-21 17:28:21 UTC
Created attachment 274823 [details] [review]
W32: use 64-bit stat for localfile size calculation
Comment 2 LRN 2014-04-21 17:29:29 UTC
This is an improved fork of bug 711547, see [1]

[1] https://bugzilla.gnome.org/show_bug.cgi?id=711547#c13
Comment 3 Ignacio Casal Quinteiro (nacho) 2014-08-04 07:51:38 UTC
Review of attachment 274823 [details] [review]:

See the nitpicks.

::: gio/glocalfile.c
@@ +2663,3 @@
+    if (wfilename == NULL)
+      {
+        errno = EINVAL;

I do not like much about setting errno directly...

@@ +2668,3 @@
+
+    len = wcslen (wfilename);
+    while (len > 0 && G_IS_DIR_SEPARATOR (wfilename[len-1]))

it should be len - 1

@@ +2671,3 @@
+      len--;
+    if (len > 0 &&
+        (!g_path_is_absolute (filename) || len > g_path_skip_root (filename) - filename))

add some parenthesis here?
Comment 4 LRN 2014-08-04 12:32:52 UTC
I'll remove errno, but everything else is a copy of https://git.gnome.org/browse/glib/tree/gio/glocalfileinfo.c#n1713
Comment 5 LRN 2015-04-05 11:06:49 UTC
Created attachment 300983 [details] [review]
W32: use 64-bit stat for localfile size calculation
Comment 6 Ignacio Casal Quinteiro (nacho) 2015-04-05 11:10:51 UTC
Review of attachment 300983 [details] [review]:

So this also has several months of testing so it should be fine to push it. I'd say let's get the ack from some glib maintainer.
Comment 7 Alexander Larsson 2015-04-16 17:33:10 UTC
Review of attachment 300983 [details] [review]:

Looks good to me
Comment 8 LRN 2015-04-16 20:01:29 UTC
Attachment 300983 [details] pushed as 6a25434 - W32: use 64-bit stat for localfile size calculation