[gtk-doc] fixxref: make it work again without --module argument, Fixes #605211



commit b39bb84dfb5f16c8b2977105bd5876b7b8d58a11
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Dec 22 12:54:31 2009 +0100

    fixxref: make it work again without --module argument, Fixes #605211
    
    This restores a compatible behavior with previous versions of gtk-doc,
    which is required by many tarballs.

 gtkdoc-fixxref.in |   56 +++++++++++++++++++++++++++-------------------------
 1 files changed, 29 insertions(+), 27 deletions(-)
---
diff --git a/gtkdoc-fixxref.in b/gtkdoc-fixxref.in
index 8f166ef..5a703ad 100755
--- a/gtkdoc-fixxref.in
+++ b/gtkdoc-fixxref.in
@@ -168,36 +168,38 @@ foreach my $dir (@EXTRA_DIRS) {
     }
 }
 
-open (INPUT, "$MODULE-sections.txt")
-	|| die "Can't open $MODULE-sections.txt: $!";
-my $subsection = "";
-while (<INPUT>) {
-    if (m/^#/) {
-        next;
-
-    } elsif (m/^<SECTION>/) {
-        $subsection = "";
-    } elsif (m/^<SUBSECTION\s*(.*)>/i) {
-        $subsection = $1;
-    } elsif (m/^<SUBSECTION>/) {
-        next;
-    } elsif (m/^<TITLE>(.*)<\/TITLE>/) {
-        next;
-    } elsif (m/^<FILE>(.*)<\/FILE>/) {
-        next;
-    } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) {
-        next;
-    } elsif (m/^<\/SECTION>/) {
-        next;
-    } elsif (m/^(\S+)/) {
-        my $symbol=CreateValidSGMLID($1);
-
-        if ($subsection eq "Standard" || $subsection eq "Private") {
-            $NoLinks{$symbol} = 1;
+if (defined($MODULE)) {
+    open (INPUT, "$MODULE-sections.txt")
+            || die "Can't open $MODULE-sections.txt: $!";
+    my $subsection = "";
+    while (<INPUT>) {
+        if (m/^#/) {
+            next;
+
+        } elsif (m/^<SECTION>/) {
+            $subsection = "";
+        } elsif (m/^<SUBSECTION\s*(.*)>/i) {
+            $subsection = $1;
+        } elsif (m/^<SUBSECTION>/) {
+            next;
+        } elsif (m/^<TITLE>(.*)<\/TITLE>/) {
+            next;
+        } elsif (m/^<FILE>(.*)<\/FILE>/) {
+            next;
+        } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) {
+            next;
+        } elsif (m/^<\/SECTION>/) {
+            next;
+        } elsif (m/^(\S+)/) {
+            my $symbol=CreateValidSGMLID($1);
+
+            if ($subsection eq "Standard" || $subsection eq "Private") {
+                $NoLinks{$symbol} = 1;
+            }
         }
     }
+    close (INPUT);
 }
-close (INPUT);
 
 &FixCrossReferences ($MODULE_DIR);
 



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