xen: fix unspecified behavior in tr invocation

The result of the command is undefined according to the specification if
the "string2" argument in tr is shorter than "string1". GNU tr behaves
correctly by extending "string2" to repeat the last character.

Fixes: eb61a4fb14 ("xen: fix header guard generation for asm-generic headers")
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Nicola Vetrini authored and Jan Beulich committed 2025-06-30 10:06:54 +02:00
1 parent 448826d95d
commit 09a338ae72
1 file changed
+1 -1
+1 -1
View File
@@ -34,7 +34,7 @@ unwanted := $(filter-out $(generic-y) $(generated-y),$(old-headers))
quiet_cmd_wrap = WRAP $@
cmd_wrap = \
arch=$$(echo $@ | sed -n 's:.*arch/\([^/]*\)/.*:\1:p' | tr a-z A-Z); \
upper=$$(echo $*.h | tr a-z A-Z | tr '/.-' '__'); \
upper=$$(echo $*.h | tr a-z A-Z | tr '/.-' '___'); \
echo "\#ifndef $${arch}_GENERIC_$${upper}" > $@.new; \
echo "\#define $${arch}_GENERIC_$${upper}" >> $@.new; \
echo "\#include <asm-generic/$*.h>" >> $@.new; \
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.