Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-12-18 17:11:53 -05:00
2 changed files with 34 additions and 32 deletions
+2 -2
View File
@@ -9,9 +9,9 @@ Makefile.lib NH_filestag=(file%s_for_MSDOS_and_OS/2_versions_-_untested_for_3.6.
#termcap.uu NH_filestag=(file%s_for_MSDOS_and_OS/2_versions_-_untested_for_3.6.2) #termcap.uu NH_filestag=(file%s_for_MSDOS_and_OS/2_versions_-_untested_for_3.6.2)
termcap.uu NH_filestag=>Makefile.lib termcap.uu NH_filestag=>Makefile.lib
pcmain.c NH_filestag=(file_for_MSDOS,_OS/2,_NT,_Amiga,_and_Atari_versions_-_untested_for_3.6.2) pcmain.c NH_filestag=(file_for_MSDOS,_OS/2,_Amiga,_and_Atari_versions_-_untested_for_3.6.2)
pcsys.c NH_filestag=(file%s_for_MSDOS,_OS/2,_NT,_and_Atari_versions_-_untested_for_3.6.2) pcsys.c NH_filestag=(file%s_for_MSDOS,_OS/2_and_Atari_versions_-_untested_for_3.6.2)
pcunix.c NH_filestag=>pcsys.c pcunix.c NH_filestag=>pcsys.c
NetHack.cnf NH_filestag=(file_for_MSDOS,_OS/2,_and_Atari_versions_-_untested_for_3.6.2) NetHack.cnf NH_filestag=(file_for_MSDOS,_OS/2,_and_Atari_versions_-_untested_for_3.6.2)
+10 -8
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 recover.c $NHDT-Date: 1501461282 2017/07/31 00:34:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */ /* NetHack 3.6 recover.c $NHDT-Date: 1545170503 2018/12/18 22:01:43 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.18 $ */
/* Copyright (c) Janet Walz, 1992. */ /* Copyright (c) Janet Walz, 1992. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -58,8 +58,7 @@ char *FDECL(exepath, (char *));
#if defined(__BORLANDC__) && !defined(_WIN32) #if defined(__BORLANDC__) && !defined(_WIN32)
extern unsigned _stklen = STKSIZ; extern unsigned _stklen = STKSIZ;
#endif #endif
char char savename[SAVESIZE]; /* holds relative path of save file from playground */
savename[SAVESIZE]; /* holds relative path of save file from playground */
int int
main(argc, argv) main(argc, argv)
@@ -217,7 +216,7 @@ restore_savefile(basename)
char *basename; char *basename;
{ {
int gfd, lfd, sfd; int gfd, lfd, sfd;
int lev, savelev, hpid, pltmpsiz; int res = 0, lev, savelev, hpid, pltmpsiz;
xchar levc; xchar levc;
struct version_info version_data; struct version_info version_data;
struct savefile_info sfi; struct savefile_info sfi;
@@ -348,7 +347,7 @@ char *basename;
set_levelfile_name(0); set_levelfile_name(0);
(void) unlink(lock); (void) unlink(lock);
for (lev = 1; lev < 256; lev++) { for (lev = 1; lev < 256 && res == 0; lev++) {
/* level numbers are kept in xchars in save.c, so the /* level numbers are kept in xchars in save.c, so the
* maximum level number (for the endlevel) must be < 256 * maximum level number (for the endlevel) must be < 256
*/ */
@@ -357,7 +356,10 @@ char *basename;
if (lfd >= 0) { if (lfd >= 0) {
/* any or all of these may not exist */ /* any or all of these may not exist */
levc = (xchar) lev; levc = (xchar) lev;
write(sfd, (genericptr_t) &levc, sizeof(levc)); if (write(sfd, (genericptr_t) &levc, sizeof levc)
!= sizeof levc)
res = -1;
else
copy_bytes(lfd, sfd); copy_bytes(lfd, sfd);
Close(lfd); Close(lfd);
(void) unlink(lock); (void) unlink(lock);
@@ -369,7 +371,7 @@ char *basename;
#if 0 /* OBSOLETE, HackWB is no longer in use */ #if 0 /* OBSOLETE, HackWB is no longer in use */
#ifdef AMIGA #ifdef AMIGA
{ if (res == 0) {
/* we need to create an icon for the saved game /* we need to create an icon for the saved game
* or HackWB won't notice the file. * or HackWB won't notice the file.
*/ */
@@ -389,7 +391,7 @@ char *basename;
} }
#endif /*AMIGA*/ #endif /*AMIGA*/
#endif #endif
return 0; return res;
} }
#ifdef EXEPATH #ifdef EXEPATH