Re: [PATCH] : Inversion for options

From: Krzysztof Oledzki <ole#ans.pl>
Date: Wed, 26 Dec 2007 00:27:52 +0100 (CET)

On Wed, 26 Dec 2007, Aleksandar Lazic wrote:

> Hi,
>
> On Die 25.12.2007 04:49, Krzysztof Oledzki wrote:
>
>> diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h
>
> [snipp]
>
>> -int cfg_parse_listen(const char *file, int linenum, char **args)
>> +int cfg_parse_listen(const char *file, int linenum, char **args, int inv)
>> {
>> static struct proxy *curproxy = NULL;
>> struct server *newsrv = NULL;
>> @@ -1145,8 +1145,8 @@ int cfg_parse_listen(const char *file, int linenum,
>> char **args)
>> else if (!strcmp(args[0], "option")) {
>> int optnum;
>>
>> - if (*(args[1]) == 0) {
>> - Alert("parsing [%s:%d] : '%s' expects an option
>> name.\n", file, linenum, args[0]);
>> + if (*(args[1]) == '\0') {
>> + Alert("parsing [%s:%d]: expected option name.\n",
>> file, linenum);
>> return -1;
>> }
>>
>
> I think the %s will help to know which command expected a option, IMHO.

Thank you for checking my patch, however I still think that this %s is useless here as there is only one value it can take: "option".

         if (*(args[1]) == '\0') {
                 Alert("parsing [%s:%d]: expected option name.\n", file, linenum);
                 return -1;
         }

--- cut here ---

So IMHO there is no point in "parsing [haproxy.cfg:66]: 'option' expects an option name.", but if you insist I can keep it unchanged. ;)

Best regards,

                                 Krzysztof Olędzki Received on 2007/12/26 00:27

This archive was generated by hypermail 2.2.0 : 2007/12/26 00:30 CET