m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

m4/output.c: counting diversions


From: Ralf Wildenhues
Subject: m4/output.c: counting diversions
Date: Fri, 16 Jun 2006 20:22:37 +0200
User-agent: Mutt/1.5.11+cvs20060403

There is an, ahem, interesting piece of code in output.c.  The setting
of diversions to 1 in an assertion isn't intended.  Right?

Well, the patch below (which exposes but not fixes the issue) causes
the tests 

   8: builtins.at:64     divert
  34: modules.at:27      Freezing modules
  65: generated.at:931   Divert
      documentation
  66: generated.at:968   Undivert
      documentation
  67: generated.at:1034  Divnum
      documentation
  68: generated.at:1063  Cleardiv
      documentation

to fail, and I guess rightly so, as nothing ever reduces `diversions' to
1, so the assertion triggers.  I'm not sure what the code is supposed to
do, though; maybe you were about to rewrite it anyway...?  ;-)

Cheers,
Ralf

        * m4/output.c (m4_output_exit): Assignment should be comparison
        bug.

Index: m4/output.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/output.c,v
retrieving revision 1.23
diff -u -r1.23 output.c
--- m4/output.c 13 Jun 2006 01:19:09 -0000      1.23
+++ m4/output.c 16 Jun 2006 18:20:08 -0000
@@ -122,7 +122,7 @@
 void
 m4_output_exit (void)
 {
-  assert (diversions = 1);
+  assert (diversions == 1);
   DELETE (diversion_table);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]