Commit | Line | Data |
---|---|---|
94aeb2d1 KA |
1 | # include "curses.ext" |
2 | ||
3 | /* | |
4 | * This routine gets a string starting at (_cury,_curx) | |
5 | * | |
e2e17146 | 6 | * @(#)getstr.c 1.5 (Berkeley) %G% |
94aeb2d1 KA |
7 | */ |
8 | wgetstr(win,str) | |
9 | reg WINDOW *win; | |
10 | reg char *str; { | |
11 | ||
57bc80fd | 12 | while ((*str = wgetch(win)) != ERR && *str != '\n') |
94aeb2d1 | 13 | str++; |
158defd2 | 14 | if (*str == ERR) { |
158defd2 | 15 | *str = '\0'; |
7527eef6 | 16 | return ERR; |
158defd2 KA |
17 | } |
18 | *str = '\0'; | |
94aeb2d1 KA |
19 | return OK; |
20 | } |