bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#982: 23.0.60; file-truename causes an error


From: martin rudalics
Subject: bug#982: 23.0.60; file-truename causes an error
Date: Mon, 15 Sep 2008 11:27:29 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

> I have a file "c:/tmp/a.txt", but don't have "c:/tmp/b.txt".
> [...]
> (file-truename "./b.txt")
> "c:/tmp/b.txt"
>
> (file-truename "b.txt")
> Debugger entered--Lisp error: (args-out-of-range "b.txt" 0 -1)
>   substring("b.txt" 0 -6)
>   (setq rest (substring filename 0 (* -1 ...)))
>
>
> From files.el:
>
> (defun file-truename (filename &optional counter prev-dirs)
>   ...
>                 (setq missing (concat "/" (file-name-nondirectory filename)))
>                 (setq rest (substring filename 0 (* -1 (length missing))))
>   ...
>
> When FILENAME has no directory separator, MISSING is one char longer
> than FILENAME.  In this case, substring raises an out-of-range error.

I've checked in a fix which should remove the args-out-of-range error.
Please try it since I'm not sure whether the directory part should be
handled better.

Thanks for reporting, martin.







reply via email to

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