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: eb61a4fb14d2 ("xen: fix header guard generation for asm-generic headers")
Reported-by: Jan Beulich <jbeul...@suse.com>
Signed-off-by: Nicola Vetrini <nicola.vetr...@bugseng.com>
---
 xen/scripts/Makefile.asm-generic | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-generic
index f6850758c54b..4e628e116adf 100644
--- a/xen/scripts/Makefile.asm-generic
+++ b/xen/scripts/Makefile.asm-generic
@@ -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; \
-- 
2.43.0


Reply via email to