X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fwidechar%2Flib_cchar.c;h=ed1d236d900c5e6ee5052fca904d95f31b0980b5;hp=b465c36089a159c753fbc6271135c9b758d43d98;hb=a6ff7e087fd944fd0035075d0bb528e95e498d81;hpb=3eda6f30a84d53844d2ebceadb457e2e7e9cfbf3 diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index b465c360..ed1d236d 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 2001-2016,2017 Free Software Foundation, Inc. * + * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2001-2016,2017 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 * @@ -35,7 +36,7 @@ #include -MODULE_ID("$Id: lib_cchar.c,v 1.31 2017/03/31 11:14:26 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.33 2020/02/02 23:34:34 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -60,7 +61,7 @@ setcchar(cchar_t *wcval, set_extended_pair(opts, color_pair); if (wch == NULL - || ((len = (unsigned) wcslen(wch)) > 1 && wcwidth(wch[0]) < 0) + || ((len = (unsigned) wcslen(wch)) > 1 && _nc_wacs_width(wch[0]) < 0) || color_pair < 0) { code = ERR; } else { @@ -74,7 +75,7 @@ setcchar(cchar_t *wcval, * are only interested in adding non-spacing characters. */ for (i = 1; i < len; ++i) { - if (wcwidth(wch[i]) != 0) { + if (_nc_wacs_width(wch[i]) != 0) { len = i; break; }