summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2003-05-01 13:18:55 +0000
committerru <ru@FreeBSD.org>2003-05-01 13:18:55 +0000
commit7d401b64e847aef2b48a0005276b004e23f75f74 (patch)
tree42e5e9bdebd48a85eddf629d6c519f799dc67183 /contrib
parent9129bef4d749712ee65e1bd84dec749b22b782af (diff)
downloadFreeBSD-src-7d401b64e847aef2b48a0005276b004e23f75f74.zip
FreeBSD-src-7d401b64e847aef2b48a0005276b004e23f75f74.tar.gz
Merge local changes (8 bit clean ctype support) onto mainline.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/groff/src/libs/libgroff/cmap.cpp10
-rw-r--r--contrib/groff/src/libs/libgroff/cset.cpp10
-rw-r--r--contrib/groff/src/libs/libgroff/invalid.cpp6
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 4b75d06..a637991 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 <ctype.h>
+#ifdef __FreeBSD__
+#include <locale.h>
+#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 e4845c1..68564c4 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 <ctype.h>
+#ifdef __FreeBSD__
+#include <locale.h>
+#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 f36894a..63b3cc2 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,
OpenPOWER on IntegriCloud