- T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr,n), n));
-
- if (win != 0
- && wstr != 0
- && wcwidth(*wstr) > 0) {
- code = OK;
- if (n < 1)
- n = wcslen(wstr);
- oy = win->_cury;
- ox = win->_curx;
- for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
- NCURSES_CH_T wch;
- SetChar2(wch, *cp);
- if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') {
- _nc_waddch_nosync(win, wch);
- } else if (is7bits(*cp) && iscntrl(*cp)) {
- winsch(win, ' ' + (chtype) (*cp));
- winsch(win, (chtype) '^');
- win->_curx += 2;
- } else if (wins_wch(win, &wch) == ERR
- || win->_curx > win->_maxx) {
- break;
+ if (str != 0 && *str != '\0') {
+ for (ptr = tree; ptr != 0; ptr = ptr->sibling) {
+ if (UChar(*str) == UChar(ptr->ch)) {
+ if (str[1] == '\0' && ptr->child != 0) {
+ result = -1;
+ } else if ((result = find_definition(ptr->child, str + 1)) == 0) {
+ result = ptr->value;
+ } else if (str[1] == '\0') {
+ result = -1;
+ }