Mail Archives: djgpp-workers/2000/08/12/12:26:16
> Date: Tue, 08 Aug 2000 09:14:15 -0700
> From: Bruce Korb <bkorb AT sco DOT COM>
>
> > The diffs against fixinc/tests/base/testing.h are below. Do you think
> > I should debug this?
>
> The blank lines are an interesting nuisance.
This, and the extra NULL define are my own kockpit errors: I edited
the input testing.h, and inadvertently left out the two lines and
added one more "#define NULL". When I reverted testing.h to the
version you sent me, these two diffs disappeared.
> The 'strncmp()' thingey is a problem with the sed expression
> in the sysv68_string fix:
>
> /*
> * This sed expression is broken inside fixincl.
> * The same expression seems to work outside, however :-(
> */
> sed = "/^\tstrncmp(),$/N";
> sed = 's/^\(' "\t" 'strncmp()\),\n\(' "\t" 'strlen(),\)$/'
> '\1;' "\\\nextern unsigned int\\\n\\2/";
>
> If you can fix that one, it would be wonderful :-).
Mission accomplished :-). The problem was caused by the interaction
of this Sed expression and the one which follows it:
sed = "/^extern int$/N";
sed = "s/^extern int\\(\\n\tstrlen(),\\)/extern size_t\\1/";
When this second expression saw "extern int", it would always cause
Sed to read another line. Thus, "^\tstrncmp" would never be seen by
Sed, since the previous line says "extern int".
The same happens from the command line if you submit both expressions
to Sed.
The following patch should fix the problem. I didn't have the
required tools installed to generate fixincl.x, so I patched fixincl.x
manually; that worked for me (the fixed testing.h was identical to
tests/base/testing.h). I hope that the inclhack.def patch below is
correct.
2000-08-12 Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
* fixinc/inclhack.def (sysv68_string): Fix the Sed script so it
works inside fixincl.
--- fixinc/inclhack.d~0 Thu Jul 27 16:28:58 2000
+++ fixinc/inclhack.def Sat Aug 12 19:11:42 2000
@@ -2558,17 +2558,13 @@
sed = "/^extern char$/N";
sed = "s/^extern char\\(\\n\t\\*memccpy(),\\)$/extern void\\1/";
- /*
- * This sed expression is broken inside fixincl.
- * The same expression seems to work outside, however :-(
- */
- sed = "/^\tstrncmp(),$/N";
- sed = 's/^\(' "\t" 'strncmp()\),\n\(' "\t" 'strlen(),\)$/'
- '\1;' "\\\nextern unsigned int\\\n\\2/";
-
sed = "/^extern int$/N";
sed = "s/^extern int\\(\\n\tstrlen(),\\)/extern size_t\\1/";
+ sed = "/^extern int\\n\tstrncmp(),$/N";
+ sed = 's/^\(' "extern int\\n\t" 'strncmp()\),\n\(' "\t" 'strlen(),\)$/'
+ '\1;' "\\\nextern unsigned int\\\n\\2/";
+
test_text =
"extern int strlen();\n"
- Raw text -