The function is supposed to look at the passed in 'arg' argument, but
peeks at the 'optarg' global variable that's part of getopt()
instead. It happened to work anyway, because all callers passed
'optarg' as the argument.
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/
d1da5f0e-0d68-47c9-a882-
eb22f462752f@iki.fi
switch (arg[0])
{
case 'p':
- if (optarg[1] == 'a') /* "parser" */
+ if (arg[1] == 'a') /* "parser" */
return "log_parser_stats";
- else if (optarg[1] == 'l') /* "planner" */
+ else if (arg[1] == 'l') /* "planner" */
return "log_planner_stats";
break;