From b8242feb8a2b70ce28a72d3976d2c34ce664d0b3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 25 Aug 2019 12:27:54 -0700 Subject: [PATCH] Fix Tramp rounding of file sizes and inode numbers * lisp/net/tramp-sh.el (tramp-perl-file-attributes) (tramp-perl-directory-files-and-attributes): Format file sizes and inode numbers with "%u" instead of "%u.0", to avoid rounding errors when absolute values exceed 2**53 (Bug#36940#94). This fixes the problem for Emacs 27 and later, and doesn't hurt in earlier Emacs. --- lisp/net/tramp-sh.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1f7c8f6e49..542bd1c234 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -669,7 +669,7 @@ tramp-perl-file-attributes $uid = ($ARGV[1] eq \"integer\") ? $stat[4] : \"\\\"\" . getpwuid($stat[4]) . \"\\\"\"; $gid = ($ARGV[1] eq \"integer\") ? $stat[5] : \"\\\"\" . getgrgid($stat[5]) . \"\\\"\"; printf( - \"(%%s %%u %%s %%s (%%u %%u) (%%u %%u) (%%u %%u) %%u.0 %%u t %%u.0 -1)\\n\", + \"(%%s %%u %%s %%s (%%u %%u) (%%u %%u) (%%u %%u) %%u %%u t %%u -1)\\n\", $type, $stat[3], $uid, @@ -719,7 +719,7 @@ tramp-perl-directory-files-and-attributes $gid = ($ARGV[1] eq \"integer\") ? $stat[5] : \"\\\"\" . getgrgid($stat[5]) . \"\\\"\"; $filename =~ s/\"/\\\\\"/g; printf( - \"(\\\"%%s\\\" %%s %%u %%s %%s (%%u %%u) (%%u %%u) (%%u %%u) %%u.0 %%u t %%u.0 -1)\\n\", + \"(\\\"%%s\\\" %%s %%u %%s %%s (%%u %%u) (%%u %%u) (%%u %%u) %%u %%u t %%u -1)\\n\", $filename, $type, $stat[3], -- 2.17.1