Fix scope/loop bug in src/cmd/cmd_svf.c

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1591 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Rutger Hofman 16 years ago
parent 0064c8b83a
commit 56502adbe5

@ -67,24 +67,31 @@ cmd_svf_run (urj_chain_t *chain, char *params[])
print_progress = 1;
else if (strncasecmp (params[i], "ref_freq=", 9) == 0)
ref_freq = strtol (params[i] + 9, NULL, 10);
if (print_progress)
urj_log_state.level = URJ_LOG_LEVEL_DETAIL;
if ((SVF_FILE = fopen (params[1], "r")) != NULL)
{
if (! urj_svf_run (chain, SVF_FILE, stop, ref_freq))
result = URJ_STATUS_FAIL;
fclose (SVF_FILE);
}
else
{
urj_error_set (URJ_ERROR_SYNTAX, "%s: unknown command '%s'",
params[0], params[i]);
result = URJ_STATUS_FAIL;
return URJ_STATUS_FAIL;
}
}
if (print_progress)
urj_log_state.level = URJ_LOG_LEVEL_DETAIL;
if ((SVF_FILE = fopen (params[1], "r")) != NULL)
{
if (! urj_svf_run (chain, SVF_FILE, stop, ref_freq))
result = URJ_STATUS_FAIL;
fclose (SVF_FILE);
}
else
{
urj_error_IO_set ("%s: cannot open file '%s'",
params[0], params[i]);
result = URJ_STATUS_FAIL;
}
urj_log_state.level = old_log_level;
return result;

Loading…
Cancel
Save