From patchwork Wed Oct 4 11:48:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9984429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0A65860365 for ; Wed, 4 Oct 2017 12:01:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFDFF28AEF for ; Wed, 4 Oct 2017 12:01:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4BCC28AF5; Wed, 4 Oct 2017 12:01:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 684E228AEF for ; Wed, 4 Oct 2017 12:01:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752364AbdJDMAy (ORCPT ); Wed, 4 Oct 2017 08:00:54 -0400 Received: from osg.samsung.com ([64.30.133.232]:57151 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996AbdJDL6f (ORCPT ); Wed, 4 Oct 2017 07:58:35 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id E480D2A4C0; Wed, 4 Oct 2017 04:49:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Hz9YC7blb6S; Wed, 4 Oct 2017 04:49:16 -0700 (PDT) Received: from smtp.s-opensource.com (177.43.29.231.dynamic.adsl.gvt.net.br [177.43.29.231]) by osg.samsung.com (Postfix) with ESMTPSA id CD11E2A422; Wed, 4 Oct 2017 04:49:02 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.89) (envelope-from ) id 1dziAc-00088q-3V; Wed, 04 Oct 2017 08:48:58 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH v3 11/17] scripts: kernel-doc: replace tabs by spaces Date: Wed, 4 Oct 2017 08:48:49 -0300 Message-Id: <128c478afdd0211fabd0dd4bb098831f8b32d31f.1507116877.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sphinx has a hard time dealing with tabs, causing it to misinterpret paragraph continuation. As we're now mainly focused on supporting ReST output, replace tabs by spaces, in order to avoid troubles when the output is parsed by Sphinx. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 2d3d5e9bf7de..d8c98e45b1ce 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1557,7 +1557,7 @@ sub tracepoint_munge($) { sub syscall_munge() { my $void = 0; - $prototype =~ s@[\r\n\t]+@ @gos; # strip newlines/CR's/tabs + $prototype =~ s@[\r\n]+@ @gos; # strip newlines/CR's ## if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) { if ($prototype =~ m/SYSCALL_DEFINE0/) { $void = 1; @@ -1756,6 +1756,8 @@ sub process_file($) { while (s/\\\s*$//) { $_ .= ; } + # Replace tabs by spaces + while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; if ($state == STATE_NORMAL) { if (/$doc_start/o) { $state = STATE_NAME; # next line is always the function name @@ -1855,8 +1857,7 @@ sub process_file($) { $in_purpose = 0; $contents = $newcontents; $new_start_line = $.; - while ((substr($contents, 0, 1) eq " ") || - substr($contents, 0, 1) eq "\t") { + while (substr($contents, 0, 1) eq " ") { $contents = substr($contents, 1); } if ($contents ne "") { @@ -1925,8 +1926,7 @@ sub process_file($) { $contents = $2; $new_start_line = $.; if ($contents ne "") { - while ((substr($contents, 0, 1) eq " ") || - substr($contents, 0, 1) eq "\t") { + while (substr($contents, 0, 1) eq " ") { $contents = substr($contents, 1); } $contents .= "\n";