mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.2 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../bash/bash30-017t2.patch
  5. # Copyright (C) 2004 - 2005 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. First of all, Chet is unwilling (actually uncapable because he is
  17. obviously not using a vcs) to release an official patch.
  18. According to the bash-bug mailing list and based on some hints from Chet,
  19. this patch was created. If fixes the off-by-n bug due to assigning
  20. COMP_WORDBREAKS in an rcfile and the segfault produced by 'unset FUNCNAME'.
  21. --jsaw
  22. diff -ur bash-3.0/variables.c bash-3.0-17t2/variables.c
  23. --- bash-3.0/variables.c 2005-01-12 03:36:49.000000000 +0100
  24. +++ bash-3.0-17t2/variables.c 2005-01-12 03:58:24.769591688 +0100
  25. @@ -1386,7 +1386,7 @@
  26. #else
  27. INIT_DYNAMIC_VAR ("FUNCNAME", (char *)NULL, get_funcname, null_assign);
  28. #endif
  29. - VSETATTR (v, att_invisible|att_noassign);
  30. + VSETATTR (v, att_invisible|att_noassign|att_nounset);
  31. return v;
  32. }
  33. @@ -1909,9 +1909,13 @@
  34. VUNSETATTR (var, att_invisible);
  35. - t = make_variable_value (var, value);
  36. - FREE (value_cell (var));
  37. - var_setvalue (var, t);
  38. + if (var->assign_func)
  39. + (*(var->assign_func)) (var, value, -1);
  40. + else {
  41. + t = make_variable_value (var, value);
  42. + FREE (value_cell (var));
  43. + var_setvalue (var, t);
  44. + }
  45. INVALIDATE_EXPORTSTR (var);
  46. @@ -3637,6 +3641,7 @@
  47. #endif
  48. #if defined (READLINE)
  49. + { "COMP_WORDBREAKS", sv_comp_wordbreaks },
  50. { "HOSTFILE", sv_hostfile },
  51. #endif
  52. @@ -3776,6 +3781,19 @@
  53. }
  54. }
  55. +#if defined (READLINE)
  56. +void
  57. +sv_comp_wordbreaks (name)
  58. + char *name;
  59. +{
  60. + SHELL_VAR *sv;
  61. +
  62. + sv = find_variable (name);
  63. + if (sv == 0)
  64. + rl_completer_word_break_characters = (char *)NULL;
  65. +}
  66. +#endif
  67. +
  68. /* What to do when GLOBIGNORE changes. */
  69. void
  70. sv_globignore (name)