Commit ab017a1f authored by Mike Hibler's avatar Mike Hibler
Browse files

Fix bug in parsing of quoted ('' or {}) command lines.

parent 86239818
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2005 University of Utah and the Flux Group.
* Copyright (c) 2000-2006 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -1079,14 +1079,18 @@ set_program(struct proginfo *pinfo, char *args)
char *value;
int rc;
if ((rc = event_arg_get(args, "COMMAND", &value)) > 0) {
if ((rc = event_arg_dup(args, "COMMAND", &value)) >= 0) {
if (pinfo->cmdline != NULL) {
if (pinfo->cmdline != pinfo->initial_cmdline) {
if (pinfo->cmdline != pinfo->initial_cmdline)
free(pinfo->cmdline);
pinfo->cmdline = NULL;
}
if (rc == 0) {
pinfo->cmdline = pinfo->initial_cmdline;
} else if (rc > 0) {
pinfo->cmdline = value;
} else {
assert(0);
}
asprintf(&pinfo->cmdline, "%s", value);
value = NULL;
}
if ((rc = event_arg_dup(args, "DIR", &value)) >= 0) {
......
Supports Markdown
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