summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Magloire <alainm@rcsm.ee.mcgill.ca>1999-02-24 01:08:56 +0000
committerAlain Magloire <alainm@rcsm.ee.mcgill.ca>1999-02-24 01:08:56 +0000
commitf12caa4a9f58c9d68947df547a11ecaa5bb92010 (patch)
tree80b1bb8d8fe4203f1ace6dbfc0eccf34f0d45674
parentadd749abc636a89e8a1a88ae2d2f94616ead628c (diff)
downloadgrep-f12caa4a9f58c9d68947df547a11ecaa5bb92010.tar.gz
No longer use btowc. From P. E.
Exclude btow.c. remove. * NEWS: Fix typo when talking about the old behavior of silently skipping directories; it was grep 2.1, not grep 2.2.
-rw-r--r--ChangeLog26
-rw-r--r--bootstrap/Makefile.try1
-rw-r--r--configure.in10
-rw-r--r--src/btowc.c52
4 files changed, 28 insertions, 61 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f7e5eea..fbba11c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+1999-02-23 Paul Eggert
+
+ Fix porting bug reported by Amakawa Shuhei for SunOS 4.1.4-JL.
+ The btowc.c shipped with grep 2.3 is incorrect for Solaris
+ 2.5.1 and earlier, as it assumes UTF8, which these OSes do not
+ support. Solaris 7 supports btowc, so there's no need to ship
+ a substitute for it. The only questionable case is Solaris
+ 2.6, which lacks btowc but does support UTF8. However, 2.6
+ supports UTF8 but only as a demonstration (for an English
+ locale!); Japanese Solaris 2.6 users typically use EUC, or
+ sometimes shift-JIS, but they cannot use UTF8 since Japanese
+ UTF8 is not supported. Hence there's no point to having grep
+ substitute a btowc that uses UTF8, as it is either redundant,
+ or it will almost invariably have incorrect behavior.
+
+ * configure.in (AC_CHECK_HEADERS): Don't set USE_WCHAR.
+ (AC_CHECK_FUNCS): Add btowc, wctype.
+ (AC_REPLACE_FUNCS): Don't replace btowc; our replacement is
+ invariably doing the wrong thing anyway, at least on SunOS/Solaris.
+ Don't bother to check for wctype in -lw, as we don't support
+ wide characters on Solaris 2.5.1 or earlier anyway.
+
+ * bootstrap/Makefile.try (OBJS): Remove btowc.$(OBJEXT).
+
+ * src/btowc.c: Removed; no longer needed.
+
1999-02-19 Paul Eggert
* NEWS: Fix typo when talking about the old behavior of
diff --git a/bootstrap/Makefile.try b/bootstrap/Makefile.try
index 67c206f1..5add0ddf 100644
--- a/bootstrap/Makefile.try
+++ b/bootstrap/Makefile.try
@@ -8,7 +8,6 @@ OBJEXT = o
OBJS = alloca.$(OBJEXT) \
- btowc.$(OBJEXT) \
dfa.$(OBJEXT) \
getopt.$(OBJEXT) \
getopt1.$(OBJEXT) \
diff --git a/configure.in b/configure.in
index 6aad8b54..0c0b0851 100644
--- a/configure.in
+++ b/configure.in
@@ -29,7 +29,7 @@ AC_C_CONST
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h stdlib.h sys/param.h memory.h unistd.h libintl.h)
-AC_CHECK_HEADERS(wctype.h wchar.h, USE_WCHAR=yes, USE_WCHAR=no)
+AC_CHECK_HEADERS(wctype.h wchar.h)
AC_HEADER_DIRENT
AC_HEADER_STAT
@@ -38,14 +38,8 @@ AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MMAP
dnl getpagesize is checked for by AC_FUNC_MMAP.
-AC_CHECK_FUNCS(strerror isascii setmode)
+AC_CHECK_FUNCS(btowc isascii setmode strerror wctype)
AC_REPLACE_FUNCS(memchr stpcpy)
-dnl Solaris 2.5 doesn't have btowc()
-if test "$USE_WCHAR" = "yes"; then
- AC_REPLACE_FUNCS(btowc)
-dnl Solaris puts wctype/wXXX() in /usr/lib/libw.a
- AC_CHECK_LIB(w, wctype, [LIBS="$LIBS -lw"])
-fi
dnl for VC++
if test x$ac_cv_prog_CC = xcl ; then
diff --git a/src/btowc.c b/src/btowc.c
deleted file mode 100644
index ec430df1..00000000
--- a/src/btowc.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-
-#if ! defined(HAVE_WCHAR_H) || defined(__CYGWIN__)
-typedef unsigned int wint_t;
-# undef WEOF
-# define WEOF ((wint_t)-1)
-#else
-#include <wchar.h>
-#endif
-
-#ifndef weak_alias
-# define __btowc btowc
-#endif
-
-/* We use UTF8 encoding for multibyte strings and therefore a valid
- one byte multibyte string only can have a value from 0 to 0x7f. */
-wint_t
-__btowc (c)
- int c;
-{
- if (WEOF != (wint_t) EOF || c < 0 || c > 0x7f)
- return WEOF;
- else
- return (wint_t) c;
-}
-
-#ifdef weak_alias
-weak_alias (__btowc, btowc)
-#endif