diff options
author | Jani Nikula <jani.nikula@intel.com> | 2016-05-28 14:50:20 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-05-30 13:39:01 +0300 |
commit | 0a7263014b3a0e05b52ccef314e2ccf6f4550a8b (patch) | |
tree | 16480723e59be70f75ffefe2332d2ce964aa5a1f /scripts/kernel-doc | |
parent | ecbcfba126e857de8dd4996fe31fad782dd6bae0 (diff) | |
download | lwn-0a7263014b3a0e05b52ccef314e2ccf6f4550a8b.tar.gz lwn-0a7263014b3a0e05b52ccef314e2ccf6f4550a8b.zip |
kernel-doc: improve handling of whitespace on the first line param description
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>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-x | scripts/kernel-doc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 4f559de8b173..e93e796b17ce 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -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; |