[comp.lang.c] patch to PD cpp

crash@tsc3b21.UUCP (Frank (crash) Edwards) (02/02/88)

I have a single patch for the C preprocessor which was posted to mod.sources
many moons ago.  A local archiver had it available when I needed it, and in
using it I received "end-of-input" messages where I shouldn't have.

It turns out, after much debugging time, that the token parser *WILL*
recognize an opening comment token ("/*") if it is contained within
double quotes!!  In the NetHack2.2 source, are subroutine calls which
contain this particular sequence (do_name.c, for one).

The following two lines will check for the '/*' combination in the
skip_until_newline routine.  It probably shouldn't be done there, but
you know how these quick little fixes get ;-).

File:  cpp6.c, routine skipnl()
132a133,134
> 	    if (c == '\\') get();
> 	    else if (c == '"') instring = !instring;


"Use the Source, Luke.  Feel it flow through your fingertips..."
-----
Frank (crash) Edwards		...!codas!usfvax2!{pdn,jc3b21}!tsc3b21!crash
TSC in Palm Harbor, FL		Phone:  (813) 785-0583  (voice)
The Sweat Shop
/-------------------------------------------------------------------------\
|  These opinions are not those of my employer, his wife, either of their |
|  children, or their parakeet.  In fact, he probably doesn't even know   |
|  that I've said this!  And I prefer it that way!			  |
\-------------------------------------------------------------------------/