diff options
| -rw-r--r-- | lisp/net/tramp-sh.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1489405b84c..071ef7982af 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -1307,18 +1307,10 @@ target of the symlink differ." | |||
| 1307 | (setq res-inode | 1307 | (setq res-inode |
| 1308 | (condition-case err | 1308 | (condition-case err |
| 1309 | (read (current-buffer)) | 1309 | (read (current-buffer)) |
| 1310 | (invalid-read-syntax | 1310 | ;; This error happens in Emacs 23. Starting with |
| 1311 | (when (and (equal (cadr err) | 1311 | ;; Emacs 24, a large integer will be converted into |
| 1312 | "Integer constant overflow in reader") | 1312 | ;; a float automatically during `read'. |
| 1313 | (string-match | 1313 | (overflow-error (string-to-number (cadr err))))) |
| 1314 | "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'" | ||
| 1315 | (car (cddr err)))) | ||
| 1316 | (let* ((big (read (substring (car (cddr err)) 0 | ||
| 1317 | (match-beginning 1)))) | ||
| 1318 | (small (read (match-string 1 (car (cddr err))))) | ||
| 1319 | (twiddle (/ small 65536))) | ||
| 1320 | (cons (+ big twiddle) | ||
| 1321 | (- small (* twiddle 65536)))))))) | ||
| 1322 | ;; ... file mode flags | 1314 | ;; ... file mode flags |
| 1323 | (setq res-filemodes (symbol-name (read (current-buffer)))) | 1315 | (setq res-filemodes (symbol-name (read (current-buffer)))) |
| 1324 | ;; ... number links | 1316 | ;; ... number links |
| @@ -5065,8 +5057,19 @@ Return ATTR." | |||
| 5065 | (unless (listp (nth 10 attr)) | 5057 | (unless (listp (nth 10 attr)) |
| 5066 | (setcar (nthcdr 10 attr) | 5058 | (setcar (nthcdr 10 attr) |
| 5067 | (condition-case nil | 5059 | (condition-case nil |
| 5068 | (cons (floor (nth 10 attr) 65536) | 5060 | (let ((high (nth 10 attr)) |
| 5069 | (floor (mod (nth 10 attr) 65536))) | 5061 | middle low) |
| 5062 | (if (<= high most-positive-fixnum) | ||
| 5063 | (floor high) | ||
| 5064 | ;; The low 16 bits. | ||
| 5065 | (setq low (mod high #x10000) | ||
| 5066 | high (/ high #x10000)) | ||
| 5067 | (if (<= high most-positive-fixnum) | ||
| 5068 | (cons (floor high) (floor low)) | ||
| 5069 | ;; The middle 24 bits. | ||
| 5070 | (setq middle (mod high #x1000000) | ||
| 5071 | high (/ high #x1000000)) | ||
| 5072 | (cons (floor high) (cons (floor middle) (floor low)))))) | ||
| 5070 | ;; Inodes can be incredible huge. We must hide this. | 5073 | ;; Inodes can be incredible huge. We must hide this. |
| 5071 | (error (tramp-get-inode vec))))) | 5074 | (error (tramp-get-inode vec))))) |
| 5072 | ;; Set virtual device number. | 5075 | ;; Set virtual device number. |