GNU bug report logs - #36502
27.0.50; infinite loop in file-name-case-insensitive-p

Previous Next

Package: emacs;

Reported by: Daniel Sutton <dan <at> dpsutton.com>

Date: Thu, 4 Jul 2019 16:53:02 UTC

Severity: normal

Found in version 27.0.50

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: dan <at> dpsutton.com, npostavs <at> gmail.com, 36502 <at> debbugs.gnu.org
Subject: bug#36502: Fwd: bug#36502: 27.0.50; infinite loop in file-name-case-insensitive-p
Date: Mon, 08 Jul 2019 16:59:55 +0300
> From: Ken Brown <kbrown <at> cornell.edu>
> CC: "npostavs <at> gmail.com" <npostavs <at> gmail.com>, "dan <at> dpsutton.com"
> 	<dan <at> dpsutton.com>, "36502 <at> debbugs.gnu.org" <36502 <at> debbugs.gnu.org>
> Date: Mon, 8 Jul 2019 13:36:38 +0000
> 
> >>      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.

I'm asking why not do this instead:

  if (NILP (default_directory))
    {
      default_directory = BVAR (current_buffer, directory);
      if (NILP (Ffile_name_absolute_p (default_directory)))
        default_directory = Fexpand_file_name (default_directory,
	                                       Vinvocation_directory);
    }

Or will the above not work for some reason?

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

Sure, but this loses information.  Of course, if we cannot do better
reliably, it's an okay solution.

Thanks.




This bug report was last modified 5 years and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.