]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scripts/kernel-doc: don't add not needed new lines
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 24 Feb 2025 09:08:11 +0000 (10:08 +0100)
committerJonathan Corbet <corbet@lwn.net>
Tue, 4 Mar 2025 16:47:40 +0000 (09:47 -0700)
This helps comparing kernel-doc output with the new .py version
of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/6b036ef7d746f26d7d0044626b04d1f0880a2188.1740387599.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/kernel-doc

index 2c77b914d017e833f10286959fe32e2a42959c74..d59552e1a31df901c52f47de1304478662141d17 100755 (executable)
@@ -760,6 +760,10 @@ sub output_highlight_rst {
     if ($block) {
         $output .= highlight_block($block);
     }
+
+    $output =~ s/^\n+//g;
+    $output =~ s/\n+$//g;
+
     foreach $line (split "\n", $output) {
         print $lineprefix . $line . "\n";
     }