]> granicus.if.org Git - nethack/commitdiff
win32tty hangs if you ^C at "Who are you?"
authornethack.allison <nethack.allison>
Tue, 21 Oct 2003 14:17:04 +0000 (14:17 +0000)
committernethack.allison <nethack.allison>
Tue, 21 Oct 2003 14:17:04 +0000 (14:17 +0000)
From Newsgroups: rec.games.roguelike.nethack :
> <email deleted>
> Subject: question for windows tty users
>
> I am trying to hunt down a bug, and want to know if I have
> encountered another one of those bizarre "features" that only
> occur on my computer (I seem to get a lot of them).
>
> I can reproduce this bug, or whatever it is, in the official
> Windows binary like this: Start the tty version of NetHack by
> double clicking on the program. You won't see the bug if you
> start it from the command line. When the game asks, "Who are
> you?" press ^C. NetHack will respond with "^C abort. Hit
> <Enter> to end," and then it hangs. Pressing Enter does
> nothing, and the program does not end.
>
> Can anybody else reproduce this behaviour? Thanks in advance.
>
> -- <Someone>

sys/share/pcmain.c
sys/share/pcsys.c
sys/winnt/nttty.c

index 267cb06744f0b64a7a53970708659d6fa49293f2..41a436d4a0bb46843783c3060dbaf482bd745a14 100644 (file)
@@ -52,6 +52,10 @@ extern void FDECL(nethack_exit,(int));
 #define nethack_exit exit
 #endif
 
+#ifdef WIN32
+extern boolean getreturn_enabled;      /* from sys/share/pcsys.c */
+#endif
+
 #if defined(MSWIN_GRAPHICS)
 extern void NDECL(mswin_destroy_reg);
 #endif
@@ -433,7 +437,9 @@ not_recovered:
 #ifdef OS2
        gettty(); /* somehow ctrl-P gets turned back on during startup ... */
 #endif
-
+#ifdef WIN32
+       getreturn_enabled = TRUE;
+#endif
        return;
 }
 
index 9c3f762845b5e2861e41c4c9b95c3d3cc2e3f24a..9828508de2be8ebd1b489b31f1b60fe4670c6908 100644 (file)
@@ -389,7 +389,7 @@ char *name;
 }
 
 #ifdef WIN32
-boolean getreturn_disable;
+boolean getreturn_enabled;
 #endif
 
 void
@@ -397,7 +397,7 @@ getreturn(str)
 const char *str;
 {
 #ifdef WIN32
-       if (getreturn_disable) return;
+       if (!getreturn_enabled) return;
 #endif
 #ifdef TOS
        msmsg("Hit <Return> %s.", str);
index 29ad6fd67639e06fe61323ff0dcdb08e6c850767..a1c2668ab307afed3188669cc0215ed8bcf65854 100644 (file)
@@ -58,6 +58,8 @@ INPUT_RECORD ir;
 int GUILaunched;
 static BOOL FDECL(CtrlHandler, (DWORD));
 
+extern boolean getreturn_enabled;      /* from sys/share/pcsys.c */
+
 /* dynamic keystroke handling .DLL support */
 typedef int (__stdcall * PROCESS_KEYSTROKE)(
     HANDLE,
@@ -207,8 +209,6 @@ tty_end_screen()
        FlushConsoleInputBuffer(hConIn);
 }
 
-extern boolean getreturn_disable;      /* from sys/share/pcsys.c */
-
 static BOOL CtrlHandler(ctrltype)
 DWORD ctrltype;
 {
@@ -219,7 +219,7 @@ DWORD ctrltype;
                case CTRL_CLOSE_EVENT:
                case CTRL_LOGOFF_EVENT:
                case CTRL_SHUTDOWN_EVENT:
-                       getreturn_disable = TRUE;
+                       getreturn_enabled = FALSE;
 #ifndef NOSAVEONHANGUP
                        hangup(0);
 #endif