make a slight adjustment to the quickmimic() sense wording
fix typo in passage 1 of The Colour of Magic
falling asleep when reading dull spellbook ignored sleep resistance
+getpos() complaint about invalid movement keystroke didn't describe meta-chars
+ accurately
Platform- and/or Interface-Specific Fixes
-----------------------------------------
+tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the
+ line below it, leaving bogus '.' displayed on the top row of the map
unix/X11: in top level Makefile, some commented out definitions of VARDATND
misspelled pilemark.xbm (as pilemark.xpm)
win32gui: getversionstring() was overflowing the provided Help About buffer
-/* NetHack 3.6 cmd.c $NHDT-Date: 1449736557 2015/12/10 08:35:57 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.208 $ */
+/* NetHack 3.6 cmd.c $NHDT-Date: 1450178549 2015/12/15 11:22:29 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.209 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
extern int NDECL(dowieldquiver); /**/
extern int NDECL(dozap); /**/
extern int NDECL(doorganize); /**/
-#endif /* DUMB */
+#endif /* DUMB */
static int NDECL(dosuspend_core); /**/
register const struct func_tab *tlist;
int res, NDECL((*func));
-#if 0
- /* obsolete - scan through the cmdlist array looking for *cmd */
- for (tlist = cmdlist; tlist->f_char; tlist++) {
- if ((*cmd & 0xff) != (tlist->f_char & 0xff))
- continue;
-#else
/* current - use *cmd to directly index cmdlist array */
if ((tlist = Cmd.commands[*cmd & 0xff]) != 0) {
-#endif
if (u.uburied && !tlist->can_if_buried) {
You_cant("do that while you are buried!");
res = 0;
}
if (bad_command) {
- char expcmd[10];
- register char c, *cp = expcmd;
-
- while ((c = *cmd++) != '\0'
- && (int) (cp - expcmd) < (int) (sizeof expcmd - 3)) {
- if (c >= 040 && c < 0177) {
- *cp++ = c;
- } else if (c & 0200) {
- *cp++ = 'M';
- *cp++ = '-';
- *cp++ = c & ~0200;
- } else {
- *cp++ = '^';
- *cp++ = c ^ 0100;
- }
- }
- *cp = '\0';
+ char expcmd[20]; /* we expect 'cmd' to point to 1 or 2 chars */
+ register char c;
+
+ expcmd[0] = '\0';
+ while ((c = *cmd++) != '\0')
+ Strcat(expcmd, visctrl(c)); /* add 1..4 chars plus terminator */
+
if (!prefix_seen || !iflags.cmdassist
|| !help_dir(0, "Invalid direction key!"))
Norep("Unknown command '%s'.", expcmd);
if (!index(quitchars, dirsym)) {
help_requested = (dirsym == '?');
if (help_requested || iflags.cmdassist) {
- did_help =
- help_dir((s && *s == '^') ? dirsym : 0,
- help_requested ? (const char *) 0
- : "Invalid direction key!");
+ did_help = help_dir((s && *s == '^') ? dirsym : 0,
+ help_requested ? (const char *) 0
+ : "Invalid direction key!");
if (help_requested)
goto retry;
}
iflags.last_msg = PLNMSG_UNKNOWN; /* most recent pline is clobbered */
/* maximum acceptable length is QBUFSZ-1 */
- if (strlen(query) < QBUFSZ)
- return (*windowprocs.win_yn_function)(query, resp, def);
-
- /* caller shouldn't have passed anything this long */
- paniclog("Query truncated: ", query);
- (void) strncpy(qbuf, query, QBUFSZ - 1 - 3);
- Strcpy(&qbuf[QBUFSZ - 1 - 3], "...");
- return (*windowprocs.win_yn_function)(qbuf, resp, def);
+ if (strlen(query) >= QBUFSZ) {
+ /* caller shouldn't have passed anything this long */
+ paniclog("Query truncated: ", query);
+ (void) strncpy(qbuf, query, QBUFSZ - 1 - 3);
+ Strcpy(&qbuf[QBUFSZ - 1 - 3], "...");
+ query = qbuf;
+ }
+ return (*windowprocs.win_yn_function)(query, resp, def);
}
/* for paranoid_confirm:quit,die,attack prompting */
-/* NetHack 3.6 do_name.c $NHDT-Date: 1449982602 2015/12/13 04:56:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.79 $ */
+/* NetHack 3.6 do_name.c $NHDT-Date: 1450178550 2015/12/15 11:22:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.80 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
putstr(tmpwin, 0, "Use [HJKL] to move the cursor 8 units at a time.");
putstr(tmpwin, 0, "Or enter a background symbol (ex. <).");
putstr(tmpwin, 0, "Use @ to move the cursor on yourself.");
- if (getpos_hilitefunc != NULL)
+ if (getpos_hilitefunc)
putstr(tmpwin, 0, "Use $ to display valid locations.");
putstr(tmpwin, 0, "Use # to toggle automatic description.");
/* disgusting hack; the alternate selection characters work for any
/* update message window to reflect that we're still targetting */
show_goal_msg = TRUE;
msg_given = TRUE;
- } else if ((c == '$') && (getpos_hilitefunc != NULL)) {
+ } else if (c == '$' && getpos_hilitefunc) {
if (!hilite_state) {
(*getpos_hilitefunc)(0);
(*getpos_hilitefunc)(1);
clear_nhwindow(WIN_MESSAGE);
ccp->x = cx;
ccp->y = cy;
- getpos_hilitefunc = NULL;
+ getpos_hilitefunc = (void FDECL((*), (int))) 0;
return result;
}
-/* NetHack 3.6 hacklib.c $NHDT-Date: 1446336792 2015/11/01 00:13:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ */
+/* NetHack 3.6 hacklib.c $NHDT-Date: 1450178551 2015/12/15 11:22:31 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.46 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* Copyright (c) Robert Patrick Rankin, 1991 */
/* NetHack may be freely redistributed. See license for details. */
visctrl(c)
char c;
{
- Static char ccc[3];
+ Static char ccc[5];
+ register int i = 0;
+ if ((uchar) c & 0200) {
+ ccc[i++] = 'M';
+ ccc[i++] = '-';
+ }
c &= 0177;
- ccc[2] = '\0';
if (c < 040) {
- ccc[0] = '^';
- ccc[1] = c | 0100; /* letter */
+ ccc[i++] = '^';
+ ccc[i++] = c | 0100; /* letter */
} else if (c == 0177) {
- ccc[0] = '^';
- ccc[1] = c & ~0100; /* '?' */
+ ccc[i++] = '^';
+ ccc[i++] = c & ~0100; /* '?' */
} else {
- ccc[0] = c; /* printable character */
- ccc[1] = '\0';
+ ccc[i++] = c; /* printable character */
}
+ ccc[i] = '\0';
return ccc;
}