X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_insch.c;fp=ncurses%2Fbase%2Flib_insch.c;h=d813740e43c5f92bbb578d35a41fe6c10760973d;hp=9166ea5240e7f3adf62c9631bca98ffd50847dfa;hb=7a6bbc8cf41c5186d46accc3d08622dc86526b34;hpb=fc79b49bd8a9c5e4db287514cdac46e1691cf48a diff --git a/ncurses/base/lib_insch.c b/ncurses/base/lib_insch.c index 9166ea52..d813740e 100644 --- a/ncurses/base/lib_insch.c +++ b/ncurses/base/lib_insch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -43,7 +43,7 @@ #include #include -MODULE_ID("$Id: lib_insch.c,v 1.25 2008/02/03 00:14:37 tom Exp $") +MODULE_ID("$Id: lib_insch.c,v 1.27 2009/04/18 23:53:33 tom Exp $") /* * Insert the given character, updating the current location to simplify @@ -56,10 +56,19 @@ _nc_insert_ch(WINDOW *win, chtype ch) NCURSES_CH_T wch; int count; NCURSES_CONST char *s; - +#if NCURSES_SP_FUNCS || USE_REENTRANT + SCREEN *sp = _nc_screen_of(win); +#endif + int tabsize = +#if USE_REENTRANT + sp->_TABSIZE +#else + TABSIZE +#endif + ; switch (ch) { case '\t': - for (count = (TABSIZE - (win->_curx % TABSIZE)); count > 0; count--) { + for (count = (tabsize - (win->_curx % tabsize)); count > 0; count--) { if ((code = _nc_insert_ch(win, ' ')) != OK) break; } @@ -93,7 +102,7 @@ _nc_insert_ch(WINDOW *win, chtype ch) win->_curx++; } } else if (is8bits(ChCharOf(ch)) && iscntrl(ChCharOf(ch))) { - s = unctrl(ChCharOf(ch)); + s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch)); while (*s != '\0') { code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s)); if (code != OK) @@ -114,7 +123,7 @@ _nc_insert_ch(WINDOW *win, chtype ch) } else if (count == -1) { /* handle EILSEQ */ if (is8bits(ch)) { - s = unctrl(ChCharOf(ch)); + s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch)); while (*s != '\0') { code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s)); if (code != OK)