From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OnH64-0005CT-9R for garchives@archives.gentoo.org; Sun, 22 Aug 2010 20:24:53 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8BEC9E06A1; Sun, 22 Aug 2010 20:24:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 55CCEE06A1 for ; Sun, 22 Aug 2010 20:24:47 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B16471B4138 for ; Sun, 22 Aug 2010 20:24:46 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 944) id 47F6320051; Sun, 22 Aug 2010 20:24:45 +0000 (UTC) From: "Harald van Dijk (truedfx)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, truedfx@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in app-shells/dash/files: dash-0.5.6.1-read-ifs.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: dash-0.5.6.1-read-ifs.patch X-VCS-Directories: app-shells/dash/files X-VCS-Committer: truedfx X-VCS-Committer-Name: Harald van Dijk Content-Type: text/plain; charset=utf8 Message-Id: <20100822202445.47F6320051@flycatcher.gentoo.org> Date: Sun, 22 Aug 2010 20:24:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: dd68917d-d4e8-4d6c-b53f-7c451915799e X-Archives-Hash: 3e32b911d2c67a31f7287c025d3bc01f truedfx 10/08/22 20:24:45 Added: dash-0.5.6.1-read-ifs.patch Log: Fix IFS handling with read command (#331535) (Portage version: 2.2_rc67/cvs/Linux x86_64) Revision Changes Path 1.1 app-shells/dash/files/dash-0.5.6.1-read-ifs.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/dash/fi= les/dash-0.5.6.1-read-ifs.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/dash/fi= les/dash-0.5.6.1-read-ifs.patch?rev=3D1.1&content-type=3Dtext/plain Index: dash-0.5.6.1-read-ifs.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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, i= nt flag) * TODO - EXP_REDIR */ if (flag & EXP_FULL) { - ifsbreakup(p, &exparg); + ifsbreakup(p, &exparg, 0); *exparg.lastp =3D NULL; exparg.lastp =3D &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 !=3D NULL) { ifsspc =3D 0; nulonly =3D 0; - realifs =3D ifsset() ? ifsval() : defifs; + if (!bltin) + realifs =3D ifsset() ? ifsval() : defifs; + else { + realifs =3D bltinlookup("IFS"); + if (realifs =3D=3D NULL) + realifs =3D defifs; + } ifsp =3D &ifsfirst; do { p =3D 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);=20 -void ifsbreakup(char *, struct arglist *); +void ifsbreakup(char *, struct arglist *, int bltin); =20 /* 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 =3D sstrdup(line); =20 arglist.lastp =3D &arglist.list; + removerecordregions(0); recordregion(0, len - 1, 0); =09 - ifsbreakup(s, &arglist); + ifsbreakup(s, &arglist, 1); *arglist.lastp =3D NULL; removerecordregions(0); =20