+2008-05-03 Eli Zaretskii <eliz@gnu.org>
+
+ * dired.c (Ffile_attributes): Don't allow the device number become
+ negative.
+
2008-05-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* config.in: Regenerate.
/* But keep the most common cases as integers. */
values[10] = make_number (ino);
- /* Likewise for device. */
- if (FIXNUM_OVERFLOW_P (s.st_dev))
+ /* Likewise for device, but don't let it become negative. We used
+ to use FIXNUM_OVERFLOW_P here, but that won't catch large
+ positive numbers such as 0xFFEEDDCC. */
+ if ((EMACS_INT)s.st_dev < 0
+ || (EMACS_INT)s.st_dev > MOST_POSITIVE_FIXNUM)
values[11] = Fcons (make_number (s.st_dev >> 16),
make_number (s.st_dev & 0xffff));
else