OSDN Git Service

Minor fixups for psql's process_file() function.
authorRobert Haas <rhaas@postgresql.org>
Tue, 26 Oct 2010 23:28:18 +0000 (19:28 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 26 Oct 2010 23:35:33 +0000 (19:35 -0400)
commit1fea0c05eb4ac4a21d79471b9a7fe96163306b88
tree1fd8610584af7d2d8b3e3c0ccc230a3c6e23cffd
parent5c38782cc8b3219d43ac2ccaf4254fd590bde758
Minor fixups for psql's process_file() function.

- Avoid closing stdin, since we didn't open it.  Previously multiple
inclusions of stdin would be terminated with a single quit, now a separate
quit is needed for each invocation. Previous behavior also accessed stdin
after it was fclose()d, which is undefined behavior per ANSI C.

- Properly restore pset.inputfile, since the caller expects to be able
to free that memory.

Marti Raudsepp
src/bin/psql/command.c