Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Mar 1995 01:50:04 -0800
From:      smp@clem.systemsix.com
To:        freebsd-bugs
Subject:   bin/237: m4 syscmd() bug
Message-ID:  <199503110950.BAA25804@freefall.cdrom.com>
In-Reply-To: Your message of Fri, 10 Mar 1995 20:00:42 -0700 <199503110300.UAA00334@rick.systemsix.com>

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

>Number:         237
>Category:       bin
>Synopsis:       m4 syscmd() function's output out of sync
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 11 01:50:02 1995
>Originator:     Steve Passe
>Organization:
New Ideas
>Release:        FreeBSD 2.1.0-Development i386
>Environment:

	2.0-950210-SNAP

>Description:

	when an m4 program uses the syscmd() function the output of the
	system() call made by syscmd() is out of sync with the data stream
	of m4.

>How-To-Repeat:

	run m4 on a file containing the following:

define(MACRO, `syscmd(echo -n foo)')

some text with "MACRO" in it

<< END OF SAMPLE INPUT

	this will produce:

foosome text with "" in it

but should produce:

some text with "foo" in it



>Fix:
	
	patch src/usr.bin/m4/eval.c as follows:

diff eval.c.orig eval.c
173c173,177
< 	 */
---
> 	 */		
> 		/* Make sure m4 output is NOT interrupted */		
> 		fflush(stdout);			
> 		fflush(stderr);
>
>Audit-Trail:
>Unformatted:





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