[gtk-doc] scan: use var for match to avoid invalidating it befroe later access



commit 2761bb733487415e277fa18e4ea1d9cce6bdaeb0
Author: Stefan Kost <ensonic users sf net>
Date:   Mon Sep 20 12:03:42 2010 +0300

    scan: use var for match to avoid invalidating it befroe later access

 gtkdoc-scan.in |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index 523daa8..5a16f94 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -328,12 +328,13 @@ sub ScanHeader {
         # and if we enter a deprecation-symbol-bracketed
         # zone, take note.
         if (m/^\s*#\s*if(?:n?def\b|\s+!?\s*defined\s*\()\s*(\w+)/) {
-            if ($deprecated_conditional_nest == 0 and $1 =~ /$DEPRECATED_GUARDS/) {
+            my $define_name = $1;
+            if ($deprecated_conditional_nest == 0 and $define_name =~ /$DEPRECATED_GUARDS/) {
                  $deprecated_conditional_nest = 1;
             } elsif ($deprecated_conditional_nest > 0) {
                  $deprecated_conditional_nest += 1;
             }
-            if ($ignore_conditional_nest == 0 and $1 =~ /__GTK_DOC_IGNORE__/) {
+            if ($ignore_conditional_nest == 0 and $define_name =~ /__GTK_DOC_IGNORE__/) {
                  $ignore_conditional_nest = 1;
             } elsif ($ignore_conditional_nest > 0) {
                  $ignore_conditional_nest += 1;



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