summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald van Dijk <truedfx@gentoo.org>2010-08-22 20:24:45 +0000
committerHarald van Dijk <truedfx@gentoo.org>2010-08-22 20:24:45 +0000
commitf3e69bbf27feb4af1f8981179ab653cb808c17f4 (patch)
tree66e1da1542ec96d9d1573c67cb0d2fe84cc2dd7b /app-shells/dash
parentIgnore all peekfd build failures #330631 by Raúl Porcel. (diff)
downloadgentoo-2-f3e69bbf27feb4af1f8981179ab653cb808c17f4.tar.gz
gentoo-2-f3e69bbf27feb4af1f8981179ab653cb808c17f4.tar.bz2
gentoo-2-f3e69bbf27feb4af1f8981179ab653cb808c17f4.zip
Fix IFS handling with read command (#331535)
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'app-shells/dash')
-rw-r--r--app-shells/dash/ChangeLog6
-rw-r--r--app-shells/dash/dash-0.5.6.1-r1.ebuild (renamed from app-shells/dash/dash-0.5.6.1.ebuild)3
-rw-r--r--app-shells/dash/files/dash-0.5.6.1-read-ifs.patch70
3 files changed, 78 insertions, 1 deletions
diff --git a/app-shells/dash/ChangeLog b/app-shells/dash/ChangeLog
index 58508182d2de..f73e490df3cf 100644
--- a/app-shells/dash/ChangeLog
+++ b/app-shells/dash/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-shells/dash
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+*dash-0.5.6.1-r1 (22 Aug 2010)
+
+ 22 Aug 2010; Harald van Dijk <truedfx@gentoo.org> -dash-0.5.6.1.ebuild,
+ +dash-0.5.6.1-r1.ebuild, +files/dash-0.5.6.1-read-ifs.patch:
+ Fix IFS handling with read command (#331535)
+
31 Jul 2010; Lars Wendler <polynomial-c@gentoo.org> dash-0.5.6.1.ebuild:
non-maintainer commit: Readded keywords. Ebuild now removes offending
patch which lead to bug #328929. Commit done with kind permission from
diff --git a/app-shells/dash/dash-0.5.6.1.ebuild b/app-shells/dash/dash-0.5.6.1-r1.ebuild
index 745a86a88f6e..d79bac2040df 100644
--- a/app-shells/dash/dash-0.5.6.1.ebuild
+++ b/app-shells/dash/dash-0.5.6.1-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/dash/dash-0.5.6.1.ebuild,v 1.3 2010/07/31 22:09:47 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/dash/dash-0.5.6.1-r1.ebuild,v 1.1 2010/08/22 20:24:45 truedfx Exp $
EAPI="2"
@@ -30,6 +30,7 @@ src_prepare() {
rm */debian/diff/0006--INPUT-exit-127-if-command_file-is-given-but-doesn-t.diff \
|| die #328929
epatch */debian/diff/*
+ epatch "${FILESDIR}"/${P}-read-ifs.patch #331535
# Fix the invalid sort
sed -i -e 's/LC_COLLATE=C/LC_ALL=C/g' src/mkbuiltins
diff --git a/app-shells/dash/files/dash-0.5.6.1-read-ifs.patch b/app-shells/dash/files/dash-0.5.6.1-read-ifs.patch
new file mode 100644
index 000000000000..ac52610639c8
--- /dev/null
+++ b/app-shells/dash/files/dash-0.5.6.1-read-ifs.patch
@@ -0,0 +1,70 @@
+diff --git a/src/expand.c b/src/expand.c
+index f2f964c..3ba1a38 100644
+--- a/src/expand.c
++++ b/src/expand.c
+@@ -205,7 +205,7 @@ expandarg(union node *arg, struct arglist *arglist, int flag)
+ * TODO - EXP_REDIR
+ */
+ if (flag & EXP_FULL) {
+- ifsbreakup(p, &exparg);
++ ifsbreakup(p, &exparg, 0);
+ *exparg.lastp = NULL;
+ exparg.lastp = &exparg.list;
+ expandmeta(exparg.list, flag);
+@@ -1022,9 +1022,11 @@ recordregion(int start, int end, int nulonly)
+ * Break the argument string into pieces based upon IFS and add the
+ * strings to the argument list. The regions of the string to be
+ * searched for IFS characters have been stored by recordregion.
++ * If bltin is set, use bltinlookup to search for IFS in the
++ * environment of the currently executing built-in command.
+ */
+ void
+-ifsbreakup(char *string, struct arglist *arglist)
++ifsbreakup(char *string, struct arglist *arglist, int bltin)
+ {
+ struct ifsregion *ifsp;
+ struct strlist *sp;
+@@ -1040,7 +1042,13 @@ ifsbreakup(char *string, struct arglist *arglist)
+ if (ifslastp != NULL) {
+ ifsspc = 0;
+ nulonly = 0;
+- realifs = ifsset() ? ifsval() : defifs;
++ if (!bltin)
++ realifs = ifsset() ? ifsval() : defifs;
++ else {
++ realifs = bltinlookup("IFS");
++ if (realifs == NULL)
++ realifs = defifs;
++ }
+ ifsp = &ifsfirst;
+ do {
+ p = string + ifsp->begoff;
+diff --git a/src/expand.h b/src/expand.h
+index 405af0b..8eb5f07 100644
+--- a/src/expand.h
++++ b/src/expand.h
+@@ -69,7 +69,7 @@ char *_rmescapes(char *, int);
+ int casematch(union node *, char *);
+ void recordregion(int, int, int);
+ void removerecordregions(int);
+-void ifsbreakup(char *, struct arglist *);
++void ifsbreakup(char *, struct arglist *, int bltin);
+
+ /* From arith.y */
+ intmax_t arith(const char *);
+diff --git a/src/miscbltin.c b/src/miscbltin.c
+index 5ab1648..6810f5f 100644
+--- a/src/miscbltin.c
++++ b/src/miscbltin.c
+@@ -85,9 +85,10 @@ readcmd_handle_line(char *line, char **ap, size_t len)
+ backup = sstrdup(line);
+
+ arglist.lastp = &arglist.list;
++ removerecordregions(0);
+ recordregion(0, len - 1, 0);
+
+- ifsbreakup(s, &arglist);
++ ifsbreakup(s, &arglist, 1);
+ *arglist.lastp = NULL;
+ removerecordregions(0);
+