NetBSD Problem Report #47361

From www@NetBSD.org  Sat Dec 22 19:53:03 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 2021A63E58E
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 22 Dec 2012 19:53:03 +0000 (UTC)
Message-Id: <20121222195302.15B4763E58E@www.NetBSD.org>
Date: Sat, 22 Dec 2012 19:53:02 +0000 (UTC)
From: dsl@netbsd.org
Reply-To: dsl@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: /bin/sh incorrectly applies IFS to $barwhen expanding "${foo-$bar}"
X-Send-Pr-Version: www-1.0

>Number:         47361
>Category:       bin
>Synopsis:       /bin/sh incorrectly applies IFS to $barwhen expanding "${foo-$bar}"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 22 19:55:00 +0000 2012
>Closed-Date:    Tue Jun 25 12:44:22 +0000 2013
>Last-Modified:  Tue Jun 25 12:44:22 +0000 2013
>Originator:     David Laight
>Release:        All
>Organization:
NetBSD
>Environment:
Any /bin/sh with expand.h 1.87 or earlier (or equivalent for release branches)
>Description:
/bin/sh incorrectly applies filed splitting when expanding the alternate
text for ${foo-$bar} and ${foo+$bar}.

For Greg Troxel on tech-userlevel.
>How-To-Repeat:
sh -c 'a="x  x"; printf "%s\n" "${PWD+$a}"'
should output "x  x" (without the quotes) on a single line,
buggy versions output one x one each of two lines.
>Fix:

>Release-Note:

>Audit-Trail:
From: "David Laight" <dsl@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47361 CVS commit: src/bin/sh
Date: Sat, 22 Dec 2012 20:15:22 +0000

 Module Name:	src
 Committed By:	dsl
 Date:		Sat Dec 22 20:15:22 UTC 2012

 Modified Files:
 	src/bin/sh: expand.c expand.h

 Log Message:
 Fix the expansion of "$(foo-$bar}" so that IFS isn't applied when
 expanding $bar.
 Noted by Greg Troxel on tech-userlevel running some 'git' tests.
 Should fix PR bin/47361


 To generate a diff of this commit:
 cvs rdiff -u -r1.87 -r1.88 src/bin/sh/expand.c
 cvs rdiff -u -r1.18 -r1.19 src/bin/sh/expand.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Stephen Borrill" <sborrill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47361 CVS commit: [netbsd-6] src/bin/sh
Date: Sat, 2 Feb 2013 15:43:27 +0000

 Module Name:	src
 Committed By:	sborrill
 Date:		Sat Feb  2 15:43:27 UTC 2013

 Modified Files:
 	src/bin/sh [netbsd-6]: expand.c expand.h

 Log Message:
 Pull up the following revisions(s) (requested by dsl in ticket #773):
 	bin/sh/expand.c:	revision 1.88
 	bin/sh/expand.h:	revision 1.19

 Fix the expansion of "$(foo-$bar}" so that IFS isn't applied when
 expanding $bar. Should fix PR bin/47361


 To generate a diff of this commit:
 cvs rdiff -u -r1.86 -r1.86.4.1 src/bin/sh/expand.c
 cvs rdiff -u -r1.18 -r1.18.4.1 src/bin/sh/expand.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47361 CVS commit: [netbsd-5] src/bin/sh
Date: Sun, 9 Jun 2013 11:13:11 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Sun Jun  9 11:13:11 UTC 2013

 Modified Files:
 	src/bin/sh [netbsd-5]: expand.c expand.h

 Log Message:
 Pull up following revision(s) (requested by gdt in ticket #1851):
 	bin/sh/expand.c: revision 1.88
 	bin/sh/expand.h: revision 1.19
 Fix the expansion of "$(foo-$bar}" so that IFS isn't applied when
 expanding $bar.
 Noted by Greg Troxel on tech-userlevel running some 'git' tests.
 Should fix PR bin/47361


 To generate a diff of this commit:
 cvs rdiff -u -r1.79.2.1 -r1.79.2.2 src/bin/sh/expand.c
 cvs rdiff -u -r1.17 -r1.17.18.1 src/bin/sh/expand.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: msaitoh@NetBSD.org
State-Changed-When: Tue, 25 Jun 2013 12:44:22 +0000
State-Changed-Why:
Fixed and pulled up to netbsd-[56] branches.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.