Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-10-07 22:05:40 -04:00
3 changed files with 37 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.125 $ $NHDT-Date: 1570318925 2019/10/05 23:42:05 $
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.126 $ $NHDT-Date: 1570408209 2019/10/07 00:30:09 $
This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -209,6 +209,8 @@ tty: revert the attempt to fix "message line anomaly: if autodecribe feedback
wrapped to second line, the wrapped portion wasn't erased when a
shorter line was shown or getpos was dismissed" because it disrupted
prompts that spanned more than one line, a more significant issue
unix: sysconf CHECK_PLNAME=1 wouldn't work if attempt to obtain unix username
failed even though it didn't need that username
Platform- and/or Interface-Specific Fixes or Features

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 unixmain.c $NHDT-Date: 1562187898 2019/07/03 21:04:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.78 $ */
/* NetHack 3.6 unixmain.c $NHDT-Date: 1570408210 2019/10/07 00:30:10 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.70 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -117,7 +117,7 @@ char *argv[];
if (argcheck(argc, argv, ARG_DEBUG) == 1) {
argc--;
argv++;
}
}
if (argc > 1 && !strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') {
/* avoid matching "-dec" for DECgraphics; since the man page
@@ -262,7 +262,7 @@ char *argv[];
* First, try to find and restore a save file for specified character.
* We'll return here if new game player_selection() renames the hero.
*/
attempt_restore:
attempt_restore:
/*
* getlock() complains and quits if there is already a game
@@ -531,8 +531,8 @@ whoami()
{
/*
* Who am i? Algorithm: 1. Use name as specified in NETHACKOPTIONS
* 2. Use $USER or $LOGNAME (if 1. fails)
* 3. Use getlogin() (if 2. fails)
* 2. Use $USER or $LOGNAME (if 1. fails)
* 3. Use getlogin() (if 2. fails)
* The resulting name is overridden by command line options.
* If everything fails, or if the resulting name is some generic
* account like "games", "play", "player", "hack" then eventually
@@ -651,20 +651,20 @@ boolean
check_user_string(optstr)
char *optstr;
{
struct passwd *pw = get_unix_pw();
struct passwd *pw;
int pwlen;
char *eop, *w;
char *pwname;
char *pwname = 0;
if (optstr[0] == '*')
return TRUE; /* allow any user */
if (!pw)
return FALSE;
if (sysopt.check_plname)
pwname = g.plname;
else
else if ((pw = get_unix_pw()) != 0)
pwname = pw->pw_name;
pwlen = strlen(pwname);
if (!pwname || !*pwname)
return FALSE;
pwlen = (int) strlen(pwname);
eop = eos(optstr);
w = optstr;
while (w + pwlen <= eop) {
@@ -722,7 +722,6 @@ get_login_name()
struct passwd *pw = get_unix_pw();
buf[0] = '\0';
if (pw)
(void)strcpy(buf, pw->pw_name);
@@ -739,31 +738,33 @@ char *buf;
/* This should be replaced when there is a Cocoa port. */
const char *errfmt;
size_t len;
FILE *PB = popen("/usr/bin/pbcopy","w");
if(!PB){
errfmt = "Unable to start pbcopy (%d)\n";
goto error;
FILE *PB = popen("/usr/bin/pbcopy", "w");
if (!PB) {
errfmt = "Unable to start pbcopy (%d)\n";
goto error;
}
len = strlen(buf);
/* Remove the trailing \n, carefully. */
if(buf[len-1] == '\n') len--;
if (buf[len - 1] == '\n')
len--;
/* XXX Sorry, I'm too lazy to write a loop for output this short. */
if(len!=fwrite(buf,1,len,PB)){
errfmt = "Error sending data to pbcopy (%d)\n";
goto error;
if (len != fwrite(buf, 1, len, PB)) {
errfmt = "Error sending data to pbcopy (%d)\n";
goto error;
}
if(pclose(PB)!=-1){
return;
if (pclose(PB) != -1) {
return;
}
errfmt = "Error finishing pbcopy (%d)\n";
error:
raw_printf(errfmt,strerror(errno));
error:
raw_printf(errfmt, strerror(errno));
}
#endif
#endif /* __APPLE__ */
unsigned long
sys_random_seed()

View File

@@ -4209,11 +4209,15 @@ int x, y;
text++;
}
}
} else {
/* Now we're truncating */
if (truncation_expected)
; /* but we knew in advance */
}
#if 0
else {
if (truncation_expected) {
/* Now we're truncating */
; /* but we knew in advance */
}
}
#endif
}
/* caller must set cond_shrinklvl (0..2) before calling us */