|
![](/i/fill.gif) |
Ron Parker wrote:
> On 14 Jun 1999 01:34:36 -0400, Nieminen Mika wrote:
> >Ronald L. Parker <par### [at] mail fwi com> wrote:
> >: BTW, I have a minor bone to pick with you. Please don't use // to
> >: comment things in your code. GCC doesn't like it, and many other C
> >: compilers don't either.
> >
> > Tip: If you want to automatically enclose those comments with /* ... */,
> >you can try this sed command:
> > sed "s/\/\/.*$/\/*&*\//" file.c
> >
> > (Cryptic, uh? :) )
>
> less cryptic, and with a backup:
> mv file.c file.c.bak; perl -pe "s#//(.*)$#/* $1 */#" <file.c.bak >file.c
>
> Both methods would fail if the // comment happened to contain the '*/'
> sequence of characters, but that's rare.
Yes, but no so rare with me. :-)
If I mix things, it's often because of the nestled stuff. I know, I'm a pain.
But I'm working on it.
Post a reply to this message
|
![](/i/fill.gif) |