From patchwork Thu Dec 8 04:27:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9465767 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 50B5860459 for ; Thu, 8 Dec 2016 04:28:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 368482852C for ; Thu, 8 Dec 2016 04:28:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2880128549; Thu, 8 Dec 2016 04:28:24 +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=ham 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 C42DD2852C for ; Thu, 8 Dec 2016 04:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932216AbcLHE2X (ORCPT ); Wed, 7 Dec 2016 23:28:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:43999 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932193AbcLHE2W (ORCPT ); Wed, 7 Dec 2016 23:28:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 683D7AAC8; Thu, 8 Dec 2016 04:28:21 +0000 (UTC) From: NeilBrown To: "J. Bruce Fields" , Steve Dickson Date: Thu, 08 Dec 2016 15:27:25 +1100 Subject: [PATCH 06/10] conffile: fix striping of quotes from values. Cc: linux-nfs@vger.kernel.org Message-ID: <148117124536.31271.10187990246409032535.stgit@noble> In-Reply-To: <148117122602.31271.13586847542442809540.stgit@noble> References: <148117122602.31271.13586847542442809540.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There were being stripes from the name instead! Signed-off-by: NeilBrown --- support/nfs/conffile.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c index 57f58a2bcdc7..e717c1e39bab 100644 --- a/support/nfs/conffile.c +++ b/support/nfs/conffile.c @@ -300,14 +300,14 @@ conf_parse_line(int trans, char *line, size_t sz) line[strcspn (line, " \t=")] = '\0'; val = line + i + 1 + strspn (line + i + 1, " \t"); - if (line[0] == '"') { - line ++; - j = strcspn(line, "\""); - line[j] = 0; - } else if (line[0] == '\'') { - line ++; - j = strcspn(line, "'"); - line[j] = 0; + if (val[0] == '"') { + val ++; + j = strcspn(val, "\""); + val[j] = 0; + } else if (val[0] == '\'') { + val ++; + j = strcspn(val, "'"); + val[j] = 0; } else { /* Skip trailing spaces and comments */ for (j = 0; val[j]; j++) {