This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fixinc testing cleanup
- To: Bruce Korb <bkorb at sco dot COM>
- Subject: Re: fixinc testing cleanup
- From: Michael Chamberlain <michael at chamberlain dot net dot au>
- Date: Sun, 14 May 2000 12:08:38 +1000
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- References: <391C88DF.9753DF18@sco.com>
On Fri, May 12, 2000 at 03:42:39PM -0700, Bruce Korb wrote:
> sed =
> "s/^[ \t]*#[ \t]*define[ \t]+\\([^(]*\\)\\(([^)]*)\\)[ \t]*"
> "\\(_.\\)\\1\\2[ \t]*$/#define \\1 \\3\\1/";
If I'm not mistaken, the problem with the above expression is around the
period near the beginning of the second line- it will consume the F in
_FOOsomething, but needs to match the entire FOO. An easy change is to make
it "\\(_.*\\)". Also, looking at other sed excerpts, many avoid using '+'
as a match 1 or more. So the correct version may be:
sed =
"s/^[ \t]*#[ \t]*define[ \t][ \t]*\\([^(]*\\)\\(([^)]*)\\)[ \t]*"
"\\(_.*\\)\\1\\2[ \t]*$/#define \\1 \\3\\1/";
Michael.