diff options
author | Martin Rudalics <rudalics@gmx.at> | 2008-09-15 09:23:45 +0000 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2008-09-15 09:23:45 +0000 |
commit | 35e3abe55c73df65a7003f554fbdfbe17a327c32 (patch) | |
tree | ccb4974f8f608b4712d3294f2368d04e7f8afeb4 /lisp | |
parent | 4e822bdc11e453f03029768083f3e712e702fc4b (diff) | |
download | emacs-35e3abe55c73df65a7003f554fbdfbe17a327c32.tar.gz emacs-35e3abe55c73df65a7003f554fbdfbe17a327c32.tar.bz2 emacs-35e3abe55c73df65a7003f554fbdfbe17a327c32.zip |
(file-truename): Don't raise args-out-of-range error
when filename has no separator on windows-nt. (Bug#982)
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/files.el | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4bbc8597270..c3c4835ad9e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-09-15 Martin Rudalics <rudalics@gmx.at> + + * files.el (file-truename): Don't raise args-out-of-range error + when filename has no separator on windows-nt. (Bug#982) + 2008-09-14 Stefan Monnier <monnier@iro.umontreal.ca> * diff-mode.el (diff-find-file-name): Rename `batch' to `noprompt' and diff --git a/lisp/files.el b/lisp/files.el index 76e50247d6f..2773c9f14b0 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -856,10 +856,14 @@ containing it, until no links are left at any level. missing rest) (if longname (setq filename longname) - ;; include the preceding directory separator in the missing + ;; Include the preceding directory separator in the missing ;; part so subsequent recursion on the rest works. (setq missing (concat "/" (file-name-nondirectory filename))) - (setq rest (substring filename 0 (* -1 (length missing)))) + (let ((length (length missing))) + (setq rest + (if (> length (length filename)) + "" + (substring filename 0 (- length))))) (setq filename (concat (file-truename rest) missing)))))) (setq done t))) |