Compile-time option to allow some prompts remember the input

Define EDIT_GETLIN to make the tty, X11, and Qt4 windowports to
remember the input strings for wishing and annotation.
This commit is contained in:
Pasi Kallinen
2018-03-26 22:58:28 +03:00
parent 66e50aeeac
commit 94ad7512a6
23 changed files with 55 additions and 29 deletions

View File

@@ -2034,17 +2034,24 @@ int
donamelevel()
{
mapseen *mptr;
char nbuf[BUFSZ]; /* Buffer for response */
char nbuf[BUFSZ] = DUMMY; /* Buffer for response */
if (!(mptr = find_mapseen(&u.uz)))
return 0;
#ifdef EDIT_GETLIN
if (mptr->custom) {
(void) strncpy(nbuf, mptr->custom, BUFSZ);
nbuf[BUFSZ-1] = '\0';
}
#else
if (mptr->custom) {
char tmpbuf[BUFSZ];
Sprintf(tmpbuf, "Replace annotation \"%.30s%s\" with?", mptr->custom,
strlen(mptr->custom) > 30 ? "..." : "");
getlin(tmpbuf, nbuf);
} else
#endif
getlin("What do you want to call this dungeon level?", nbuf);
if (index(nbuf, '\033'))
return 0;