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

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

bug#36502: Fwd: bug#36502: 27.0.50; infinite loop in file-name-case-inse


From: Ken Brown
Subject: bug#36502: Fwd: bug#36502: 27.0.50; infinite loop in file-name-case-insensitive-p
Date: Sat, 6 Jul 2019 15:38:14 +0000
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 7/6/2019 9:27 AM, Noam Postavsky wrote:
> Wouldn't it be better not to infloop in this case though?  E.g.,
> 
> --- i/src/fileio.c
> +++ w/src/fileio.c
> @@ -2408,7 +2408,10 @@ DEFUN ("file-name-case-insensitive-p", 
> Ffile_name_case_insensitive_p,
>   
>     /* If the file doesn't exist, move up the filesystem tree until we
>        reach an existing directory or the root.  */
> -  if (NILP (Ffile_exists_p (filename)))
> +  if (NILP (Ffile_exists_p (filename))
> +      /* If default-directory is relative, expand-file-name can give
> +         a relative name, in which case we can't move up.  */

This doesn't seem right to me.  expand-file-name is documented to return 
an absolute file name, so I don't think callers should have to check for 
that.

> +      && !NILP (Ffile_name_absolute_p (filename)))
>       {
>         filename = Ffile_name_directory (filename);
>         while (NILP (Ffile_exists_p (filename)))
> 
> Or maybe signal an error, either way seems better than just getting stuck.

Maybe expand-file-name should signal an error if default-directory is 
relative?

Ken

reply via email to

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