|
@@ -94,7 +94,8 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
|
94
|
94
|
|
95
|
95
|
_str = str;
|
96
|
96
|
|
97
|
|
- while ( ( ( c = wgetch( win ) ) != '\n' ) && !( n == 0 ) ) {
|
|
97
|
+ while (!( n == 0 ) ) {
|
|
98
|
+ c = wgetch( win );
|
98
|
99
|
if ( c >= 0401 && c <= 0633 ) {
|
99
|
100
|
switch(c) {
|
100
|
101
|
case KEY_LEFT :
|
|
@@ -107,7 +108,10 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
|
107
|
108
|
*_str = '\0';
|
108
|
109
|
break;
|
109
|
110
|
}
|
110
|
|
- } else { // *should* only be ASCII chars now
|
|
111
|
+ } else if ( c == '\n' ) {
|
|
112
|
+ *_str = '\0';
|
|
113
|
+ break;
|
|
114
|
+ }else { // *should* only be ASCII chars now
|
111
|
115
|
*(_str++) = (char)c;
|
112
|
116
|
n--;
|
113
|
117
|
}
|