1
0
mirror of https://github.com/termux/termux-packages synced 2024-06-17 01:37:09 +00:00
termux-packages/packages/nethack/src-files.c.patch
Henrik Grimler 1b3ba4bcfe nethack: use absolute paths when saving game
Have not managed to figure out why saving with a relative path
fails. Life is too short to investigate that one full Sunday though,
and this works.
2021-11-27 13:00:41 +01:00

23 lines
783 B
Diff

--- ../NetHack-NetHack-3.6.6_Released/src/files.c 2020-03-08 18:29:31.000000000 +0100
+++ ./src/files.c 2020-10-11 16:23:20.809498886 +0200
@@ -86,7 +86,7 @@
#endif
#if defined(UNIX) || defined(__BEOS__)
-#define SAVESIZE (PL_NSIZ + 13) /* save/99999player.e */
+#define SAVESIZE 128
#else
#ifdef VMS
#define SAVESIZE (PL_NSIZ + 22) /* [.save]<uid>player.e;1 */
@@ -966,9 +966,7 @@
Sprintf(SAVEF, "%s%s", encodedfnamebuf, SAVE_EXTENSION);
}
#else /* not VMS or MICRO or WIN32 */
- Sprintf(SAVEF, "save/%d%s", (int) getuid(), plname);
- if (regularize_it)
- regularize(SAVEF + 5); /* avoid . or / in name */
+ Sprintf(SAVEF, "@TERMUX_PREFIX@/games/nethackdir/save/termux_%s", plname);
#endif /* WIN32 */
#endif /* MICRO */
#endif /* VMS */