Fix Savannah bug #19656: rationalize our use of case-insensitive string

comparison functions to always use POSIX strcasecmp().  For non-POSIX
systems that use other functions (strcmpi or stricmp) use a macro to alias
strcasecmp to those.  If we can't find any of them (VMS, plus whatever
UNIX doesn't have them) then define our own version in misc.c.
This commit is contained in:
Paul Smith 2007-05-09 02:01:53 +00:00
parent 891409f212
commit 52ebc531ce
14 changed files with 194 additions and 132 deletions

View File

@ -1,3 +1,25 @@
2007-05-08 Paul Smith <psmith@gnu.org>
Fix Savannah bug #19656:
* configure.in: Check for strcasecmp(), strcmpi(), and stricmp().
* make.h: Change all case-insensitive string compares to use
strcasecmp() (from POSIX). If we don't have that but do have one
of the others, define strcasecmp to be one of those instead. If
we don't have any, declare a prototype for our own version.
* misc.c (strcasecmp): Use this if we can't find any native
case-insensitive string comparison function.
* vmsfunctions.c: Remove strcmpi(); we'll use misc.c:strcasecmp().
* main.c (find_and_set_default_shell): Use strcasecmp() instead of
strcmpi().
* job.c (_is_unixy_shell, construct_command_argv_internal): Use
strcasecmp() instead of stricmp().
* hash.h (ISTRING_COMPARE, return_ISTRING_COMPARE): Use strcasecmp()
instead of strcmpi().
* acinclude.m4: Remove the strcasecmp() check from here.
2007-03-21 Paul Smith <psmith@gnu.org>
* configure.in: Don't turn on case-insensitive file system support

View File

@ -62,9 +62,6 @@ fi
#
AC_CHECK_FUNCS(gethostbyname,,[
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
#
AC_CHECK_FUNCS(strcasecmp,,[
CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
])
LIBS="$LIBS $cf_cv_netlibs"
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG

View File

@ -262,9 +262,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* Define to 1 if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define to 1 if you have the strcmpi function. */
/* #undef HAVE_STRCMPI */
/* Define to 1 if you have the stricmp function. */
/* #undef HAVE_STRICMP */
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1

View File

@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
/* #undef HAVE_GETTEXT */
/* Define if your locale.h file contains LC_MESSAGES. */
/* Define to 1 if your locale.h file contains LC_MESSAGES. */
/* #undef HAVE_LC_MESSAGES */
/* Define to the installation directory for locales. */
@ -44,7 +44,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define as 1 if you have the stpcpy function. */
/* #undef HAVE_STPCPY */
/* Define if the closedir function returns void instead of int. */
/* Define to 1 if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */
@ -57,7 +57,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define for DGUX with <sys/dg_sys_info.h>. */
/* #undef DGUX */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* Define to 1 if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to `unsigned long' or `unsigned long long'
@ -67,89 +67,89 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define if you have alloca, as a function or macro. */
/* Define to 1 if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define if you don't have vprintf but do have _doprnt. */
/* Define to 1 if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
/* Define if your system has a working fnmatch function. */
/* Define to 1 if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define if your system has its own `getloadavg' function. */
/* Define to 1 if your system has its own `getloadavg' function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */
/* Define to 1 if you have the getmntent function. */
/* #undef HAVE_GETMNTENT */
/* Define if the `long double' type works. */
/* Define to 1 if the `long double' type works. */
/* #undef HAVE_LONG_DOUBLE */
/* Define if you support file names longer than 14 characters. */
/* Define to 1 if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES 1
/* Define if you have a working `mmap' system call. */
/* Define to 1 if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define if system calls automatically restart after interruption
/* Define to 1 if system calls automatically restart after interruption
by a signal. */
/* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */
/* Define to 1 if your struct stat has st_blksize. */
/* #undef HAVE_ST_BLKSIZE */
/* Define if your struct stat has st_blocks. */
/* Define to 1 if your struct stat has st_blocks. */
/* #undef HAVE_ST_BLOCKS */
/* Define if you have the strcoll function and it is properly defined. */
/* Define to 1 if you have the strcoll function and it is properly defined. */
/* #undef HAVE_STRCOLL */
/* Define if your struct stat has st_rdev. */
/* Define to 1 if your struct stat has st_rdev. */
/* #undef HAVE_ST_RDEV */
/* Define if you have the strftime function. */
/* Define to 1 if you have the strftime function. */
/* #undef HAVE_STRFTIME */
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H */
/* Define if your struct tm has tm_zone. */
/* Define to 1 if your struct tm has tm_zone. */
/* #undef HAVE_TM_ZONE */
/* Define if you don't have tm_zone but do have the external array
/* Define to 1 if you don't have tm_zone but do have the external array
tzname. */
/* #undef HAVE_TZNAME */
/* Define if you have <unistd.h>. */
/* Define to 1 if you have <unistd.h>. */
#ifdef __DECC
#define HAVE_UNISTD_H 1
#endif
/* Define if utime(file, NULL) sets file's timestamp to the present. */
/* Define to 1 if utime(file, NULL) sets file's timestamp to the present. */
/* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */
/* Define to 1 if you have <vfork.h>. */
/* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */
/* Define to 1 if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */
/* Define to 1 if you have the wait3 system call. */
/* #undef HAVE_WAIT3 */
/* Define if on MINIX. */
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */
/* Define to 1 if your struct nlist has an n_un member. */
/* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */
/* Define to 1 if you have <nlist.h>. */
/* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Define to `int' if <sys/types.h> doesn't define. */
@ -158,17 +158,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#define pid_t int
#endif
/* Define if the system does not provide POSIX.1 features except
/* Define to 1 if the system does not provide POSIX.1 features except
with this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define if you need to in order for stat and other things to work. */
/* Define to 1 if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define if the setvbuf function takes the buffering type as its second
/* Define to 1 if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V
before release 3. */
/* #undef SETVBUF_REVERSED */
@ -182,16 +182,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
*/
/* #undef STACK_DIRECTION */
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */
/* Define to 1 if you have the ANSI C header files. */
/* #undef STDC_HEADERS */
/* Define on System V Release 4. */
/* #undef SVR4 */
/* Define if `sys_siglist' is declared by <signal.h>. */
/* Define to 1 if `sys_siglist' is declared by <signal.h>. */
/* #undef SYS_SIGLIST_DECLARED */
/* Define to `int' if <sys/types.h> doesn't define. */
@ -228,137 +228,143 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this if the C library defines the variable `sys_siglist'. */
/* Define to 1 if the C library defines the variable `sys_siglist'. */
/* #undefine HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */
/* Define to 1 if the C library defines the variable `_sys_siglist'. */
/* #undef HAVE__SYS_SIGLIST */
/* Define this if you have the `union wait' type in <sys/wait.h>. */
/* Define to 1 if you have the `union wait' type in <sys/wait.h>. */
/* #undef HAVE_UNION_WAIT */
/* Define if you have the dup2 function. */
/* Define to 1 if you have the dup2 function. */
#define HAVE_DUP2 1
/* Define if you have the getcwd function. */
/* Define to 1 if you have the getcwd function. */
#define HAVE_GETCWD 1
/* Define if you have the getgroups function. */
/* Define to 1 if you have the getgroups function. */
/* #undef HAVE_GETGROUPS */
/* Define if you have the gethostbyname function. */
/* Define to 1 if you have the gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* Define to 1 if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the getloadavg function. */
/* Define to 1 if you have the getloadavg function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the memmove function. */
/* Define to 1 if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the mktemp function. */
/* Define to 1 if you have the mktemp function. */
#define HAVE_MKTEMP 1
/* Define if you have the psignal function. */
/* Define to 1 if you have the psignal function. */
/* #undef HAVE_PSIGNAL */
/* Define if you have the pstat_getdynamic function. */
/* Define to 1 if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define if you have the setegid function. */
/* Define to 1 if you have the setegid function. */
/* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */
/* Define to 1 if you have the seteuid function. */
/* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */
/* Define to 1 if you have the setlinebuf function. */
/* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */
/* Define to 1 if you have the setregid function. */
/* #undefine HAVE_SETREGID */
/* Define if you have the setreuid function. */
/* Define to 1 if you have the setreuid function. */
/* #define HAVE_SETREUID */
/* Define if you have the sigsetmask function. */
/* Define to 1 if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 1
/* Define if you have the socket function. */
/* Define to 1 if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* Define to 1 if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define if you have the strerror function. */
/* Define to 1 if you have the strcmpi function. */
/* #undef HAVE_STRCMPI */
/* Define to 1 if you have the stricmp function. */
/* #undef HAVE_STRICMP */
/* Define to 1 if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strsignal function. */
/* Define to 1 if you have the strsignal function. */
/* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */
/* Define to 1 if you have the wait3 function. */
/* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */
/* Define to 1 if you have the waitpid function. */
/* #undef HAVE_WAITPID */
/* Define if you have the <dirent.h> header file. */
/* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define if you have the <fcntl.h> header file. */
/* Define to 1 if you have the <fcntl.h> header file. */
#ifdef __DECC
#define HAVE_FCNTL_H 1
#endif
/* Define if you have the <limits.h> header file. */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <mach/mach.h> header file. */
/* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef HAVE_MACH_MACH_H */
/* Define if you have the <memory.h> header file. */
/* Define to 1 if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
/* Define if you have the <ndir.h> header file. */
/* Define to 1 if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */
/* Define if your compiler conforms to the ANSI C standard. */
/* Define to 1 if your compiler conforms to the ANSI C standard. */
#define HAVE_ANSI_COMPILER 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define if you have the <stdlib.h> header file. */
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/dir.h> header file. */
/* Define to 1 if you have the <sys/dir.h> header file. */
/* #undef HAVE_SYS_DIR_H */
/* Define if you have the <sys/ndir.h> header file. */
/* Define to 1 if you have the <sys/ndir.h> header file. */
/* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */
/* Define to 1 if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H */
/* Define if you have the <sys/timeb.h> header file. */
/* Define to 1 if you have the <sys/timeb.h> header file. */
#ifndef __GNUC__
#define HAVE_SYS_TIMEB_H 1
#endif
/* Define if you have the <sys/wait.h> header file. */
/* Define to 1 if you have the <sys/wait.h> header file. */
/* #undef HAVE_SYS_WAIT_H */
/* Define if you have the dgc library (-ldgc). */
/* Define to 1 if you have the dgc library (-ldgc). */
/* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* Define to 1 if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT *
/* Define if you have the sun library (-lsun). */
/* Define to 1 if you have the sun library (-lsun). */
/* #undef HAVE_LIBSUN */
/* Use high resolution file timestamps if nonzero. */

View File

@ -226,6 +226,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define to 1 if you have the `strcasecmp' function. */
/* #undef HAVE_STRCASECMP */
/* Define to 1 if you have the `strcmpi' function. */
#define HAVE_STRCMPI 1
/* Define to 1 if you have the `stricmp' function. */
/* #undef HAVE_STRICMP */
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1

View File

@ -21,10 +21,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
/* Define if `sys_siglist' is declared by <signal.h>. */
/* Define to 1 if `sys_siglist' is declared by <signal.h>. */
# define SYS_SIGLIST_DECLARED 1
/* Define this if the C library defines the variable `_sys_siglist'. */
/* Define to 1 if the C library defines the variable `_sys_siglist'. */
# define HAVE_SYS_SIGLIST 1
#else
@ -40,16 +40,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define if you have the fdopen function. */
/* Define to 1 if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* Define to 1 if you have the `getgroups' function. */
#define HAVE_GETGROUPS 1
/* Define if you have the <memory.h> header file. */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define if you have the mkstemp function. */
/* Define to 1 if you have the mkstemp function. */
#define HAVE_MKSTEMP 1
/* Define to 1 if you have the `mktemp' function. */
@ -70,19 +70,22 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define the type of the first arg to select(). */
#define fd_set_size_t int
/* Define if you have the select function. */
/* Define to 1 if you have the select function. */
#define HAVE_SELECT 1
/* Define if your compiler conforms to the ANSI C standard. */
/* Define to 1 if your compiler conforms to the ANSI C standard. */
#define HAVE_ANSI_COMPILER 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define if you have the vprintf library function. */
/* Define to 1 if you have the vprintf library function. */
#undef HAVE_VPRINTF
#define HAVE_VPRINTF 1
/* Define to 1 if you have the stricmp function. */
#define HAVE_STRICMP 1
/* Name of the package */
#define PACKAGE "%PACKAGE%"

View File

@ -68,7 +68,7 @@ AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
# Set a flag if we have an ANSI C compiler
if test "$ac_cv_prog_cc_stdc" != no; then
AC_DEFINE(HAVE_ANSI_COMPILER, 1,
[Define if your compiler conforms to the ANSI C standard.])
[Define to 1 if your compiler conforms to the ANSI C standard.])
fi
@ -119,7 +119,7 @@ if test "$make_cv_file_timestamp_hi_res" = yes; then
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
if test "$ac_cv_search_clock_gettime" != no; then
AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
[Define if you have the clock_gettime function.])
[Define to 1 if you have the clock_gettime function.])
fi
fi
@ -143,7 +143,7 @@ AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
[ac_cv_func_gettimeofday="no (cross-compiling)"])])
if test "$ac_cv_func_gettimeofday" = yes; then
AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
[Define if you have a standard gettimeofday function])
[Define to 1 if you have a standard gettimeofday function])
fi
AC_CHECK_FUNCS( strdup mkstemp mktemp fdopen \
@ -154,6 +154,11 @@ AC_CHECK_FUNCS( strdup mkstemp mktemp fdopen \
AC_FUNC_SETVBUF_REVERSED
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
# It doesn't hurt much to use our own if we can't find it so I don't
# make the effort here.
AC_CHECK_FUNCS(strcasecmp strcmpi stricmp)
# strcoll() is used by the GNU glob library
AC_FUNC_STRCOLL
@ -176,7 +181,7 @@ if test "$ac_cv_header_nlist_h" = yes; then
[make_cv_nlist_struct=no])
if test "$make_cv_nlist_struct" = yes; then
AC_DEFINE(NLIST_STRUCT, 1,
[Define if struct nlist.n_name is a pointer rather than an array.])
[Define to 1 if struct nlist.n_name is a pointer rather than an array.])
fi
fi
@ -217,7 +222,7 @@ AC_CACHE_VAL(make_cv_union_wait, [dnl
[make_cv_union_wait=no])])
if test "$make_cv_union_wait" = yes; then
AC_DEFINE(HAVE_UNION_WAIT, 1,
[Define this if you have the \`union wait' type in <sys/wait.h>.])
[Define to 1 if you have the \`union wait' type in <sys/wait.h>.])
fi
AC_MSG_RESULT($make_cv_union_wait)
@ -225,7 +230,7 @@ AC_MSG_RESULT($make_cv_union_wait)
# If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
if test "$PATH_SEPARATOR" = ';'; then
AC_DEFINE(HAVE_DOS_PATHS, 1,
[Define this if your system requires backslashes or drive specs in pathnames.])
[Define to 1 if your system requires backslashes or drive specs in pathnames.])
fi
@ -287,7 +292,7 @@ AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
if test "$make_cv_sa_restart" != no; then
AC_DEFINE(HAVE_SA_RESTART, 1,
[Define if <signal.h> defines the SA_RESTART constant.])
[Define to 1 if <signal.h> defines the SA_RESTART constant.])
fi
# enable make_cv_sa_restart for OS/2 so that the jobserver will be enabled,
@ -299,7 +304,7 @@ esac
case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/$make_cv_job_server" in
yes/yes/yes/yes/yes)
AC_DEFINE(MAKE_JOBSERVER, 1,
[Define this to enable job server support in GNU make.]);;
[Define to 1 to enable job server support in GNU make.]);;
esac
# if we have both lstat() and readlink() then we can support symlink
@ -307,7 +312,7 @@ esac
case "$ac_cv_func_lstat/$ac_cv_func_readlink" in
yes/yes)
AC_DEFINE(MAKE_SYMLINKS, 1,
[Define this to enable symbolic link timestamp checking.]);;
[Define to 1 to enable symbolic link timestamp checking.]);;
esac
# Find the SCCS commands, so we can include them in our default rules.
@ -334,7 +339,7 @@ if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
fi])
case "$make_cv_sys_get_minus_G" in
yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
[Define this if the SCCS 'get' command understands the '-G<file>' option.]);;
[Define to 1 if the SCCS 'get' command understands the '-G<file>' option.]);;
esac
fi
rm -f s.conftest conftoast

View File

@ -2274,7 +2274,7 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
{
/* How many arguments do we have? */
for (i=0; argv[i+1]; ++i)
;
;
return expand_builtin_function (o, i, argv+1, entry_p);
}

4
hash.h
View File

@ -173,10 +173,10 @@ extern void *hash_deleted_item;
} while (0)
#define ISTRING_COMPARE(X, Y, RESULT) do { \
RESULT = strcmpi ((X), (Y)); \
RESULT = strcasecmp ((X), (Y)); \
} while (0)
#define return_ISTRING_COMPARE(X, Y) do { \
return strcmpi ((X), (Y)); \
return strcasecmp ((X), (Y)); \
} while (0)
#else

6
job.c
View File

@ -358,7 +358,7 @@ _is_unixy_shell (const char *path)
i = 0;
while (known_os2shells[i] != NULL) {
if (stricmp (name, known_os2shells[i]) == 0) /* strcasecmp() */
if (strcasecmp (name, known_os2shells[i]) == 0)
return 0; /* not a unix shell */
i++;
}
@ -494,7 +494,7 @@ reap_children (int block, int err)
pre-POSIX systems. We keep the count only because... it's there...
The test and decrement are not atomic; if it is compiled into:
register = dead_children - 1;
register = dead_children - 1;
dead_children = register;
a SIGCHLD could come between the two instructions.
child_handler increments dead_children.
@ -2360,7 +2360,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
goto slow;
#else /* not WINDOWS32 */
#if defined (__MSDOS__) || defined (__EMX__)
else if (stricmp (shell, default_shell))
else if (strcasecmp (shell, default_shell))
{
extern int _is_unixy_shell (const char *_path);

6
main.c
View File

@ -1,6 +1,6 @@
/* Argument parsing and main program of GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
Foundation, Inc.
This file is part of GNU Make.
@ -761,11 +761,11 @@ find_and_set_default_shell (const char *token)
if (((tokend == search_token
|| (tokend > search_token
&& (tokend[-1] == '/' || tokend[-1] == '\\')))
&& !strcmpi (tokend, "cmd"))
&& !strcasecmp (tokend, "cmd"))
|| ((tokend - 4 == search_token
|| (tokend - 4 > search_token
&& (tokend[-5] == '/' || tokend[-5] == '\\')))
&& !strcmpi (tokend - 4, "cmd.exe"))) {
&& !strcasecmp (tokend - 4, "cmd.exe"))) {
batch_mode_shell = 1;
unixy_shell = 0;
sprintf (sh_path, "%s", search_token);

22
make.h
View File

@ -272,11 +272,10 @@ char *strsignal (int signum);
((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
# ifdef HAVE_CASE_INSENSITIVE_FS
/* This is only used on Windows/DOS platforms, so we assume strcmpi(). */
# define strieq(a, b) \
((a) == (b) \
|| (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \
&& (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
&& (*(a) == '\0' || !strcasecmp ((a) + 1, (b) + 1))))
# else
# define strieq(a, b) streq(a, b)
# endif
@ -286,9 +285,6 @@ char *strsignal (int signum);
# define strieq(a, b) (strcmp ((a), (b)) == 0)
#endif
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
#ifdef VMS
int strcmpi (const char *,const char *);
#endif
#if defined(__GNUC__) || defined(ENUM_BITFIELDS)
# define ENUM_BITFIELD(bits) :bits
@ -474,6 +470,17 @@ char *getwd ();
# define getcwd(buf, len) getwd (buf)
#endif
#if !HAVE_STRCASECMP
# if HAVE_STRICMP
# define strcasecmp stricmp
# elif HAVE_STRCMPI
# define strcasecmp strcmpi
# else
/* Create our own, in misc.c */
int strcasecmp (const char *s1, const char *s2);
# endif
#endif
extern const struct floc *reading_file;
extern const struct floc **expanding_var;
@ -542,12 +549,7 @@ extern int handling_fatal_signal;
# endif
#endif
#ifdef __EMX__
# if !HAVE_STRCASECMP
# define strcasecmp stricmp
# endif
# if !defined chdir
# define chdir _chdir2
# endif

27
misc.c
View File

@ -556,6 +556,33 @@ free_ns_chain (struct nameseq *ns)
}
}
#if !HAVE_STRCASECMP && !HAVE_STRICMP && !HAVE_STRCMPI
/* If we don't have strcasecmp() (from POSIX), or anything that can substitute
for it, define our own version. */
int
strcasecmp (const char *s1, const char *s2)
{
while (1)
{
int c1 = (int) *(s1++);
int c2 = (int) *(s2++);
if (isalpha (c1))
c1 = tolower (c1);
if (isalpha (c2))
c2 = tolower (c2);
if (c1 != '\0' && c1 == c2)
continue;
return (c1 - c2);
}
}
#endif
#ifdef GETLOADAVG_PRIVILEGED
#ifdef POSIX

View File

@ -257,15 +257,3 @@ cvt_time (unsigned long tval)
return (str);
}
int
strcmpi (const char *s1, const char *s2)
{
while (*s1 != '\0' && toupper(*s1) == toupper(*s2))
{
s1++;
s2++;
}
return toupper(*(unsigned char *) s1) - toupper(*(unsigned char *) s2);
}