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: Mon, 8 Jul 2019 13:36:38 +0000
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 7/8/2019 8:25 AM, Eli Zaretskii wrote:
>> From: Ken Brown <kbrown@cornell.edu>
>> CC: "npostavs@gmail.com" <npostavs@gmail.com>, "dan@dpsutton.com"
>>      <dan@dpsutton.com>, "36502@debbugs.gnu.org" <36502@debbugs.gnu.org>
>> Date: Sun, 7 Jul 2019 19:30:00 +0000
>>
>> --- a/src/fileio.c
>> +++ b/src/fileio.c
>> @@ -804,7 +804,11 @@ DEFUN ("expand-file-name", Fexpand_file_name,
>> Sexpand_file_name, 1, 2, 0,
>>
>>      /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted.  
>> */
>>      if (NILP (default_directory))
>> -    default_directory = BVAR (current_buffer, directory);
>> +    {
>> +      default_directory = BVAR (current_buffer, directory);
>> +      if (NILP (Ffile_name_absolute_p (default_directory)))
>> +       default_directory = Qnil;
>> +    }
> 
> Hmm... why nullify it?  Why not simply call expand-file-name
> recursively?

If the current buffer's default-directory is not absolute, then that variable 
is 
invalid and we can't use it.  (This was perhaps not clear until last November, 
when the word "absolute" was added to its doc string.)

Nullifying it guarantees that the code starting with "if (! STRINGP 
(default_directory))" is used.  Maybe I should have put in a comment explaining 
that.

My thinking was that an invalid value of the default-directory variable should 
be treated the same way we treat a non-string value of default_directory.

Ken

reply via email to

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