scripts/faddr2line: Set LANG=C to enforce ASCII output
PATCH 1/1 scripts/faddr2line: Set LANG=C to enforce ASCII output
Force tools like readelf to use the POSIX/C locale by exporting LANG=C This ensures ASCII-only output and avoids locale-specific characters(e.g., UTF-8 symbols or translated strings), which could break text processing utilities like sed in the script
Signed-off-by John Wang <[email protected]>
--- scripts/faddr2line | 4 ++++ 1 file changed, 4 insertions(+)
scripts/faddr2line +4 -0
@@ -76,6 +76,10 @@ ADDR2LINE="${UTIL_PREFIX}addr2line${UTIL_SUFFIX}" AWK="awk" GREP="grep" +# Enforce ASCII-only output from tools like readelf +# ensuring sed processes strings correctly. +export LANG=C + command -v ${AWK} >/dev/null 2>&1 || die "${AWK} isn't installed" command -v ${READELF} >/dev/null 2>&1 || die "${READELF} isn't installed" command -v ${ADDR2LINE} >/dev/null 2>&1 || die "${ADDR2LINE} isn't installed"
Signature · 1 line
2.34.1