Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] Re: ^D in server. (PR#546)
Home

[Freeciv-Dev] Re: ^D in server. (PR#546)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: ^D in server. (PR#546)
From: gs234@xxxxxxxxx (Gaute B. Strokkenes)
Date: 05 Sep 2000 17:48:55 +0200

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.

Attachment: 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.

[Prev in Thread] Current Thread [Next in Thread]