Subject: bug#32246: 27.0.50; files-tests failure on Cygwin

From: Ken Brown <[email-masked]>
Date: Thu, 26 Jul 2018 10:54:38 -0400

On 7/26/2018 9:56 AM, Michael Albinus wrote:
> Michael Albinus <[email-masked]> writes:

Hi Michael,

> It looks that on cygwin, file-name-case-insensitive-p returns different
> values for existing and non-existing files:
> 
> --8<---------------cut here---------------start------------->8---
> M-! touch /tmp/foo
> 
> (file-name-case-insensitive-p "/tmp/foo")
> => nil
> 
> (file-name-case-insensitive-p "/tmp/bar")
> => t
> --8<---------------cut here---------------end--------------->8---

Right.  If the file doesn't exist, then the call to pathconf fails with 
ENOENT, as required by POSIX 
(http://pubs.opengroup.org/onlinepubs/009695299/functions/fpathconf.html). 
  The fallback code in file_name_case_insensitive_p then kicks in and 
returns true on Cygwin.

> The doc of file-name-case-insensitive-p does not require that FILENAME exists.

I think the doc is ambiguous on that.  The first sentence of the doc in 
the elisp manual says, "Sometimes file names or their parts need to be 
compared as strings, in which case it’s important to know whether the 
underlying filesystem is case-insensitive."  This certainly suggests 
that the file should exist, but there's no indication of what the 
function returns for a non-existent file.  And the code doesn't attempt 
to detect this case.

I don't know what the right solution is.

Thanks for tracking down the problem.

Best regards,

Ken