X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=scripts%2Fkernel-doc;h=01e8a8e2260283d4551432406cb91d9b6e8e97cf;hb=e9d24ad30fc5c4c601824fb39712350b053ca812;hp=8fd107a3fac49e32a0879549e88546d7f7f594dd;hpb=7a68294278ae714ce2632a54f0f46916dca64f56;p=firefly-linux-kernel-4.4.55.git diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 8fd107a3fac4..01e8a8e22602 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -230,6 +230,7 @@ my $dohighlight = ""; my $verbose = 0; my $output_mode = "man"; +my $output_preformatted = 0; my $no_doc_sections = 0; my %highlights = %highlights_man; my $blankline = $blankline_man; @@ -280,9 +281,10 @@ my $doc_special = "\@\%\$\&"; my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. my $doc_end = '\*/'; my $doc_com = '\s*\*\s*'; +my $doc_com_body = '\s*\* ?'; my $doc_decl = $doc_com . '(\w+)'; my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; -my $doc_content = $doc_com . '(.*)'; +my $doc_content = $doc_com_body . '(.*)'; my $doc_block = $doc_com . 'DOC:\s*(.*)?'; my %constants; @@ -459,8 +461,13 @@ sub output_highlight { # print STDERR "contents af:$contents\n"; foreach $line (split "\n", $contents) { + if (! $output_preformatted) { + $line =~ s/^\s*//; + } if ($line eq ""){ - print $lineprefix, local_unescape($blankline); + if (! $output_preformatted) { + print $lineprefix, local_unescape($blankline); + } } else { $line =~ s/\\\\\\/\&/g; if ($output_mode eq "man" && substr($line, 0, 1) eq ".") { @@ -643,10 +650,12 @@ sub output_section_xml(%) { print "