diff --git a/package/base/bash/bash3/bash30-017t2.patch b/package/base/bash/bash3/bash30-017t2.patch new file mode 100644 index 000000000..af9e81486 --- /dev/null +++ b/package/base/bash/bash3/bash30-017t2.patch @@ -0,0 +1,80 @@ +# --- T2-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# T2 SDE: package/.../bash/bash30-017t2.patch +# Copyright (C) 2004 - 2005 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- T2-COPYRIGHT-NOTE-END --- +First of all, Chet is unwilling (actually uncapable because he is +obviously not using a vcs) to release an official patch. + +According to the bash-bug mailing list and based on some hints from Chet, +this patch was created. If fixes the off-by-n bug due to assigning +COMP_WORDBREAKS in an rcfile and the segfault produced by 'unset FUNCNAME'. + --jsaw + +diff -ur bash-3.0/variables.c bash-3.0-17t2/variables.c +--- bash-3.0/variables.c 2005-01-12 03:36:49.000000000 +0100 ++++ bash-3.0-17t2/variables.c 2005-01-12 03:58:24.769591688 +0100 +@@ -1386,7 +1386,7 @@ + #else + INIT_DYNAMIC_VAR ("FUNCNAME", (char *)NULL, get_funcname, null_assign); + #endif +- VSETATTR (v, att_invisible|att_noassign); ++ VSETATTR (v, att_invisible|att_noassign|att_nounset); + return v; + } + +@@ -1909,9 +1909,13 @@ + + VUNSETATTR (var, att_invisible); + +- t = make_variable_value (var, value); +- FREE (value_cell (var)); +- var_setvalue (var, t); ++ if (var->assign_func) ++ (*(var->assign_func)) (var, value, -1); ++ else { ++ t = make_variable_value (var, value); ++ FREE (value_cell (var)); ++ var_setvalue (var, t); ++ } + + INVALIDATE_EXPORTSTR (var); + +@@ -3637,6 +3641,7 @@ + #endif + + #if defined (READLINE) ++ { "COMP_WORDBREAKS", sv_comp_wordbreaks }, + { "HOSTFILE", sv_hostfile }, + #endif + +@@ -3776,6 +3781,19 @@ + } + } + ++#if defined (READLINE) ++void ++sv_comp_wordbreaks (name) ++ char *name; ++{ ++ SHELL_VAR *sv; ++ ++ sv = find_variable (name); ++ if (sv == 0) ++ rl_completer_word_break_characters = (char *)NULL; ++} ++#endif ++ + /* What to do when GLOBIGNORE changes. */ + void + sv_globignore (name)