From patchwork Thu Jan 28 22:38:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: malahal naineni X-Patchwork-Id: 8154731 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B3AA9F9E8 for ; Thu, 28 Jan 2016 22:39:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86E7C20225 for ; Thu, 28 Jan 2016 22:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A071C20221 for ; Thu, 28 Jan 2016 22:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754927AbcA1Wjl (ORCPT ); Thu, 28 Jan 2016 17:39:41 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:37061 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbcA1Wjk (ORCPT ); Thu, 28 Jan 2016 17:39:40 -0500 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 Jan 2016 15:39:40 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 28 Jan 2016 15:39:37 -0700 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: malahal@us.ibm.com X-IBM-RcptTo: linux-nfs@vger.kernel.org Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id C79EB3E4003F for ; Thu, 28 Jan 2016 15:39:36 -0700 (MST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0SMdadg34209806 for ; Thu, 28 Jan 2016 22:39:36 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0SMdZPx005678 for ; Thu, 28 Jan 2016 17:39:35 -0500 Received: from mail.localdomain (sig-9-65-87-113.ibm.com [9.65.87.113]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u0SMdZSl005656; Thu, 28 Jan 2016 17:39:35 -0500 Received: by mail.localdomain (Postfix, from userid 1000) id DFEEA1612; Thu, 28 Jan 2016 16:39:33 -0600 (CST) From: Malahal Naineni To: linux-nfs@vger.kernel.org Cc: SteveD@redhat.com, Malahal Naineni Subject: [PATCH] Ignore whitespace at the beginning of option tags Date: Thu, 28 Jan 2016 16:38:47 -0600 Message-Id: <1454020727-1814-1-git-send-email-malahal@us.ibm.com> X-Mailer: git-send-email 1.9.1 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16012822-0021-0000-0000-00001685D867 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The following should work now: [General] Domain = local.domain.edu Signed-off-by: Malahal Naineni --- cfg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cfg.c b/cfg.c index c615d24..e0ab839 100644 --- a/cfg.c +++ b/cfg.c @@ -210,6 +210,7 @@ static void conf_parse_line (int trans, char *line, size_t sz) { char *val; + char *tag; size_t i; int j; static char *section = 0; @@ -262,8 +263,14 @@ conf_parse_line (int trans, char *line, size_t sz) /* Skip trailing whitespace, if any */ for (j = sz - (val - line) - 1; j > 0 && isspace (val[j]); j--) val[j] = '\0'; + + /* Skip beginning white space */ + tag = line; + while (isspace(*tag)) + tag++; + /* XXX Perhaps should we not ignore errors? */ - conf_set (trans, section, line, val, 0, 0); + conf_set (trans, section, tag, val, 0, 0); return; }