Return to BSD News archive
Xref: sserve comp.os.386bsd.bugs:1698 alt.sources:6590
Newsgroups: comp.os.386bsd.bugs,alt.sources
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!utnut!torn!newshub.ccs.yorku.ca!oz
From: oz@ursa.sis.yorku.ca (Ozan S. Yigit)
Subject: fixes. [Re: a much improved version of pd/bsd m4.]
In-Reply-To: oz@ursa.sis.yorku.ca's message of Fri, 29 Oct 1993 05:05:32 GMT
Message-ID: <OZ.93Nov2223636@ursa.sis.yorku.ca>
Sender: news@newshub.ccs.yorku.ca (USENET News System)
Organization: York U. Student Information Systems Project
References: <OZ.93Oct29000532@ursa.sis.yorku.ca>
Date: Wed, 3 Nov 1993 03:36:36 GMT
Lines: 48
bug:if there are multiple files on the command line, file index is not
reset properly, ie. it falls off the side. sigh. also, somewhere along
the line, i again lost the proper m4wrap/autodiversion semantics
[sorry, eric. :-|] but fixed with this patch.
... oz
----------------------------------------------------------------------
*** main.c Tue Nov 2 15:40:55 1993
--- main.c.new Tue Nov 2 22:27:04 1993
***************
*** 865,870 ****
--- 865,873 ----
char *name = argv[optind]; /* next file name */
infile[0] = fopen(name, "r");
if (!infile[0]) cantread(name);
+ sp = -1; /* stack pointer initialized */
+ fp = 0; /* frame pointer initialized */
+ ilevel = 0; /* reset input file stack ptr*/
#ifndef NO__FILE
dodefine("__FILE__", name);
#endif
***************
*** 877,886 ****
putback(EOF); /* eof is a must !! */
pbstr(m4wraps); /* user-defined wrapup act */
macro(); /* last will and testament */
- } else { /* default wrap-up: undivert */
- for (n = 1; n < MAXOUT; n++)
- if (outfile[n] != NULL) getdiv(n);
}
if (outfile[0] != NULL) { /* remove bitbucket if used */
(void) fclose(outfile[0]);
--- 880,892 ----
putback(EOF); /* eof is a must !! */
pbstr(m4wraps); /* user-defined wrapup act */
macro(); /* last will and testament */
}
+
+ if (active != stdout)
+ active = stdout; /* reset output just in case */
+
+ for (n = 1; n < MAXOUT; n++) /* default wrap-up: undivert */
+ if (outfile[n] != NULL) getdiv(n);
if (outfile[0] != NULL) { /* remove bitbucket if used */
(void) fclose(outfile[0]);