]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
stat: don't report negative file size as huge positive number
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 May 2012 06:32:02 +0000 (23:32 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 May 2012 06:32:24 +0000 (23:32 -0700)
* src/stat.c (print_stat): Use out_int, not out_uint for stat.st_size.
* NEWS (Bug fixes): Mention it.

NEWS
src/stat.c

diff --git a/NEWS b/NEWS
index eb954047b1f9d18ad9ab13cb835a515fd06d6498..7ef2f547633b56d3b5f407e9d8bd9670fea7a142 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@ GNU coreutils NEWS                                    -*- outline -*-
   split --number=C /dev/null no longer appears to infloop on GNU/Hurd
   [bug introduced in coreutils-8.8]
 
+  stat no longer reports a negative file size as a huge positive number.
+  [bug present since 'stat' was introduced in fileutils-4.1.9]
+
 ** New features
 
   fmt now accepts the --goal=WIDTH (-g) option.
index b2e103084de98a85f0f66593bbcc4ede15b4a1ad..d001cdaa21222011cf48453f9ccb44ac1b583f8f 100644 (file)
@@ -954,7 +954,7 @@ print_stat (char *pformat, size_t prefix_len, unsigned int m,
       out_uint_x (pformat, prefix_len, minor (statbuf->st_rdev));
       break;
     case 's':
-      out_uint (pformat, prefix_len, statbuf->st_size);
+      out_int (pformat, prefix_len, statbuf->st_size);
       break;
     case 'B':
       out_uint (pformat, prefix_len, ST_NBLOCKSIZE);