]> granicus.if.org Git - nethack/commitdiff
win32 clear registry
authornethack.allison <nethack.allison>
Tue, 18 Mar 2003 10:23:10 +0000 (10:23 +0000)
committernethack.allison <nethack.allison>
Tue, 18 Mar 2003 10:23:10 +0000 (10:23 +0000)
Clear the registry settings via
    nethack -clearreg

sys/share/pcmain.c

index be6b4e38948c5fe87273387040c449c5f214c707..8ccec94b60900f130d667cac2fadf8741f719c63 100644 (file)
@@ -59,6 +59,10 @@ extern void FDECL(nethack_exit,(int));
 #define nethack_exit exit
 #endif
 
+#if defined(MSWIN_GRAPHICS)
+extern void NDECL(mswin_destroy_reg);
+#endif
+
 #ifdef EXEPATH
 STATIC_DCL char *FDECL(exepath,(char *));
 #endif
@@ -236,7 +240,13 @@ char *argv[];
 #endif /*MSWIN_GRAPHICS*/
                        nethack_exit(EXIT_SUCCESS);
                }
-               
+
+#ifdef MSWIN_GRAPHICS
+               if (!strncmpi(argv[1], "-clearreg", 6)) {       /* clear registry */
+                       mswin_destroy_reg();
+                       nethack_exit(EXIT_SUCCESS);
+               }
+#endif
                /* Don't initialize the window system just to print usage */
                if (!strncmp(argv[1], "-?", 2) || !strncmp(argv[1], "/?", 2)) {
                        nhusage();