On Mon, Jun 12, 2006 at 08:14:01PM -0400, Tom Lane wrote:
> I had interpreted the readline documentation to mean that readline would
> discard a partially typed line upon catching SIGINT.  Experimentation
> shows that this is not so, at least not with the version of readline I
> use here.  It does catch the signal and reset some internal state, but
> the partially typed line is NOT discarded.  Grumble.

Yeah, the documentation in readline there was pretty obtuse, but since
it didn't explicitly include typed characters as state, I figured it
didn't clear the line.

> I'll work on reviewing and applying the patch.  I don't much like the
> side-effects on the /scripts directory though ... there must be a better
> way than that.  Is it sane to declare the flag variable in print.c?

The problem is basically that some of those files are symlinked across
the tree and included from various different places. Some places
include print.c but don't include the signal handler stuff, which left
we with linker errors about undefined symbols.

In psql the symbol comes from common.c and so I also added it to
scripts/common.c, which cleared up all the errors. This would allow
psql to work and all other programs that included print.c would only
ever see zero in that variable.

Maybe some other arrangement is possible. Maybe like you suggest,
declare the symbol in print.c and make the declaration in common.c an
extern. The end result is the same though.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.

Attachment: signature.asc
Description: Digital signature

Reply via email to