rather than just storing a pointer.
dryrun = true;
break;
case 'x':
- additional_ext = optarg; /* Extension to remove from
+ additional_ext = strdup(optarg); /* Extension to remove from
* xlogfile names */
break;
default:
}
break;
case 't': /* Trigger file */
- triggerPath = optarg;
+ triggerPath = strdup(optarg);
break;
case 'w': /* Max wait time */
maxwaittime = atoi(optarg);
is_init_mode++;
break;
case 'h':
- pghost = optarg;
+ pghost = pg_strdup(optarg);
break;
case 'n':
is_no_vacuum++;
do_vacuum_accounts++;
break;
case 'p':
- pgport = optarg;
+ pgport = pg_strdup(optarg);
break;
case 'd':
debug++;
}
break;
case 'U':
- login = optarg;
+ login = pg_strdup(optarg);
break;
case 'l':
use_log = true;
break;
case 'f':
ttype = 3;
- filename = optarg;
+ filename = pg_strdup(optarg);
if (process_file(filename) == false || *sql_files[num_files - 1] == NULL)
exit(1);
break;
/* This covers long options which take no argument. */
break;
case 2: /* tablespace */
- tablespace = optarg;
+ tablespace = pg_strdup(optarg);
break;
case 3: /* index-tablespace */
- index_tablespace = optarg;
+ index_tablespace = pg_strdup(optarg);
break;
case 4:
sample_rate = atof(optarg);
SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'D':
- userDoption = optarg;
+ userDoption = strdup(optarg);
break;
case 'd':
{
break;
case 'C':
- output_config_variable = optarg;
+ output_config_variable = strdup(optarg);
break;
case 'D':
- userDoption = optarg;
+ userDoption = strdup(optarg);
break;
case 'd':
break;
case 'E': /* Dump encoding */
- dumpencoding = optarg;
+ dumpencoding = pg_strdup(optarg);
break;
case 'f':
- filename = optarg;
+ filename = pg_strdup(optarg);
break;
case 'F':
- format = optarg;
+ format = pg_strdup(optarg);
break;
case 'h': /* server host */
- pghost = optarg;
+ pghost = pg_strdup(optarg);
break;
case 'i':
break;
case 'p': /* server port */
- pgport = optarg;
+ pgport = pg_strdup(optarg);
break;
case 'R':
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'v': /* verbose */
break;
case 2: /* lock-wait-timeout */
- lockWaitTimeout = optarg;
+ lockWaitTimeout = pg_strdup(optarg);
break;
case 3: /* SET ROLE */
- use_role = optarg;
+ use_role = pg_strdup(optarg);
break;
case 4: /* exclude table(s) data */
break;
case 'f':
- filename = optarg;
+ filename = pg_strdup(optarg);
appendPQExpBuffer(pgdumpopts, " -f ");
doShellQuoting(pgdumpopts, filename);
break;
break;
case 'h':
- pghost = optarg;
+ pghost = pg_strdup(optarg);
appendPQExpBuffer(pgdumpopts, " -h ");
doShellQuoting(pgdumpopts, pghost);
break;
break;
case 'l':
- pgdb = optarg;
+ pgdb = pg_strdup(optarg);
break;
case 'o':
break;
case 'p':
- pgport = optarg;
+ pgport = pg_strdup(optarg);
appendPQExpBuffer(pgdumpopts, " -p ");
doShellQuoting(pgdumpopts, pgport);
break;
break;
case 'U':
- pguser = optarg;
+ pguser = pg_strdup(optarg);
appendPQExpBuffer(pgdumpopts, " -U ");
doShellQuoting(pgdumpopts, pguser);
break;
break;
case 3:
- use_role = optarg;
+ use_role = pg_strdup(optarg);
appendPQExpBuffer(pgdumpopts, " --role ");
doShellQuoting(pgdumpopts, use_role);
break;
break;
case 'U':
- opts->username = optarg;
+ opts->username = pg_strdup(optarg);
break;
case 'v': /* verbose */
break;
case 2: /* SET ROLE */
- opts->use_role = optarg;
+ opts->use_role = pg_strdup(optarg);
break;
case 3: /* section */
pset.popt.topt.format = PRINT_UNALIGNED;
break;
case 'c':
- options->action_string = optarg;
+ options->action_string = pg_strdup(optarg);
if (optarg[0] == '\\')
{
options->action = ACT_SINGLE_SLASH;
options->action = ACT_SINGLE_QUERY;
break;
case 'd':
- options->dbname = optarg;
+ options->dbname = pg_strdup(optarg);
break;
case 'e':
SetVariable(pset.vars, "ECHO", "queries");
break;
case 'f':
options->action = ACT_FILE;
- options->action_string = optarg;
+ options->action_string = pg_strdup(optarg);
break;
case 'F':
pset.popt.topt.fieldSep.separator = pg_strdup(optarg);
pset.popt.topt.fieldSep.separator_zero = false;
break;
case 'h':
- options->host = optarg;
+ options->host = pg_strdup(optarg);
break;
case 'H':
pset.popt.topt.format = PRINT_HTML;
options->action = ACT_LIST_DB;
break;
case 'L':
- options->logfilename = optarg;
+ options->logfilename = pg_strdup(optarg);
break;
case 'n':
options->no_readline = true;
setQFout(optarg);
break;
case 'p':
- options->port = optarg;
+ options->port = pg_strdup(optarg);
break;
case 'P':
{
pset.popt.topt.tableAttr = pg_strdup(optarg);
break;
case 'U':
- options->username = optarg;
+ options->username = pg_strdup(optarg);
break;
case 'v':
{
switch (c)
{
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
quiet = true;
break;
case 'd':
- dbname = optarg;
+ dbname = pg_strdup(optarg);
break;
case 'a':
alldb = true;
break;
case 't':
- table = optarg;
+ table = pg_strdup(optarg);
break;
case 'v':
verbose = true;
break;
case 2:
- maintenance_db = optarg;
+ maintenance_db = pg_strdup(optarg);
break;
default:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
switch (c)
{
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
echo = true;
break;
case 'O':
- owner = optarg;
+ owner = pg_strdup(optarg);
break;
case 'D':
- tablespace = optarg;
+ tablespace = pg_strdup(optarg);
break;
case 'T':
- template = optarg;
+ template = pg_strdup(optarg);
break;
case 'E':
- encoding = optarg;
+ encoding = pg_strdup(optarg);
break;
case 1:
- lc_collate = optarg;
+ lc_collate = pg_strdup(optarg);
break;
case 2:
- lc_ctype = optarg;
+ lc_ctype = pg_strdup(optarg);
break;
case 'l':
- locale = optarg;
+ locale = pg_strdup(optarg);
break;
case 3:
- maintenance_db = optarg;
+ maintenance_db = pg_strdup(optarg);
break;
default:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
listlangs = true;
break;
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
prompt_password = TRI_YES;
break;
case 'd':
- dbname = optarg;
+ dbname = pg_strdup(optarg);
break;
case 'e':
echo = true;
switch (c)
{
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
login = TRI_NO;
break;
case 'c':
- conn_limit = optarg;
+ conn_limit = pg_strdup(optarg);
break;
case 'P':
pwprompt = true;
switch (c)
{
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
/* this covers the long options */
break;
case 2:
- maintenance_db = optarg;
+ maintenance_db = pg_strdup(optarg);
break;
default:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
listlangs = true;
break;
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
prompt_password = TRI_YES;
break;
case 'd':
- dbname = optarg;
+ dbname = pg_strdup(optarg);
break;
case 'e':
echo = true;
switch (c)
{
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
switch (c)
{
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
quiet = true;
break;
case 'd':
- dbname = optarg;
+ dbname = pg_strdup(optarg);
break;
case 'a':
alldb = true;
syscatalog = true;
break;
case 't':
- table = optarg;
+ table = pg_strdup(optarg);
break;
case 'i':
- index = optarg;
+ index = pg_strdup(optarg);
break;
case 2:
- maintenance_db = optarg;
+ maintenance_db = pg_strdup(optarg);
break;
default:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
switch (c)
{
case 'h':
- host = optarg;
+ host = pg_strdup(optarg);
break;
case 'p':
- port = optarg;
+ port = pg_strdup(optarg);
break;
case 'U':
- username = optarg;
+ username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
quiet = true;
break;
case 'd':
- dbname = optarg;
+ dbname = pg_strdup(optarg);
break;
case 'z':
and_analyze = true;
alldb = true;
break;
case 't':
- table = optarg;
+ table = pg_strdup(optarg);
break;
case 'f':
full = true;
verbose = true;
break;
case 2:
- maintenance_db = optarg;
+ maintenance_db = pg_strdup(optarg);
break;
default:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
regression_mode = true;
break;
case 'o':
- output_filename = optarg;
+ output_filename = strdup(optarg);
if (strcmp(output_filename, "-") == 0)
yyout = stdout;
else
usage(stderr, EXIT_FAILURE);
case 'd':
if (directory == NULL)
- directory = optarg;
+ directory = strdup(optarg);
else
{
(void) fprintf(stderr,
break;
case 'l':
if (lcltime == NULL)
- lcltime = optarg;
+ lcltime = strdup(optarg);
else
{
(void) fprintf(stderr,
break;
case 'p':
if (psxrules == NULL)
- psxrules = optarg;
+ psxrules = strdup(optarg);
else
{
(void) fprintf(stderr,
break;
case 'y':
if (yitcommand == NULL)
- yitcommand = optarg;
+ yitcommand = strdup(optarg);
else
{
(void) fprintf(stderr,
break;
case 'L':
if (leapsec == NULL)
- leapsec = optarg;
+ leapsec = strdup(optarg);
else
{
(void) fprintf(stderr,