[gtk-doc] mkdb: fix isemptydoc to also work for really empty strings



commit 1063ddc7ccd46a1bfd74c51c7aab9b9f13a84645
Author: Stefan Kost <ensonic users sf net>
Date:   Sat Jun 27 21:58:31 2009 +0300

    mkdb: fix isemptydoc to also work for really empty strings
    
    IsEmptyDoc was only checking for empty <para> groups. Return also TRUE if docs
    string is only whitespace. This fixes e.g. property docs with empty desc, where
    it then does a fallback on the parmspec blurb.

 gtkdoc-mkdb.in |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index f1acca9..08ef5c0 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -3201,12 +3201,16 @@ sub GetArgs {
 	    if (defined($SymbolDocs{$symbol}) &&
 		!IsEmptyDoc($SymbolDocs{$symbol})) {
 		$blurb = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+                #print ".. [$SymbolDocs{$symbol}][$blurb]\n";
 		$AllDocumentedSymbols{$symbol} = 1;
 	    }
 	    else {
 		if (!($ArgBlurbs[$i] eq "")) {
 		    $AllDocumentedSymbols{$symbol} = 1;
-		}
+		} else {
+                    # FIXME: print a warning?
+                    #print ".. no description\n";
+                }
 		$blurb = "<para>" . &CreateValidSGML ($ArgBlurbs[$i]) . "</para>";
 	    }
 
@@ -4136,12 +4140,16 @@ sub MergeSourceDocumentation {
 #############################################################################
 sub IsEmptyDoc {
     my ($doc) = @_;
+    
+    if ($doc =~ /^\s*$/) {
+        return 1;
+    }
 
     if ($doc =~ /^\s*<para>\s*(FIXME)?\s*<\/para>\s*$/) {
 	return 1;
-    } else {
-	return 0;
     }
+
+    return 0;
 }
 
 



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