Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a21217daae8ce6e841e33d4a2bb24026723cb21d
Commit:     a21217daae8ce6e841e33d4a2bb24026723cb21d
Parent:     6e8c818829587f001cacae5af4400e4e3aa90a37
Author:     Randy Dunlap <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 10 01:46:04 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sun Feb 11 10:51:32 2007 -0800

    [PATCH] kernel-doc: fix some odd spacing issues
    
    - in man and text mode output, if the function return type is empty (like it
      is for macros), don't print the return type and a following space; this
      fixes an output malalignment;
    
    - in the function short description, strip leading, trailing, and multiple
      embedded spaces (to one space); this makes function name/description 
output
      spacing consistent;
    
    - fix a comment typo;
    
    Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 scripts/kernel-doc |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index cc63cd0..c9b4d36 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -365,7 +365,7 @@ sub dump_section {
 #  parameterlist => @list of parameters
 #  parameterdescs => %parameter descriptions
 #  sectionlist => @list of sections
-#  sections => %descriont descriptions
+#  sections => %section descriptions
 #
 
 sub output_highlight {
@@ -953,7 +953,11 @@ sub output_function_man(%) {
     print $args{'function'}." \\- ".$args{'purpose'}."\n";
 
     print ".SH SYNOPSIS\n";
-    print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n";
+    if ($args{'functiontype'} ne "") {
+       print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n";
+    } else {
+       print ".B \"".$args{'function'}."\n";
+    }
     $count = 0;
     my $parenth = "(";
     my $post = ",";
@@ -1118,13 +1122,19 @@ sub output_intro_man(%) {
 sub output_function_text(%) {
     my %args = %{$_[0]};
     my ($parameter, $section);
+    my $start;
 
     print "Name:\n\n";
     print $args{'function'}." - ".$args{'purpose'}."\n";
 
     print "\nSynopsis:\n\n";
-    my $start=$args{'functiontype'}." ".$args{'function'}." (";
+    if ($args{'functiontype'} ne "") {
+       $start = $args{'functiontype'}." ".$args{'function'}." (";
+    } else {
+       $start = $args{'function'}." (";
+    }
     print $start;
+
     my $count = 0;
     foreach my $parameter (@{$args{'parameterlist'}}) {
        $type = $args{'parametertypes'}{$parameter};
@@ -1710,6 +1720,7 @@ sub process_file($) {
     my $file;
     my $identifier;
     my $func;
+    my $descr;
     my $initial_section_counter = $section_counter;
 
     if (defined($ENV{'SRCTREE'})) {
@@ -1753,7 +1764,12 @@ sub process_file($) {
 
                $state = 2;
                if (/-(.*)/) {
-                   $declaration_purpose = xml_escape($1);
+                   # strip leading/trailing/multiple spaces #RDD:T:
+                   $descr= $1;
+                   $descr =~ s/^\s*//;
+                   $descr =~ s/\s*$//;
+                   $descr =~ s/\s+/ /;
+                   $declaration_purpose = xml_escape($descr);
                } else {
                    $declaration_purpose = "";
                }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to