diff --git a/ChangeLog b/ChangeLog index 92468c13..392b06af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-08-27 Eli Zaretskii + + * variable.c (define_automatic_variables) [__MSDOS__ || WINDOWS32]: + Remove trailing backslashes in $(@D), $( * NEWS: Accidentally forgot to back out the sorted wildcard diff --git a/variable.c b/variable.c index 915be20a..0d85546c 100644 --- a/variable.c +++ b/variable.c @@ -917,7 +917,23 @@ define_automatic_variables (void) define_variable_cname ("?D", "$(dir $?)", o_automatic, 1); define_variable_cname ("^D", "$(dir $^)", o_automatic, 1); define_variable_cname ("+D", "$(dir $+)", o_automatic, 1); -#else +#elif defined(__MSDOS__) || defined(WINDOWS32) + /* For consistency, remove the trailing backslash as well as slash. */ + define_variable_cname ("@D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $@)))", + o_automatic, 1); + define_variable_cname ("%D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $%)))", + o_automatic, 1); + define_variable_cname ("*D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $*)))", + o_automatic, 1); + define_variable_cname ("