Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Dec 1995 18:11:21 GMT
From:      Mark Valentine <mark@linus.demon.co.uk>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/908: sed bug with trailing backslashes
Message-ID:  <199512211811.SAA03054@linus.demon.co.uk>
Resent-Message-ID: <199512220100.RAA25136@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         908
>Category:       bin
>Synopsis:       sed bug with trailing backslashes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 21 17:00:01 PST 1995
>Last-Modified:
>Originator:     Mark Valentine
>Organization:
>Release:        FreeBSD 2.2-CURRENT i386
>Environment:

	n/a

>Description:

	Sed misinterprets the pair of backslashes at the end of line 2 of
	the following script, resulting in line 3 being taken as part of
	the inserted text.

	    1i\
	    char foo[] = "\\
	    s/$/\\n\\/
	    $a\
	    ";

	GNU sed and SunOS 4.1.3 sed insert a single line ending with a
	backslash, and treat line three as a substition command.

>How-To-Repeat:

	$ echo test | sed -f <above-script>
	char foo[] = "\
	s/$/\n\/
	test
	";

	$ echo test | /usr/gnu/bin/sed -f <above-script>
	char foo[] = "\
	test\n\
	";

>Fix:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512211811.SAA03054>