bash.patch 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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 2004-07-12 17:27:08 +0200
  5. +++ doc/bash.1 2004-07-27 19:47:10 +0200
  6. @@ -113,6 +113,12 @@
  7. This option allows the positional parameters to be set
  8. when invoking an interactive shell.
  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 ouput.
  19. -----------------------------------------------------------------------------
  20. This patch adds an explicit recognition for terminal sequence "kD" to be
  21. "Delete" key. This is derived from Debian GNU/Linux and SuSE Linux.
  22. Index: lib/readline/terminal.c
  23. --- lib/readline/terminal.c.orig 2003-09-18 17:03:42 +0200
  24. +++ lib/readline/terminal.c 2004-07-27 20:03:17 +0200
  25. @@ -145,6 +145,9 @@
  26. static char *_rl_term_kH;
  27. static char *_rl_term_at7; /* @7 */
  28. +/* The key sequence sent by the Delete key, if any. */
  29. +static char *_rl_term_kD;
  30. +
  31. /* Insert key */
  32. static char *_rl_term_kI;
  33. @@ -313,6 +316,7 @@
  34. { "ei", &_rl_term_ei },
  35. { "ic", &_rl_term_ic },
  36. { "im", &_rl_term_im },
  37. + { "kD", &_rl_term_kD }, /* delete */
  38. { "kH", &_rl_term_kH }, /* home down ?? */
  39. { "kI", &_rl_term_kI }, /* insert */
  40. { "kd", &_rl_term_kd },
  41. @@ -492,6 +496,7 @@
  42. rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */
  43. rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line); /* End */
  44. + rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete); /* Delete */
  45. _rl_keymap = xkeymap;
  46. }
  47. -----------------------------------------------------------------------------
  48. This patch makes sure a signal state variable is declared "volatile" so
  49. it is consistent throughout signal handling. This patch is derived from
  50. SuSE Linux.
  51. Index: quit.h
  52. --- quit.h.orig 2001-09-10 16:08:33 +0200
  53. +++ quit.h 2004-07-27 19:47:10 +0200
  54. @@ -22,7 +22,7 @@
  55. #define _QUIT_H_
  56. /* Non-zero means SIGINT has already ocurred. */
  57. -extern int interrupt_state;
  58. +extern volatile int interrupt_state;
  59. /* Macro to call a great deal. SIGINT just sets above variable. When
  60. it is safe, put QUIT in the code, and the "interrupt" will take place. */
  61. Index: sig.c
  62. --- sig.c.orig 2003-12-19 22:11:35 +0100
  63. +++ sig.c 2004-07-27 19:47:10 +0200
  64. @@ -59,7 +59,7 @@
  65. extern int parse_and_execute_level, shell_initialized;
  66. /* Non-zero after SIGINT. */
  67. -int interrupt_state;
  68. +volatile int interrupt_state = 0;
  69. /* The environment at the top-level R-E loop. We use this in
  70. the case of error return. */
  71. @@ -71,7 +71,7 @@
  72. #endif /* JOB_CONTROL */
  73. /* When non-zero, we throw_to_top_level (). */
  74. -int interrupt_immediately = 0;
  75. +volatile int interrupt_immediately = 0;
  76. static void initialize_shell_signals __P((void));
  77. -----------------------------------------------------------------------------
  78. Port to HP-UX 11i and similar less smart platforms.
  79. Index: configure
  80. --- configure.orig 2004-07-21 22:18:56 +0200
  81. +++ configure 2004-07-27 19:47:10 +0200
  82. @@ -1479,6 +1479,7 @@
  83. *-beos*) opt_bash_malloc=no ;; # they say it's suitable
  84. *-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
  85. *-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft
  86. +*-hpux*) opt_bash_malloc=no ;; # HP HP-UX
  87. esac
  88. # memory scrambling on free()
  89. @@ -1624,7 +1625,7 @@
  90. else
  91. MALLOC_LIB=
  92. - MALLOC_LIBRARY=
  93. + MALLOC_LIBRARY=dummy
  94. MALLOC_LDFLAGS=
  95. MALLOC_DEP=
  96. fi
  97. Index: syntax.h
  98. --- syntax.h.orig 2004-04-15 05:19:36 +0200
  99. +++ syntax.h 2004-07-27 19:47:10 +0200
  100. @@ -21,6 +21,8 @@
  101. #ifndef _SYNTAX_H_
  102. #define _SYNTAX_H_
  103. +#include "config.h"
  104. +
  105. /* Defines for use by mksyntax.c */
  106. #define slashify_in_quotes "\\`$\"\n"
  107. -----------------------------------------------------------------------------
  108. This adds the OpenPKG packaging brand.
  109. Index: version.c
  110. --- version.c.orig 2003-12-19 22:34:02 +0100
  111. +++ version.c 2004-07-27 19:47:10 +0200
  112. @@ -77,7 +77,7 @@
  113. show_shell_version (extended)
  114. int extended;
  115. {
  116. - printf ("GNU bash, version %s (%s)\n", shell_version_string (), MACHTYPE);
  117. + printf ("GNU bash, version %s (%s) [@l_openpkg_release@]\n", shell_version_string (), MACHTYPE);
  118. if (extended)
  119. printf (_("Copyright (C) 2004 Free Software Foundation, Inc.\n"));
  120. }
  121. -----------------------------------------------------------------------------
  122. Fix display handling of multi-line prompts.
  123. Index: lib/readline/display.c
  124. --- lib/readline/display.c.orig 2004-05-28 04:57:51 +0200
  125. +++ lib/readline/display.c 2004-07-28 20:17:43 +0200
  126. @@ -351,14 +351,14 @@
  127. local_prompt = expand_prompt (p, &prompt_visible_length,
  128. &prompt_last_invisible,
  129. (int *)NULL,
  130. - (int *)NULL);
  131. + &prompt_physical_chars);
  132. c = *t; *t = '\0';
  133. /* The portion of the prompt string up to and including the
  134. final newline is now null-terminated. */
  135. local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
  136. (int *)NULL,
  137. &prompt_invis_chars_first_line,
  138. - &prompt_physical_chars);
  139. + (int *)NULL);
  140. *t = c;
  141. return (prompt_prefix_length);
  142. }
  143. -----------------------------------------------------------------------------
  144. Fix timezone handling for HPUX
  145. Index: lib/sh/strftime.c
  146. --- lib/sh/strftime.c.orig 2004-03-04 04:13:23 +0100
  147. +++ lib/sh/strftime.c 2004-08-06 12:40:06 +0200
  148. @@ -97,6 +97,8 @@
  149. extern int daylight;
  150. #if defined(SOLARIS) || defined(mips) || defined (M_UNIX)
  151. extern long int timezone, altzone;
  152. +#elif defined(HPUX)
  153. +extern long int timezone;
  154. #else
  155. extern int timezone, altzone;
  156. #endif
  157. @@ -480,7 +482,11 @@
  158. * Systems with tzname[] probably have timezone as
  159. * secs west of GMT. Convert to mins east of GMT.
  160. */
  161. +#if defined(HPUX)
  162. + off = -(timezone / 60);
  163. +#else
  164. off = -(daylight ? timezone : altzone) / 60;
  165. +#endif /* HPUX */
  166. #else /* !HAVE_TZNAME */
  167. off = -zone.tz_minuteswest;
  168. #endif /* !HAVE_TZNAME */
  169. -----------------------------------------------------------------------------
  170. Fix segfault when accessing an unset array.
  171. http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00026.html
  172. Index: arrayfunc.c
  173. --- arrayfunc.c.orig 2003-12-19 06:03:09 +0100
  174. +++ arrayfunc.c 2004-08-11 15:17:03 +0200
  175. @@ -611,7 +611,7 @@
  176. var = find_variable (t);
  177. free (t);
  178. - return var;
  179. + return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var;
  180. }
  181. /* Return a string containing the elements in the array and subscript
  182. -----------------------------------------------------------------------------
  183. Fix nested brace vs. variable expansion.
  184. http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00056.html
  185. Index: braces.c
  186. --- braces.c.orig 2003-12-04 17:09:52 +0100
  187. +++ braces.c 2004-08-11 15:18:14 +0200
  188. @@ -402,6 +402,7 @@
  189. {
  190. pass_next = 1;
  191. i++;
  192. + level++;
  193. continue;
  194. }
  195. #endif