X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_addstr.c;fp=ncurses%2Flib_addstr.c;h=9ac55e42aba7051daa4cf8cc5df3c1f36e981962;hp=42e4a21dda90399f2869c1ada36c00f43d74ffdf;hb=refs%2Ftags%2Fv5.0;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/ncurses/lib_addstr.c b/ncurses/base/lib_addstr.c similarity index 89% rename from ncurses/lib_addstr.c rename to ncurses/base/lib_addstr.c index 42e4a21d..9ac55e42 100644 --- a/ncurses/lib_addstr.c +++ b/ncurses/base/lib_addstr.c @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_addstr.c,v 1.14 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.16 1998/06/28 00:38:29 tom Exp $") int waddnstr(WINDOW *win, const char *const astr, int n) @@ -76,11 +76,12 @@ waddchnstr(WINDOW *win, const chtype *const astr, int n) short y = win->_cury; short x = win->_curx; int code = OK; +struct ldat *line; T((T_CALLED("waddchnstr(%p,%p,%d)"), win, astr, n)); if (!win) - returnCode(ERR); + returnCode(ERR); if (n < 0) { const chtype *str; @@ -93,20 +94,9 @@ int code = OK; if (n == 0) returnCode(code); - if (win->_line[y].firstchar == _NOCHANGE) - { - win->_line[y].firstchar = x; - win->_line[y].lastchar = x+n-1; - } - else - { - if (x < win->_line[y].firstchar) - win->_line[y].firstchar = x; - if (x+n-1 > win->_line[y].lastchar) - win->_line[y].lastchar = x+n-1; - } - - memcpy(win->_line[y].text+x, astr, n*sizeof(*astr)); + line = &(win->_line[y]); + memcpy(line->text+x, astr, n*sizeof(*astr)); + CHANGED_RANGE(line, x, x+n-1); _nc_synchook(win); returnCode(code);