emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src dired.c


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs/src dired.c
Date: Wed, 18 Mar 2009 20:37:34 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Eli Zaretskii <eliz>    09/03/18 20:37:34

Modified files:
        src            : dired.c 

Log message:
        (Ffile_attributes): Make sure UID and GID are always positive, even
        if the value is too large for a positive EMACS_INT.  Doc fix.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/dired.c?cvsroot=emacs&r1=1.160&r2=1.161

Patches:
Index: dired.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/dired.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -b -r1.160 -r1.161
--- dired.c     18 Mar 2009 02:26:31 -0000      1.160
+++ dired.c     18 Mar 2009 20:37:34 -0000      1.161
@@ -906,8 +906,8 @@
 Elements of the attribute list are:
  0. t for directory, string (name linked to) for symbolic link, or nil.
  1. Number of links to file.
- 2. File uid as a string or an integer.  If a string value cannot be
-  looked up, the integer value is returned.
+ 2. File uid as a string or a number.  If a string value cannot be
+  looked up, a numeric value, either an integer or a float, is returned.
  3. File gid, likewise.
  4. Last access time, as a list of two integers.
   First integer has high-order 16 bits of time, second has low 16 bits.
@@ -980,8 +980,16 @@
   gid = s.st_gid;
   if (NILP (id_format) || EQ (id_format, Qinteger))
     {
-      values[2] = make_fixnum_or_float (uid);
-      values[3] = make_fixnum_or_float (gid);
+      if (sizeof (s.st_uid) > sizeof (uid) || uid < 0
+         || FIXNUM_OVERFLOW_P (uid))
+       values[2] = make_float ((double)s.st_uid);
+      else
+       values[2] = make_number (uid);
+      if (sizeof (s.st_gid) > sizeof (gid) || gid < 0
+         || FIXNUM_OVERFLOW_P (gid))
+       values[3] = make_float ((double)s.st_gid);
+      else
+       values[3] = make_number (gid);
     }
   else
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]