X-Git-Url: https://git.deb.at/?p=pkg%2Fnetris.git;a=blobdiff_plain;f=util.c;h=1fcae892547acfebc98d20556955c4c57ab7a2b0;hp=98248ed64e3ab11d625e6fa514325e2ae9c63146;hb=ddb8fabae6f55dd8512498a9efbba80c55b2ba4f;hpb=89d91b6cfd98e514b3e418526ba854d00beb876c diff --git a/util.c b/util.c index 98248ed..1fcae89 100644 --- a/util.c +++ b/util.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: util.c,v 1.27 1996/02/09 08:22:23 mhw Exp $ + * $Id: util.c,v 1.29 1999/05/16 06:56:33 mhw Exp $ */ #include "netris.h" @@ -66,7 +66,7 @@ ExtFunc void AtExit(void (*handler)(void)) ExtFunc void Usage(void) { fprintf(stderr, - "Netris version %s (C) 1994,1995,1996 Mark H. Weaver \n" + "Netris version %s (C) 1994-1996,1999 Mark H. Weaver \n" "Usage: netris \n" " -h Print usage information\n" " -w Wait for connection\n" @@ -74,7 +74,7 @@ ExtFunc void Usage(void) " -p Set port number (default is %d)\n" " -k Remap keys. The argument is a prefix of the string\n" " containing the keys in order: left, rotate, right, drop,\n" - " down-faster, toggle-spying, pause, faster, redraw.\n" + " down-faster, toggle-spying, pause, faster, redraw, new.\n" " \"^\" prefixes controls. (default is \"%s\")\n" " -i Set the step-down interval, in seconds\n" " -r Execute (a command) as a robot controlling\n" @@ -84,7 +84,8 @@ ExtFunc void Usage(void) " -D Drops go into drop mode\n" " This means that sliding off a cliff after a drop causes\n" " another drop automatically\n" - " -S Disable standout mode (inverse/bold) for slow terminals\n" + " -S Disable inverse/bold/color for slow terminals\n" + " -C Disable color\n" " -H Show distribution and warranty information\n" " -R Show rules\n", version_string, DEFAULT_PORT, DEFAULT_KEYS); @@ -93,7 +94,7 @@ ExtFunc void Usage(void) ExtFunc void DistInfo(void) { fprintf(stderr, - "Netris version %s (C) 1994,1995,1996 Mark H. Weaver \n" + "Netris version %s (C) 1994-1996,1999 Mark H. Weaver \n" "\n" "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" @@ -266,6 +267,7 @@ ExtFunc volatile void die(char *msg) ExtFunc volatile void fatal(char *msg) { + CleanupScreens (); fprintf(stderr, "%s\n", msg); exit(1); } @@ -318,11 +320,13 @@ ExtFunc void AddEventGen(EventGenRec *gen) ExtFunc void RemoveEventGen(EventGenRec *gen) { - assert(gen->next != NULL); - while (nextGen->next != gen) - nextGen = nextGen->next; - nextGen->next = gen->next; - gen->next = NULL; + /* assert(gen->next != NULL); /* Be more forgiving, for SIGINTs */ + if (gen->next) { + while (nextGen->next != gen) + nextGen = nextGen->next; + nextGen->next = gen->next; + gen->next = NULL; + } } ExtFunc MyEventType WaitMyEvent(MyEvent *event, int mask)