Merge local changes (8 bit clean ctype support) onto mainline.

This commit is contained in:
ru 2003-05-01 13:18:55 +00:00
parent 5ff4e18513
commit cedd18b281
3 changed files with 22 additions and 4 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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,