All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Mi Jinlong <mijinlong@cn.fujitsu.com>
Cc: NFSv3 list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] libnfs.a: fix a bug when parse section's arg
Date: Mon, 29 Nov 2010 11:06:29 -0500	[thread overview]
Message-ID: <4CF3CF85.3090406@RedHat.com> (raw)
In-Reply-To: <4CECD5B4.5090409@cn.fujitsu.com>



On 11/24/2010 04:07 AM, Mi Jinlong wrote:
> 
> 
> Steve Dickson :
>> On 11/08/2010 08:37 PM, Mi Jinlong wrote:
>>> When parsing section's arg at configure file, the pointer 
>>> should stop when fetch ']', and give the warning message.
>>
>>> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
>>> ---
>>>  support/nfs/conffile.c |    4 ++--
>>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
>>> index 24640f4..798e5f3 100644
>>> --- a/support/nfs/conffile.c
>>> +++ b/support/nfs/conffile.c
>>> @@ -271,9 +271,9 @@ conf_parse_line(int trans, char *line, size_t sz)
>>>  		if (ptr == NULL)
>>>  			return;
>>>  		line = ++ptr;
>>> -		while (*ptr && *ptr != '"')
>>> +		while (*ptr && *ptr != '"' && *ptr != ']')
>>>  			ptr++;
>>> -		if (*ptr == '\0') {
>>> +		if (*ptr == '\0' || *ptr == ']') {
>>>  			xlog_warn("config file error: line %d: "
>>>   				"non-matched '\"', ignoring until next section", ln);
>>>  		}  else {
>> I'm not seeing how this helps... I realize that with this
>> patch we are saving the processing of a character or
>> two... but what problem is this patch solving?
> 
> If user sets the section message as [ MountPoint "Mount_point ]"
> for some mistake, the function should print the warning message,
> but it continues with argument is "Mount_point ]".
> 
> After this patch, the function can process this problem correctly.
Ok... I see the problem now... Thanks!

steved.
> 
> thanks,
> Mi Jinlong
> 

  reply	other threads:[~2010-11-29 16:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-05  2:45 [PATCH] libnfs.a: fix a bug when parse section's arg Mi Jinlong
2010-11-09  1:37 ` Mi Jinlong
2010-11-22 17:31   ` Steve Dickson
2010-11-24  9:07     ` Mi Jinlong
2010-11-29 16:06       ` Steve Dickson [this message]
2010-11-29 16:06 ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF3CF85.3090406@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mijinlong@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.