bash44-002.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From https://ftp.gnu.org/gnu/bash/bash-4.4-patches/bash44-002
  2. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  3. BASH PATCH REPORT
  4. =================
  5. Bash-Release: 4.4
  6. Patch-ID: bash44-002
  7. Bug-Reported-by: Eric Pruitt <eric.pruitt@gmail.com>
  8. Bug-Reference-ID: <20160916055120.GA28272@sinister.codevat.com>
  9. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00015.html
  10. Bug-Description:
  11. Bash-4.4 warns when discarding NUL bytes in command substitution output
  12. instead of silently dropping them. This patch changes the warnings from
  13. one per NUL byte encountered to one warning per command substitution.
  14. Patch (apply with `patch -p0'):
  15. *** a/bash-4.4/subst.c 2016-08-30 16:46:38.000000000 -0400
  16. --- b/subst.c 2016-09-26 10:20:19.000000000 -0400
  17. ***************
  18. *** 5932,5935 ****
  19. --- 5933,5937 ----
  20. int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul;
  21. ssize_t bufn;
  22. + int nullbyte;
  23. istring = (char *)NULL;
  24. ***************
  25. *** 5939,5942 ****
  26. --- 5941,5946 ----
  27. skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL;
  28. + nullbyte = 0;
  29. +
  30. /* Read the output of the command through the pipe. This may need to be
  31. changed to understand multibyte characters in the future. */
  32. ***************
  33. *** 5957,5961 ****
  34. {
  35. #if 1
  36. ! internal_warning ("%s", _("command substitution: ignored null byte in input"));
  37. #endif
  38. continue;
  39. --- 5961,5969 ----
  40. {
  41. #if 1
  42. ! if (nullbyte == 0)
  43. ! {
  44. ! internal_warning ("%s", _("command substitution: ignored null byte in input"));
  45. ! nullbyte = 1;
  46. ! }
  47. #endif
  48. continue;
  49. *** a/bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  50. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  51. ***************
  52. *** 26,30 ****
  53. looks for to find the patch level (for the sccs version string). */
  54. ! #define PATCHLEVEL 1
  55. #endif /* _PATCHLEVEL_H_ */
  56. --- 26,30 ----
  57. looks for to find the patch level (for the sccs version string). */
  58. ! #define PATCHLEVEL 2
  59. #endif /* _PATCHLEVEL_H_ */