small makefile to produce what I mean: ------------ cut here --------------- TRY=APP.BA\x BPP.BB\y
all: @echo $(foreach x,$(TRY),$(firstword $(subst ., ,$x))) none: @echo $(basename $(TRY)) ------------- cut here --------------- "make all" does my workaround "make none" does the 'native' basename. expect APP BPP since 4.x window/cygwin APP.BA\x BPP.BB\y -----Original Message----- From: Paul Smith <psm...@gnu.org> Sent: Friday, 21 May 2021 4:15 PM To: Ronald Hoogenboom <rhoogenb...@irdeto.com>; bug-make@gnu.org Subject: Re: basename function in 4.3 cygwin On Fri, 2021-05-21 at 08:31 +0000, Ronald Hoogenboom wrote: > The difference happens when a suffix contains one or more backslashes. > This is sometimes needed to escape special behavior of meta characters > in the shell. The basename function in 3.81 would return everything up > to the last period like documented in the info file, but the basename > function in 4.3 apparently considers the backslash in the suffix as a > path separator (I guess...). Can you provide a repro case? I don't don't know much about Windows, but I don't understand how you can tell the difference between a "suffix containing backslashes" versus a directory that contains a suffix. Is it not allowed for a directory to contain a suffix in Windows or something? E.g., is "C:\foo\bar.biz\baz" not a valid file named "biz" in a directory named "C:\foo\bar.biz" ?