#779354 Terminal incorrectly restored on exit from purity

Package:
purity
Source:
purity
Description:
automated purity testing software
Submitter:
Pedro Gimeno
Date:
2015-02-27 15:42:06 UTC
Severity:
normal
#779354#5
Date:
2015-02-27 15:40:08 UTC
From:
To:
When exiting from 'purity', the terminal is left in a bad state. Ctrl+C
does no longer work to cancel the command line and the prompt in 'rm -i'
does not echo characters, and needs me to press Ctrl+J instead of Enter
to confirm.

The reason is that 'purity' uses a signed short instead of the adequate
type, tcflag_t, for saving the tcsetattr flags that it restores later.
Since bit 15 is set in my case, when expanded to unsigned, the high bits
are all set, setting all kinds of unwanted flags that cause the above
behaviour.

The attached patch solves it.