packages/utils/bash/patches/128-upstream-bash42-028.patch
jow e5fbd81a61 [packages] bash: import upstream 4.2 patch series
git-svn-id: svn://svn.openwrt.org/openwrt/packages@31746 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-05-16 01:36:48 +00:00

47 lines
1.7 KiB
Diff

BASH PATCH REPORT
=================
Bash-Release: 4.2
Patch-ID: bash42-028
Bug-Reported-by: Mark Edgar <medgar123@gmail.com>
Bug-Reference-ID: <CABHMh_3d+ZgO_zaEtYXPwK4P7tC0ghZ4g=Ue_TRpsEMf5YDsqw@mail.gmail.com>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00109.html
Bug-Description:
When using a word expansion for which the right hand side is evaluated,
certain expansions of quoted null strings include spurious ^? characters.
Patch (apply with `patch -p0'):
--- a/subst.c
+++ b/subst.c
@@ -5809,6 +5809,16 @@ parameter_brace_expand_rhs (name, value,
is the only expansion that creates more than one word. */
if (qdollaratp && ((hasdol && quoted) || l->next))
*qdollaratp = 1;
+ /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is
+ a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the
+ flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the
+ expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
+ (which is more paranoia than anything else), we need to return the
+ quoted null string and set the flags to indicate it. */
+ if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL(temp) && QUOTED_NULL(l->word->word) && (l->word->flags & W_HASQUOTEDNULL))
+ {
+ w->flags |= W_HASQUOTEDNULL;
+ }
dispose_words (l);
}
else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol)
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 27
+#define PATCHLEVEL 28
#endif /* _PATCHLEVEL_H_ */