Commit cd75d6f0 authored by Pietro Fezzardi's avatar Pietro Fezzardi

lib/conf.c: fix ARG_NONE, factorize code

Every case of the switch was colling the cfg_handler out of the
switch construct, avery time with the same arguments.
The only case not calling the config function was case ARG_NONE.
But this doesn't make sense, because if a configuration option
does not do anything, then it should not be there, even without
arguments.
So the call to config function is now made from every case, even
ARG_NONE, then it should not stay inside the switch.
parent 35456ab1
......@@ -287,8 +287,6 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
lineno, word);
return -1;
}
if (l->f(lineno, &cfg_arg))
return -1;
break;
case ARG_STR:
......@@ -296,8 +294,6 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
line++;
cfg_arg.s = line;
if (l->f(lineno, &cfg_arg))
return -1;
break;
case ARG_NAMES:
......@@ -310,8 +306,6 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
return -1;
}
cfg_arg.i = n->value;
if (l->f(lineno, &cfg_arg))
return -1;
break;
case ARG_TIME:
......@@ -320,12 +314,12 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
"\"%s\"\n", lineno, line, word);
return -1;
}
break;
}
if (l->f(lineno, &cfg_arg))
return -1;
break;
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment