getstring() improved to check for escape sequence

This commit is contained in:
Frederic Culot 2006-09-17 10:45:06 +00:00
parent 3340d3da93
commit fd02fafb2e

View File

@ -1,4 +1,4 @@
/* $calcurse: utils.c,v 1.9 2006/09/16 15:25:52 culot Exp $ */ /* $calcurse: utils.c,v 1.10 2006/09/17 10:45:06 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -146,6 +146,9 @@ int start_x, start_y;
waddch(win, ' '); waddch(win, ' ');
wmove(win, start_y, start_x + charcount); wmove(win, start_y, start_x + charcount);
} }
} else if (ch == ESCAPE) {
*string = NULL;
return;
} else { } else {
*string++ = ch; *string++ = ch;
charcount++; charcount++;