[Freeciv-Dev] Re: ^D in server. (PR#546)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Gaute B. Strokkenes <gs234@xxxxxxxxx> writes:
> It would be nice if typing ^D (or whatever the EOF char is) in the
> server was interpreted as a synonym for 'quit,' since this is the
> way most other readline-enable programs work.
Here's a patch that does just this. It was easier than I thought.
eof_on_console.diff
Description: Text Data
Some notes on the implementation:
* I briefly considered letting handle_stdin_input() deal with this
rather than calling quit_game() directly, but I decided against it
since handle_stdin_input() has to deal with input / output from
anywhere (despite the name) which makes things a bit more difficult.
* It doesn't print an 'are you sure' sort of message.
--
Big Gaute (not to be confused with LG)
PEGGY FLEMING is stealing BASKET BALLS to feed the babies in VERMONT.
|