Commit 79e6722a authored by David Vasek's avatar David Vasek

knsupdate: don't report line errors in program exit status in interactive mode

parent d4f1adf5
......@@ -523,20 +523,15 @@ static int process_lines(knsupdate_params_t *params, FILE *input)
while (!params->stop && knot_getline(&buf, &buflen, input) != -1) {
/* Remove leading and trailing white space. */
char *line = strstrip(buf);
int call_ret = process_line(line, params);
ret = process_line(line, params);
memset(line, 0, strlen(line));
free(line);
if (call_ret != KNOT_EOK) {
/* Return the first error. */
if (ret == KNOT_EOK) {
ret = call_ret;
}
/* Exit if error and not interactive. */
if (!interactive) {
break;
}
/* Exit if error and not interactive. */
if (ret != KNOT_EOK && !interactive) {
break;
}
/* Line errors are not reported on exit when interactive. */
ret = KNOT_EOK;
/* Print program prompt if interactive. */
if (interactive && !params->stop) {
......
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