diff --git a/package/bash/0002-parse.y-fix-compilation-for-non-multibyte-builds.patch b/package/bash/0002-parse.y-fix-compilation-for-non-multibyte-builds.patch new file mode 100644 index 0000000000..d330de5cd4 --- /dev/null +++ b/package/bash/0002-parse.y-fix-compilation-for-non-multibyte-builds.patch @@ -0,0 +1,63 @@ +From 0217fc2816e47ee296472df71d1011f0eb2937e6 Mon Sep 17 00:00:00 2001 +From: Vincent Fazio +Date: Fri, 27 Jan 2023 14:37:26 -0600 +Subject: [PATCH] parse.y: fix compilation for non-multibyte builds + +Builds configured with --disable-multibyte or when the toolchain does +not have WCHAR support would encounter a compile error due to an +undeclared reference to shell_input_line_property in shell_getc. + +Add a HANDLE_MULTIBYTE guard to conditionally compile the block that +references shell_input_line_property in shell_getc as it's only declared +when HANDLE_MULTIBYTE is defined. + +Signed-off-by: Vincent Fazio +[Upstream status: https://savannah.gnu.org/patch/index.php?10309] +--- + parse.y | 2 ++ + y.tab.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/parse.y b/parse.y +index 1d12e639..8f1355c6 100644 +--- a/parse.y ++++ b/parse.y +@@ -2625,6 +2625,7 @@ next_alias_char: + parser_state |= PST_ENDALIAS; + /* We need to do this to make sure last_shell_getc_is_singlebyte returns + true, since we are returning a single-byte space. */ ++#if defined (HANDLE_MULTIBYTE) + if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0) + { + #if 0 +@@ -2638,6 +2639,7 @@ next_alias_char: + shell_input_line_property[shell_input_line_index - 1] = 1; + #endif + } ++#endif /* HANDLE_MULTIBYTE */ + return ' '; /* END_ALIAS */ + } + #endif +diff --git a/y.tab.c b/y.tab.c +index 50c5845b..799f730f 100644 +--- a/y.tab.c ++++ b/y.tab.c +@@ -4936,6 +4936,7 @@ next_alias_char: + parser_state |= PST_ENDALIAS; + /* We need to do this to make sure last_shell_getc_is_singlebyte returns + true, since we are returning a single-byte space. */ ++#if defined (HANDLE_MULTIBYTE) + if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0) + { + #if 0 +@@ -4949,6 +4950,7 @@ next_alias_char: + shell_input_line_property[shell_input_line_index - 1] = 1; + #endif + } ++#endif /* HANDLE_MULTIBYTE */ + return ' '; /* END_ALIAS */ + } + #endif +-- +2.25.1 +