From 200adcaa58b0439948d413d02a06a7da280a02e9 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 1 May 2003 13:18:55 +0000 Subject: [PATCH] Merge local changes (8 bit clean ctype support) onto mainline. --- contrib/groff/src/libs/libgroff/cmap.cpp | 10 +++++++++- contrib/groff/src/libs/libgroff/cset.cpp | 10 +++++++++- contrib/groff/src/libs/libgroff/invalid.cpp | 6 ++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/contrib/groff/src/libs/libgroff/cmap.cpp b/contrib/groff/src/libs/libgroff/cmap.cpp index 4b75d06f1dcf..a6379913b832 100644 --- a/contrib/groff/src/libs/libgroff/cmap.cpp +++ b/contrib/groff/src/libs/libgroff/cmap.cpp @@ -18,13 +18,18 @@ You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ + #include +#ifdef __FreeBSD__ +#include +#endif #include "cmap.h" cmap cmlower(CMAP_BUILTIN); cmap cmupper(CMAP_BUILTIN); -#ifdef isascii +#if defined(isascii) && !defined(__FreeBSD__) #define ISASCII(c) isascii(c) #else #define ISASCII(c) (1) @@ -49,6 +54,9 @@ cmap_init::cmap_init() if (initialised) return; initialised = 1; +#ifdef __FreeBSD__ + (void) setlocale(LC_CTYPE, ""); +#endif for (int i = 0; i <= UCHAR_MAX; i++) { cmupper.v[i] = ISASCII(i) && islower(i) ? toupper(i) : i; cmlower.v[i] = ISASCII(i) && isupper(i) ? tolower(i) : i; diff --git a/contrib/groff/src/libs/libgroff/cset.cpp b/contrib/groff/src/libs/libgroff/cset.cpp index e4845c11012e..68564c4a02cc 100644 --- a/contrib/groff/src/libs/libgroff/cset.cpp +++ b/contrib/groff/src/libs/libgroff/cset.cpp @@ -18,7 +18,12 @@ You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ + #include +#ifdef __FreeBSD__ +#include +#endif #include "cset.h" cset csalpha(CSET_BUILTIN); @@ -33,7 +38,7 @@ cset csprint(CSET_BUILTIN); cset csgraph(CSET_BUILTIN); cset cscntrl(CSET_BUILTIN); -#ifdef isascii +#if defined(isascii) && !defined(__FreeBSD__) #define ISASCII(c) isascii(c) #else #define ISASCII(c) (1) @@ -86,6 +91,9 @@ cset_init::cset_init() if (initialised) return; initialised = 1; +#ifdef __FreeBSD__ + (void) setlocale(LC_CTYPE, ""); +#endif for (int i = 0; i <= UCHAR_MAX; i++) { csalpha.v[i] = ISASCII(i) && isalpha(i); csupper.v[i] = ISASCII(i) && isupper(i); diff --git a/contrib/groff/src/libs/libgroff/invalid.cpp b/contrib/groff/src/libs/libgroff/invalid.cpp index f36894a8b43a..63b3cc2d8af6 100644 --- a/contrib/groff/src/libs/libgroff/invalid.cpp +++ b/contrib/groff/src/libs/libgroff/invalid.cpp @@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ + #include "lib.h" // Table of invalid input characters. @@ -31,8 +33,8 @@ char invalid_char_table[256]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,