From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751704AbcFDLnm (ORCPT ); Sat, 4 Jun 2016 07:43:42 -0400 Received: from mga11.intel.com ([192.55.52.93]:25780 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783AbcFDLka (ORCPT ); Sat, 4 Jun 2016 07:40:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,417,1459839600"; d="scan'208";a="995119980" From: Jani Nikula To: Jonathan Corbet Cc: Jani Nikula , Markus Heiser , Daniel Vetter , Grant Likely , Mauro Carvalho Chehab , Keith Packard , LKML , linux-doc@vger.kernel.org, Hans Verkuil Subject: [PATCH v2 25/38] kernel-doc: improve handling of whitespace on the first line param description Date: Sat, 4 Jun 2016 14:37:26 +0300 Message-Id: <0a7263014b3a0e05b52ccef314e2ccf6f4550a8b.1465031816.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- scripts/kernel-doc | 8 ++++---- 1 file 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; -- 2.1.4