0002-parse.y-fix-compilation-for-non-multibyte-builds.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From 0217fc2816e47ee296472df71d1011f0eb2937e6 Mon Sep 17 00:00:00 2001
  2. From: Vincent Fazio <vfazio@gmail.com>
  3. Date: Fri, 27 Jan 2023 14:37:26 -0600
  4. Subject: [PATCH] parse.y: fix compilation for non-multibyte builds
  5. Builds configured with --disable-multibyte or when the toolchain does
  6. not have WCHAR support would encounter a compile error due to an
  7. undeclared reference to shell_input_line_property in shell_getc.
  8. Add a HANDLE_MULTIBYTE guard to conditionally compile the block that
  9. references shell_input_line_property in shell_getc as it's only declared
  10. when HANDLE_MULTIBYTE is defined.
  11. Signed-off-by: Vincent Fazio <vfazio@gmail.com>
  12. [Upstream status: https://savannah.gnu.org/patch/index.php?10309]
  13. ---
  14. parse.y | 2 ++
  15. y.tab.c | 2 ++
  16. 2 files changed, 4 insertions(+)
  17. diff --git a/parse.y b/parse.y
  18. index 1d12e639..8f1355c6 100644
  19. --- a/parse.y
  20. +++ b/parse.y
  21. @@ -2625,6 +2625,7 @@ next_alias_char:
  22. parser_state |= PST_ENDALIAS;
  23. /* We need to do this to make sure last_shell_getc_is_singlebyte returns
  24. true, since we are returning a single-byte space. */
  25. +#if defined (HANDLE_MULTIBYTE)
  26. if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0)
  27. {
  28. #if 0
  29. @@ -2638,6 +2639,7 @@ next_alias_char:
  30. shell_input_line_property[shell_input_line_index - 1] = 1;
  31. #endif
  32. }
  33. +#endif /* HANDLE_MULTIBYTE */
  34. return ' '; /* END_ALIAS */
  35. }
  36. #endif
  37. diff --git a/y.tab.c b/y.tab.c
  38. index 50c5845b..799f730f 100644
  39. --- a/y.tab.c
  40. +++ b/y.tab.c
  41. @@ -4936,6 +4936,7 @@ next_alias_char:
  42. parser_state |= PST_ENDALIAS;
  43. /* We need to do this to make sure last_shell_getc_is_singlebyte returns
  44. true, since we are returning a single-byte space. */
  45. +#if defined (HANDLE_MULTIBYTE)
  46. if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0)
  47. {
  48. #if 0
  49. @@ -4949,6 +4950,7 @@ next_alias_char:
  50. shell_input_line_property[shell_input_line_index - 1] = 1;
  51. #endif
  52. }
  53. +#endif /* HANDLE_MULTIBYTE */
  54. return ' '; /* END_ALIAS */
  55. }
  56. #endif
  57. --
  58. 2.25.1