From 31e40def94abb1770be3654b6caafc5fb84c85c6 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sun, 21 Apr 2002 13:22:57 +0000 Subject: [PATCH] (from ) Allow someone to resume their game by clicking on a saved game, if they have an association set up. --- win/win32/winhack.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/win/win32/winhack.c b/win/win32/winhack.c index bf516413d..b254f472e 100644 --- a/win/win32/winhack.c +++ b/win/win32/winhack.c @@ -153,6 +153,27 @@ int APIENTRY WinMain(HINSTANCE hInstance, GetModuleFileName(NULL, wbuf, BUFSZ); argv[0] = _strdup(NH_W2A(wbuf, buf, BUFSZ)); + if (argc == 2) { + TCHAR *savefile = strdup(argv[1]); + TCHAR *plname; + for (p = savefile; *p && *p != '-'; p++) + ; + if (*p) { + /* we found a '-' */ + plname = p + 1; + for (p = plname; *p && *p != '.'; p++) + ; + if (*p) { + if (strcmp(p + 1, "NetHack-saved-game") == 0) { + *p = '\0'; + argv[1] = "-u"; + argv[2] = _strdup(plname); + argc = 3; + } + } + } + free(savefile); + } pcmain(argc,argv); moveloop(); -- 2.40.0