patch command incorrectly capitalizes filenames that live on external USB flash drives

Ken Brown
Thu May 14 13:57:11 GMT 2020

On 5/13/2020 8:31 PM, Jason Gross via Cygwin wrote:
> This does not explain why `ls` displays "Makefile" as "Makefile"
> before I run `patch`, but displays the filename as "MAKEFILE" after I
> run `patch`.  Nor does it explain why this happens to patch-modified
> files, but not to files modified via sed -i.

I vaguely recall from several years ago a strange patch issue that I finally 
tracked down to environment variables used by patch to determine its temporary 
directory.  From 'man patch':

           Directory  to  put temporary files in; patch uses the first environ‐
           ment variable in this list that is set.  If none are  set,  the  de‐
           fault is system-dependent; it is normally /tmp on Unix hosts.

Do you have any of those variables set to a value other than /tmp?


More information about the Cygwin mailing list