[gtk-doc] gtkdoc-scan: Fix use of uninitialised value in trace logging



commit d511ebcf111c5b418cafdba581a9cb3c465be7e4
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Mon Feb 10 08:25:27 2014 +0000

    gtkdoc-scan: Fix use of uninitialised value in trace logging
    
    Fixes:
    > Use of uninitialized value $6 in concatenation (.) or string at
    > /opt/gnome3/build/bin/gtkdoc-scan line 552, <INPUT> line X.
    
    This was caused by re-using the numbered match variables from one regexp
    after running another regexp.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724002

 gtkdoc-scan.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index b2b9f84..195a372 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -559,7 +559,7 @@ sub ScanHeader {
                 $symbol = $6;
                 s/^\s*([A-Za-z_]+VAR)\b/extern/;
                 $decl = $_;
-                @TRACE@("Possible extern var $6: $decl");
+                @TRACE@("Possible extern var $symbol: $decl");
                 if (&AddSymbolToList (\$list, $symbol)) {
                     print DECL "<VARIABLE>\n<NAME>$symbol</NAME>\n$deprecated$decl</VARIABLE>\n";
                 }
@@ -570,7 +570,7 @@ sub ScanHeader {
             } elsif 
(m/^\s*((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)\s*(const\s+)*([A-Za-z]\w*)\s*\=/)
 {
                 $symbol = $5;
                 $decl = $_;
-                @TRACE@("Possible global var $5: $decl");
+                @TRACE@("Possible global var $symbol: $decl");
                 if (&AddSymbolToList (\$list, $symbol)) {
                     print DECL "<VARIABLE>\n<NAME>$symbol</NAME>\n$deprecated$decl</VARIABLE>\n";
                 }


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