Mail Archives: djgpp-workers/2000/08/01/15:31:16
> Date: Sun, 30 Jul 2000 14:22:50 -0700
> From: Bruce Korb <bkorb AT sco DOT COM>
>
> fix = {
> hackname = undefine_null;
> select = "^#[ \t]*define[ \t]+NULL[ \t]";
> bypass = "#[ \t]*(ifn|un)def[ \t]+NULL($|[ \t\r])";
>
> c_fix = format;
> c_fix_arg = "#ifndef NULL%2\n#define NULL%1%2\n#endif%2\n";
> c_fix_arg = "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n]+)([\r]*)\n";
>
> test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
> };
>
> Most likely, the "bypass" clause is triggered on all
> your headers that define NULL. If it should not have triggered,
> then there is a bug.
Bug squashed. The problem was that output was closed with `close'
rather than `fclose', so buffered output never made it to the file.
With the patch below, the headers locale.h and stddef.h get fixed for
NULL (they define it unconditionally), and math.h gets fixed for the
exception thingy (which is not really required, since our math.h is
already protected against C++). testing.h winds up identical to
itself, as it should, I think.
(The second patch below has nothing to do with the bug, it just gets
in my way when I'm trying to run the program outside the shell script
or under GDB, and forget to define $VERBOSE.)
2000-08-01 Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
* fixinc/fixfixes.c (main): Close standard streams with fclose
rather than close, to flush any buffered output.
* fixinc/fixincl.c (initialize): Don't crash if $VERBOSE is
undefined.
--- fixinc/fixfixes.c~2 Fri Jul 28 19:05:18 2000
+++ fixinc/fixfixes.c Tue Aug 1 20:34:42 2000
@@ -792,8 +792,8 @@ main( argc, argv )
}
apply_fix( pFix, argv[1] );
- close( STDOUT_FILENO );
- close( STDIN_FILENO );
+ fclose( stdout );
+ fclose( stdin );
unlink( argv[4] );
if (rename( pz_tmptmp, argv[4] ) != 0)
{
--- fixinc/fixincl.c~2 Fri Jul 28 19:26:08 2000
+++ fixinc/fixincl.c Tue Aug 1 20:44:02 2000
@@ -259,7 +259,9 @@ ENV_TABLE
#undef _ENV_
- if (isdigit( *pz_verbose ))
+ if (pz_verbose == NULL)
+ ; /* use default value */
+ else if (isdigit( *pz_verbose ))
verbose_level = (te_verbose)atoi( pz_verbose );
else
switch (*pz_verbose) {
- Raw text -