avoid leaking a file pointer when out keyword is given multiple times

This commit is contained in:
Axel Kohlmeyer
2015-10-04 20:22:51 -04:00
parent 9ca1d815da
commit 7efb97e033

View File

@ -104,6 +104,7 @@ void Info::command(int narg, char **arg)
++idx;
} else if ((idx+1 < narg) && (strncmp(arg[idx],"out",3) == 0)
&& (strncmp(arg[idx+1],"screen",3) == 0)) {
if ((out != screen) && (out != logfile)) fclose(out);
out = screen;
idx += 2;
} else if ((idx+1 < narg) && (strncmp(arg[idx],"out",3) == 0)