comparison srogue/options.c @ 103:00baf21eb047

srogue: fix backspace key during prompts. md_readchar() handled the key properly, but get_str(), which is called when prompting user entry, called wgetch() instead of md_readchar().
author John "Elwin" Edwards
date Tue, 03 Sep 2013 14:02:15 -0700
parents 3aa87373c908
children aa582a02eb5d
comparison
equal deleted inserted replaced
102:1906d183f1f5 103:00baf21eb047
120 draw(awin); 120 draw(awin);
121 getyx(awin, oy, ox); 121 getyx(awin, oy, ox);
122 /* 122 /*
123 * loop reading in the string, and put it in a temporary buffer 123 * loop reading in the string, and put it in a temporary buffer
124 */ 124 */
125 for (sp = buf; (c=wgetch(awin)) != '\n' && c != '\r' && c != ESCAPE; 125 for (sp = buf; (c=readchar(awin)) != '\n' && c != '\r' && c != ESCAPE;
126 wclrtoeol(awin), draw(awin)) { 126 wclrtoeol(awin), draw(awin)) {
127 if (( (int)sp - (int)buf ) >= 50) { 127 if (( (int)sp - (int)buf ) >= 50) {
128 *sp = '\0'; /* line was too long */ 128 *sp = '\0'; /* line was too long */
129 strucpy(opt,buf,strlen(buf)); 129 strucpy(opt,buf,strlen(buf));
130 mvwaddstr(awin, 0, 0, "Name was truncated --More--"); 130 mvwaddstr(awin, 0, 0, "Name was truncated --More--");