bash.patch 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. This patch documents two implemented and classical command
  2. line options "-v" and "-x". It is derived from Debian GNU/Linux.
  3. Index: doc/bash.1
  4. --- doc/bash.1.orig 2019-01-02 15:14:30.000000000 +0100
  5. +++ doc/bash.1 2019-01-07 20:08:18.484696000 +0100
  6. @@ -122,6 +122,12 @@
  7. when invoking an interactive shell or when reading input
  8. through a pipe.
  9. .TP
  10. +.B \-v
  11. +Print shell input lines as they are read.
  12. +.TP
  13. +.B \-x
  14. +Print commands and their arguments as they are executed.
  15. +.TP
  16. .B \-D
  17. A list of all double-quoted strings preceded by \fB$\fP
  18. is printed on the standard output.
  19. -----------------------------------------------------------------------------
  20. This adds the OpenPKG packaging brand.
  21. Index: version.c
  22. --- version.c.orig 2019-01-02 15:39:37.000000000 +0100
  23. +++ version.c 2019-01-07 20:08:18.484964000 +0100
  24. @@ -83,7 +83,7 @@
  25. show_shell_version (extended)
  26. int extended;
  27. {
  28. - printf (_("GNU bash, version %s (%s)\n"), shell_version_string (), MACHTYPE);
  29. + printf (_("GNU bash, version %s (%s) [@l_openpkg_release@]\n"), shell_version_string (), MACHTYPE);
  30. if (extended)
  31. {
  32. printf ("%s\n", _(bash_copyright));
  33. -----------------------------------------------------------------------------
  34. Ensure that Autoconf and friends are not run.
  35. Index: Makefile.in
  36. --- Makefile.in.orig 2018-05-25 14:47:09.000000000 +0200
  37. +++ Makefile.in 2019-01-07 20:08:18.485395000 +0100
  38. @@ -775,7 +775,6 @@
  39. # comment out for distribution
  40. $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/config.h.in
  41. - cd $(srcdir) && autoconf
  42. # for chet
  43. reconfig: force
  44. -----------------------------------------------------------------------------
  45. Fix Bash getcwd(3) run-time issue seen on Solaris where size argument
  46. of 0 does not malloc buffer as expected by Bash code.
  47. Index: builtins/common.c
  48. --- builtins/common.c.orig 2018-07-12 22:51:23.000000000 +0200
  49. +++ builtins/common.c 2019-01-07 20:08:18.485639000 +0100
  50. @@ -569,10 +569,11 @@
  51. if (the_current_working_directory == 0)
  52. {
  53. + char *t = xmalloc(PATH_MAX);
  54. #if defined (GETCWD_BROKEN)
  55. - the_current_working_directory = getcwd (0, PATH_MAX);
  56. + the_current_working_directory = getcwd (t, PATH_MAX);
  57. #else
  58. - the_current_working_directory = getcwd (0, 0);
  59. + the_current_working_directory = getcwd (t, PATH_MAX);
  60. #endif
  61. if (the_current_working_directory == 0)
  62. {
  63. -----------------------------------------------------------------------------
  64. Fix building under Linux.
  65. Index: externs.h
  66. --- externs.h.orig 2018-12-08 17:15:54.000000000 +0100
  67. +++ externs.h 2019-01-07 20:08:18.485852000 +0100
  68. @@ -25,6 +25,7 @@
  69. # define _EXTERNS_H_
  70. #include "stdc.h"
  71. +#include <stdio.h>
  72. /* Functions from expr.c. */
  73. #define EXP_EXPANDED 0x01
  74. -----------------------------------------------------------------------------
  75. Fix building with disabled NLS.
  76. Index: locale.c
  77. --- locale.c.orig 2020-02-24 21:08:43.000000000 +0100
  78. +++ locale.c 2022-01-01 12:13:02.457102000 +0100
  79. @@ -91,7 +91,7 @@
  80. #if defined (HANDLE_MULTIBYTE)
  81. locale_shiftstates = mblen ((char *)NULL, 0);
  82. #else
  83. - local_shiftstates = 0;
  84. + locale_shiftstates = 0;
  85. #endif
  86. }
  87. @@ -117,7 +117,7 @@
  88. # if defined (HANDLE_MULTIBYTE)
  89. locale_shiftstates = mblen ((char *)NULL, 0);
  90. # else
  91. - local_shiftstates = 0;
  92. + locale_shiftstates = 0;
  93. # endif
  94. u32reset ();
  95. @@ -226,7 +226,7 @@
  96. # if defined (HANDLE_MULTIBYTE)
  97. locale_shiftstates = mblen ((char *)NULL, 0);
  98. # else
  99. - local_shiftstates = 0;
  100. + locale_shiftstates = 0;
  101. # endif
  102. u32reset ();
  103. return r;
  104. @@ -250,7 +250,7 @@
  105. #if defined (HANDLE_MULTIBYTE)
  106. locale_shiftstates = mblen ((char *)NULL, 0);
  107. #else
  108. - local_shiftstates = 0;
  109. + locale_shiftstates = 0;
  110. #endif
  111. u32reset ();
  112. }
  113. @@ -391,7 +391,7 @@
  114. # if defined (HANDLE_MULTIBYTE)
  115. locale_shiftstates = mblen ((char *)NULL, 0);
  116. # else
  117. - local_shiftstates = 0;
  118. + locale_shiftstates = 0;
  119. # endif
  120. u32reset ();
  121. #endif
  122. -----------------------------------------------------------------------------
  123. Fix static/non-static conflict.
  124. Index: lib/glob/glob.c
  125. --- lib/glob/glob.c.orig 2020-10-30 19:49:00.000000000 +0100
  126. +++ lib/glob/glob.c 2022-01-01 12:18:32.796180000 +0100
  127. @@ -122,7 +122,7 @@
  128. #else
  129. # define dequote_pathname udequote_pathname
  130. #endif
  131. -static void dequote_pathname PARAMS((char *));
  132. +void dequote_pathname PARAMS((char *));
  133. static int glob_testdir PARAMS((char *, int));
  134. static char **glob_dir_to_array PARAMS((char *, char **, int));
  135. @@ -496,7 +496,7 @@
  136. free (orig_wpathname);
  137. }
  138. -static void
  139. +void
  140. dequote_pathname (pathname)
  141. char *pathname;
  142. {