kernel-doc: improve handling of whitespace on the first line param description
authorJani Nikula <jani.nikula@intel.com>
Sat, 28 May 2016 11:50:20 +0000 (14:50 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 30 May 2016 10:39:01 +0000 (13:39 +0300)
Handle whitespace on the first line of param text as if it was the empty
string. There is no need to add the newline in this case. This improves
the rst output in particular, where blank lines may be problematic in
parameter lists.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
scripts/kernel-doc

index 4f559de8b173af01e50a834c568f4cf5322c01d8..e93e796b17cefb98816fe159f7873116b1819c42 100755 (executable)
@@ -2814,11 +2814,11 @@ sub process_file($) {
                $in_doc_sect = 1;
                $in_purpose = 0;
                $contents = $newcontents;
+               while ((substr($contents, 0, 1) eq " ") ||
+                      substr($contents, 0, 1) eq "\t") {
+                   $contents = substr($contents, 1);
+               }
                if ($contents ne "") {
-                   while ((substr($contents, 0, 1) eq " ") ||
-                       substr($contents, 0, 1) eq "\t") {
-                           $contents = substr($contents, 1);
-                   }
                    $contents .= "\n";
                }
                $section = $newsection;