summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2010-07-11 12:31:10 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2010-07-11 12:31:10 +0200
commit508797961304a60f7f09e84faea9dfcbbf26e1b0 (patch)
treea7afae1806df15d8550eac9b4ca067cbd9026bad
parent5f22dc4347ae9b12cf1fdccc2f62b3cdab47ce00 (diff)
downloademacs-508797961304a60f7f09e84faea9dfcbbf26e1b0.tar.gz
Use strchr, strrchr instead of index, rindex
* callint.c (Fcall_interactively): Use strchr, strrchr instead of index, rindex. * doc.c (get_doc_string, Fsnarf_documentation): Likewise. * editfns.c (Fuser_full_name, Fformat): Likewise. * emacs.c (argmatch, sort_args, decode_env_path): Likewise. * fileio.c (Ffile_symlink_p): Likewise. * filelock.c (current_lock_owner): Likewise. * font.c (font_parse_name, font_parse_family_registry): Likewise. * fontset.c (fontset_pattern_regexp): Likewise. * lread.c (read1): Likewise. * sysdep.c (init_system_name): Likewise. * xfns.c (select_visual): Likewise. * s/hpux10-20.h (index, rindex): Don't define. * s/ms-w32.h (index): Likewise. * s/usg5-4.h: Likewise. * sed2v2.inp (HAVE_INDEX, HAVE_RINDEX): Don't edit. (HAVE_STRCHR, HAVE_STRRCHR): Edit to 1. * emacsclient.c (set_local_socket): Use strchr, strrchr instead of index, rindex. * movemail.c (mail_spool_name, popmail): Likewise. * pop.c (pop_list): Likewise. * CPP-DEFINES (HAVE_INDEX, HAVE_RINDEX): Remove. * configure.in: Don't check for index and rindex, check for strchr and strrchr. Define strchr and strrchr as index and rindex, resp., in src/config.h if not available.
-rw-r--r--ChangeLog6
-rw-r--r--admin/CPP-DEFINES2
-rw-r--r--admin/ChangeLog4
-rwxr-xr-xconfigure417
-rw-r--r--configure.in10
-rw-r--r--lib-src/ChangeLog7
-rw-r--r--lib-src/emacsclient.c6
-rw-r--r--lib-src/movemail.c10
-rw-r--r--lib-src/pop.c4
-rw-r--r--msdos/ChangeLog5
-rw-r--r--msdos/sed2v2.inp4
-rw-r--r--src/ChangeLog16
-rw-r--r--src/callint.c12
-rw-r--r--src/config.in20
-rw-r--r--src/doc.c10
-rw-r--r--src/editfns.c10
-rw-r--r--src/emacs.c10
-rw-r--r--src/fileio.c4
-rw-r--r--src/filelock.c7
-rw-r--r--src/font.c6
-rw-r--r--src/fontset.c4
-rw-r--r--src/lread.c8
-rw-r--r--src/s/hpux10-20.h4
-rw-r--r--src/s/ms-w32.h2
-rw-r--r--src/s/usg5-4.h8
-rw-r--r--src/sysdep.c8
-rw-r--r--src/xfns.c2
27 files changed, 315 insertions, 291 deletions
diff --git a/ChangeLog b/ChangeLog
index 758ba0f29a2..ef939acaf2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * configure.in: Don't check for index and rindex, check for strchr
+ and strrchr. Define strchr and strrchr as index and rindex,
+ resp., in src/config.h if not available.
+
2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
* configure.in: Use -Wold-style-definition if available.
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index af818babb16..b647370a781 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -143,7 +143,6 @@ HAVE_GETPT
HAVE_GETTIMEOFDAY
HAVE_GETWD
HAVE_H_ERRNO
-HAVE_INDEX
HAVE_INET_SOCKETS
HAVE_INVERSE_HYPERBOLIC
HAVE_LIBKSTAT
@@ -162,7 +161,6 @@ HAVE_PWD_H
HAVE_RANDOM
HAVE_RENAME
HAVE_RES_INIT
-HAVE_RINDEX
HAVE_RINT
HAVE_RMDIR
HAVE_SELECT
diff --git a/admin/ChangeLog b/admin/ChangeLog
index d36e6979dc3..7a3104c9c40 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,7 @@
+2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * CPP-DEFINES (HAVE_INDEX, HAVE_RINDEX): Remove.
+
2010-07-08 Eli Zaretskii <eliz@gnu.org>
* MAINTAINERS: Update my responsibilities.
diff --git a/configure b/configure
index c430dec9ee2..0d3de7bd154 100755
--- a/configure
+++ b/configure
@@ -1,11 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for emacs 24.0.50.
+# Generated by GNU Autoconf 2.66 for emacs 24.0.50.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -316,7 +316,7 @@ $as_echo X"$as_dir" |
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -356,19 +356,19 @@ else
fi # as_fn_arith
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
- as_status=$?; test $as_status -eq 0 && as_status=1
- if test "$3"; then
- as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $1" >&2
+ $as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -530,7 +530,7 @@ test -n "$DJDIR" || exec 7<&0 </dev/null
exec 6>&1
# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
@@ -947,7 +947,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -973,7 +973,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1177,7 +1177,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1193,7 +1193,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1223,8 +1223,8 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information."
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
;;
*=*)
@@ -1232,7 +1232,7 @@ Try \`$0 --help' for more information."
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
@@ -1250,13 +1250,13 @@ done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error "missing argument to $ac_option"
+ as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
- fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1279,7 +1279,7 @@ do
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
- as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1293,8 +1293,8 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1309,9 +1309,9 @@ test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error "working directory cannot be determined"
+ as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error "pwd does not report name of working directory"
+ as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
@@ -1350,11 +1350,11 @@ else
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1394,7 +1394,7 @@ Configuration:
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
+ -q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
@@ -1610,9 +1610,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
emacs configure 24.0.50
-generated by GNU Autoconf 2.65
+generated by GNU Autoconf 2.66
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1752,10 +1752,10 @@ fi
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ if eval "test \"\${$3+set}\"" = set; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
@@ -1818,7 +1818,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
@@ -1882,7 +1882,7 @@ ac_fn_c_check_header_compile ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1904,15 +1904,18 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_header_compile
-# ac_fn_c_check_decl LINENO SYMBOL VAR
-# ------------------------------------
-# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
ac_fn_c_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1921,8 +1924,12 @@ $4
int
main ()
{
-#ifndef $2
- (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
#endif
;
@@ -1951,7 +1958,7 @@ ac_fn_c_check_header_preproc ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1981,7 +1988,7 @@ ac_fn_c_check_member ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
$as_echo_n "checking for $2.$3... " >&6; }
-if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$4+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2037,7 +2044,7 @@ ac_fn_c_check_func ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2105,7 +2112,7 @@ ac_fn_c_check_type ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
@@ -2154,7 +2161,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by emacs $as_me 24.0.50, which was
-generated by GNU Autoconf 2.65. Invocation command line was
+generated by GNU Autoconf 2.66. Invocation command line was
$ $0 $@
@@ -2264,11 +2271,9 @@ trap 'exit_status=$?
{
echo
- cat <<\_ASBOX
-## ---------------- ##
+ $as_echo "## ---------------- ##
## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
@@ -2302,11 +2307,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
)
echo
- cat <<\_ASBOX
-## ----------------- ##
+ $as_echo "## ----------------- ##
## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
@@ -2319,11 +2322,9 @@ _ASBOX
echo
if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
+ $as_echo "## ------------------- ##
## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
@@ -2337,11 +2338,9 @@ _ASBOX
fi
if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
+ $as_echo "## ----------- ##
## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
echo
cat confdefs.h
echo
@@ -2396,7 +2395,12 @@ _ACEOF
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- ac_site_file1=$CONFIG_SITE
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
@@ -2411,7 +2415,11 @@ do
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
fi
done
@@ -2492,7 +2500,7 @@ if $ac_cache_corrupted; then
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -2666,7 +2674,7 @@ if test "${with_x_toolkit+set}" = set; then :
g | gt | gtk ) val=gtk ;;
gtk3 ) val=gtk3 ;;
* )
-as_fn_error "\`--with-x-toolkit=$withval' is invalid;
+as_fn_error $? "\`--with-x-toolkit=$withval' is invalid;
this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or
\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
;;
@@ -2945,7 +2953,7 @@ do
stringfreelist) ac_gc_check_string_free_list=1 ;;
xmallocoverrun) ac_xmalloc_overrun=1 ;;
conslist) ac_gc_check_cons_list=1 ;;
- *) as_fn_error "unknown check category $check" "$LINENO" 5 ;;
+ *) as_fn_error $? "unknown check category $check" "$LINENO" 5 ;;
esac
done
IFS="$ac_save_IFS"
@@ -3061,16 +3069,22 @@ fi
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- for ac_t in install-sh install.sh shtool; do
- if test -f "$ac_dir/$ac_t"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/$ac_t -c"
- break 2
- fi
- done
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
done
if test -z "$ac_aux_dir"; then
- as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
@@ -3084,7 +3098,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
@@ -3095,16 +3109,16 @@ else
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
- as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
-*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
@@ -3129,7 +3143,7 @@ else
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
@@ -3137,7 +3151,7 @@ fi
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
-*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
@@ -3431,7 +3445,7 @@ fi
if test $unported = yes; then
- as_fn_error "Emacs hasn't been ported to \`${canonical}' systems.
+ as_fn_error $? "Emacs hasn't been ported to \`${canonical}' systems.
Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5
fi
@@ -3745,8 +3759,8 @@ fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "no acceptable C compiler found in \$PATH
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3860,9 +3874,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ as_fn_set_status 77
-as_fn_error "C compiler cannot create executables
-See \`config.log' for more details." "$LINENO" 5; }; }
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -3904,8 +3917,8 @@ done
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3962,9 +3975,9 @@ $as_echo "$ac_try_echo"; } >&5
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
+as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
@@ -4015,8 +4028,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
@@ -4435,8 +4448,8 @@ if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
fi
ac_ext=c
@@ -4497,7 +4510,7 @@ esac
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
- as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
@@ -4563,7 +4576,7 @@ esac
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
- as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
@@ -4695,8 +4708,7 @@ do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -4992,8 +5004,8 @@ if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
fi
ac_ext=c
@@ -5430,7 +5442,7 @@ if test "$MAKEINFO" = "no"; then
if test "x${with_makeinfo}" = "xno"; then
MAKEINFO=off
elif test ! -e $srcdir/info/emacs; then
- as_fn_error "You do not seem to have makeinfo >= 4.6, and your
+ as_fn_error $? "You do not seem to have makeinfo >= 4.6, and your
source tree does not seem to have pre-built manuals in the \`info' directory.
Either install a suitable version of makeinfo, or re-run configure
with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5
@@ -5606,7 +5618,7 @@ fi
if test "x$GCC" = "xyes"; then
C_SWITCH_MACHINE="-fno-common"
else
- as_fn_error "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5
+ as_fn_error $? "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5
fi
else
UNEXEC_OBJ=unexalpha.o
@@ -5884,7 +5896,7 @@ else
## Some platforms don't use any of these files, so it is not
## appropriate to put this test outside the if block.
test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
- as_fn_error "crt*.o not found in specified location." "$LINENO" 5
+ as_fn_error $? "crt*.o not found in specified location." "$LINENO" 5
fi
@@ -5939,8 +5951,7 @@ if test "${with_sound}" != "no"; then
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -6131,7 +6142,7 @@ else
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$emacs_alsa_subdir" != yes; then
- as_fn_error "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5
+ as_fn_error $? "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5
fi
ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
fi
@@ -6166,8 +6177,7 @@ for ac_header in sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -7009,7 +7019,7 @@ fi
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
@@ -7017,7 +7027,7 @@ SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -7153,7 +7163,7 @@ if test "x$with_x" = xno; then
have_x=disabled
else
case $x_includes,$x_libraries in #(
- *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #(
+ *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
*,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
$as_echo_n "(cached) " >&6
else
@@ -7171,7 +7181,7 @@ libdir:
@echo libdir='${LIBDIR}'
_ACEOF
if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
- # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+ # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
for ac_var in incroot usrlibdir libdir; do
eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
done
@@ -7441,7 +7451,7 @@ if test "${with_ns}" != no; then
if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then :
HAVE_NS=yes
else
- as_fn_error "\`--with-ns' was specified, but the include
+ as_fn_error $? "\`--with-ns' was specified, but the include
files are missing or cannot be compiled." "$LINENO" 5
fi
@@ -7557,7 +7567,7 @@ fi
if test "$HAVE_XSERVER" = true ||
test -n "$DISPLAY" ||
test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
- as_fn_error "You seem to be running X, but no X development libraries
+ as_fn_error $? "You seem to be running X, but no X development libraries
were found. You should install the relevant development files for X
and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make
sure you have development files for image handling, i.e.
@@ -7680,8 +7690,7 @@ do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -7787,6 +7796,7 @@ int
main ()
{
char *data, *data2, *data3;
+ const char *cdata2;
int i, pagesize;
int fd, fd2;
@@ -7811,10 +7821,10 @@ main ()
fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
if (fd2 < 0)
return 4;
- data2 = "";
- if (write (fd2, data2, 1) != 1)
+ cdata2 = "";
+ if (write (fd2, cdata2, 1) != 1)
return 5;
- data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+ data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
if (data2 == MAP_FAILED)
return 6;
for (i = 0; i < pagesize; ++i)
@@ -8186,8 +8196,7 @@ XScreenNumberOfScreen XSetWMProtocols
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -8468,7 +8477,7 @@ $as_echo "no" >&6; }
fi
if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
- as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
+ as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5
fi
fi
@@ -8574,7 +8583,7 @@ $as_echo "no" >&6; }
fi
if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
- as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
+ as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5
fi
fi
fi
@@ -8601,7 +8610,7 @@ done
if test "${GTK_COMPILES}" != "yes"; then
if test "$USE_X_TOOLKIT" != "maybe"; then
- as_fn_error "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5;
+ as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5;
fi
else
HAVE_GTK=yes
@@ -8731,8 +8740,7 @@ $as_echo "#define HAVE_GTK_AND_PTHREAD 1" >>confdefs.h
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -9097,7 +9105,7 @@ $as_echo "yes; using Lucid toolkit" >&6; }
USE_X_TOOLKIT=LUCID
LUCID_LIBW=-lXaw
elif test x"${USE_X_TOOLKIT}" = xLUCID; then
- as_fn_error "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
+ as_fn_error $? "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5
$as_echo "no; do not use toolkit by default" >&6; }
@@ -10274,8 +10282,7 @@ if test "${HAVE_X11}" = "yes"; then
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -10527,7 +10534,7 @@ if test "${HAVE_X11}" = "yes"; then
MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
if test "X${MISSING}" != X; then
- as_fn_error "The following required libraries were not found:
+ as_fn_error $? "The following required libraries were not found:
$MISSING
Maybe some development libraries/packages are missing?
If you don't want to link with them give
@@ -10862,8 +10869,7 @@ if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
@@ -10927,7 +10933,7 @@ fi
if test x"$ac_cv_func_alloca_works" != xyes; then
- as_fn_error "a system implementation of alloca is required " "$LINENO" 5
+ as_fn_error $? "a system implementation of alloca is required " "$LINENO" 5
fi
# fmod, logb, and frexp are found in -lm on most systems.
@@ -11123,7 +11129,7 @@ fi
if test $ac_cv_prog_liblockfile = yes; then
- as_fn_error "Shared liblockfile found but can't link against it.
+ as_fn_error $? "Shared liblockfile found but can't link against it.
This probably means that movemail could lose mail.
There may be a \`development' package to install containing liblockfile." "$LINENO" 5
fi
@@ -11204,7 +11210,7 @@ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
random lrand48 logb frexp fmod rint cbrt ftime setsid \
strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \
-__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
+__fpending mblen mbrlen mbsinit strsignal setitimer ualarm strchr strrchr \
sendto recvfrom getsockopt setsockopt getsockname getpeername \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync \
memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
@@ -11212,8 +11218,7 @@ cfmakeraw cfsetspeed isnan copysign
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -11244,8 +11249,7 @@ done
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -11297,8 +11301,8 @@ static time_t time_t_max;
static time_t time_t_min;
/* Values we'll use to set the TZ environment variable. */
-static char *tz_strings[] = {
- (char *) 0, "TZ=GMT0", "TZ=JST-9",
+static const char *tz_strings[] = {
+ (const char *) 0, "TZ=GMT0", "TZ=JST-9",
"TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
};
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
@@ -11315,7 +11319,7 @@ spring_forward_gap ()
instead of "TZ=America/Vancouver" in order to detect the bug even
on systems that don't support the Olson extension, or don't have the
full zoneinfo tables installed. */
- putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
tm.tm_year = 98;
tm.tm_mon = 3;
@@ -11328,16 +11332,14 @@ spring_forward_gap ()
}
static int
-mktime_test1 (now)
- time_t now;
+mktime_test1 (time_t now)
{
struct tm *lt;
return ! (lt = localtime (&now)) || mktime (lt) == now;
}
static int
-mktime_test (now)
- time_t now;
+mktime_test (time_t now)
{
return (mktime_test1 (now)
&& mktime_test1 ((time_t) (time_t_max - now))
@@ -11361,8 +11363,7 @@ irix_6_4_bug ()
}
static int
-bigtime_test (j)
- int j;
+bigtime_test (int j)
{
struct tm tm;
time_t now;
@@ -11406,7 +11407,7 @@ year_2050_test ()
instead of "TZ=America/Vancouver" in order to detect the bug even
on systems that don't support the Olson extension, or don't have the
full zoneinfo tables installed. */
- putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
t = mktime (&tm);
@@ -11441,7 +11442,7 @@ main ()
for (i = 0; i < N_STRINGS; i++)
{
if (tz_strings[i])
- putenv (tz_strings[i]);
+ putenv ((char*) tz_strings[i]);
for (t = 0; t <= time_t_max - delta; t += delta)
if (! mktime_test (t))
@@ -11493,7 +11494,7 @@ ac_have_func=no # yes means we've found a way to get the load average.
# Make sure getloadavg.c is where it belongs, at configure-time.
test -f "$srcdir/$ac_config_libobj_dir/getloadavg.c" ||
- as_fn_error "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5
+ as_fn_error $? "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5
ac_save_LIBS=$LIBS
@@ -12362,7 +12363,7 @@ else
fi
if test "$have_tputs_et_al" != true; then
- as_fn_error "I couldn't find termcap functions (tputs and friends).
+ as_fn_error $? "I couldn't find termcap functions (tputs and friends).
Maybe some development libraries/packages are missing? Try installing
libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5
fi
@@ -13509,8 +13510,7 @@ for ac_func in fork vfork
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -13884,14 +13884,14 @@ if test "x$GCC" = xyes \
&& test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
&& test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
&& test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
- as_fn_error "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
+ as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
fi
#### Find out which version of Emacs this is.
version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
| sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
if test x"${version}" = x; then
- as_fn_error "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5
+ as_fn_error $? "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5
fi
if test x"${version}" != x"$PACKAGE_VERSION"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&5
@@ -14452,6 +14452,7 @@ DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
+U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -14613,19 +14614,19 @@ export LANGUAGE
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
- as_status=$?; test $as_status -eq 0 && as_status=1
- if test "$3"; then
- as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $1" >&2
+ $as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -14821,7 +14822,7 @@ $as_echo X"$as_dir" |
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -14875,7 +14876,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by emacs $as_me 24.0.50, which was
-generated by GNU Autoconf 2.65. Invocation command line was
+generated by GNU Autoconf 2.66. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -14941,10 +14942,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
emacs config.status 24.0.50
-configured by $0, generated by GNU Autoconf 2.65,
+configured by $0, generated by GNU Autoconf 2.66,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -14998,7 +14999,7 @@ do
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
- as_fn_error "ambiguous option: \`$1'
+ as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
@@ -15007,7 +15008,7 @@ Try \`$0 --help' for more information.";;
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error "unrecognized option: \`$1'
+ -*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
@@ -15075,7 +15076,7 @@ do
"leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;;
"default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
- *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -15113,7 +15114,7 @@ $debug ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
-} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
@@ -15147,7 +15148,7 @@ if test "x$ac_cr" = x; then
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\r'
+ ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
@@ -15164,7 +15165,7 @@ _ACEOF
echo "_ACEOF"
} >conf$$files.sh &&
. ./conf$$files.sh ||
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
rm -f conf$$files.sh
{
@@ -15172,18 +15173,18 @@ rm -f conf$$files.sh
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
@@ -15278,20 +15279,28 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
else
cat
fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
- || as_fn_error "could not setup config files machinery" "$LINENO" 5
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
s/^[^=]*=[ ]*$//
}'
fi
@@ -15319,7 +15328,7 @@ for ac_last_try in false false :; do
if test -z "$ac_t"; then
break
elif $ac_last_try; then
- as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
@@ -15404,7 +15413,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error "could not setup config headers machinery" "$LINENO" 5
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"
@@ -15417,7 +15426,7 @@ do
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -15445,7 +15454,7 @@ do
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
@@ -15472,7 +15481,7 @@ $as_echo "$as_me: creating $ac_file" >&6;}
case $ac_tag in
*:-:* | *:-) cat >"$tmp/stdin" \
- || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -15608,22 +15617,22 @@ if $ac_cs_awk_getline; then
else
$AWK -f "$tmp/subs.awk" | $SHELL
fi >$tmp/out \
- || as_fn_error "could not create $ac_file" "$LINENO" 5
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
+which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
+which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$tmp/stdin"
case $ac_file in
-) cat "$tmp/out" && rm -f "$tmp/out";;
*) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
esac \
- || as_fn_error "could not create $ac_file" "$LINENO" 5
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
:H)
#
@@ -15634,19 +15643,19 @@ which seems to be undefined. Please make sure it is defined." >&2;}
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
} >"$tmp/config.h" \
- || as_fn_error "could not create $ac_file" "$LINENO" 5
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$tmp/config.h" "$ac_file" \
- || as_fn_error "could not create $ac_file" "$LINENO" 5
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error "could not create -" "$LINENO" 5
+ || as_fn_error $? "could not create -" "$LINENO" 5
fi
;;
@@ -15683,7 +15692,7 @@ _ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
- as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
@@ -15704,7 +15713,7 @@ if test "$no_create" != yes; then
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit $?
+ $ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
diff --git a/configure.in b/configure.in
index aee62c0e11d..0f0cb8f6a3f 100644
--- a/configure.in
+++ b/configure.in
@@ -2635,7 +2635,7 @@ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
random lrand48 logb frexp fmod rint cbrt ftime setsid \
strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \
-__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
+__fpending mblen mbrlen mbsinit strsignal setitimer ualarm strchr strrchr \
sendto recvfrom getsockopt setsockopt getsockname getpeername \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync \
memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
@@ -3601,6 +3601,14 @@ void *alloca (size_t);
typedef unsigned size_t;
#endif
+#ifndef HAVE_STRCHR
+#define strchr(a, b) index (a, b)
+#endif
+
+#ifndef HAVE_STRRCHR
+#define strrchr(a, b) rindex (a, b)
+#endif
+
#if defined __GNUC__ && (__GNUC__ > 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
#define NO_RETURN __attribute__ ((__noreturn__))
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 125e0df4817..d0410f4c080 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * emacsclient.c (set_local_socket): Use strchr, strrchr instead of
+ index, rindex.
+ * movemail.c (mail_spool_name, popmail): Likewise.
+ * pop.c (pop_list): Likewise.
+
2010-07-11 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in (obj): Add menu.o, bidi.o, w32uniscrobe.o,
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index cb8a4ebcaf8..79143ff7a34 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1234,8 +1234,10 @@ set_local_socket (void)
char *server_name = "server";
char *tmpdir;
- if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\'))
- { /* socket_name is a file name component. */
+ if (socket_name && !strchr (socket_name, '/')
+ && !strchr (socket_name, '\\'))
+ {
+ /* socket_name is a file name component. */
server_name = socket_name;
socket_name = NULL;
default_sock = 1; /* Try both UIDs. */
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index dfa4a92d057..541edf545df 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -146,12 +146,6 @@ static char *mail_spool_name ();
#ifndef HAVE_STRERROR
char *strerror (int);
#endif
-#ifdef HAVE_INDEX
-extern char *index (const char *, int);
-#endif
-#ifdef HAVE_RINDEX
-extern char *rindex (const char *, int);
-#endif
static void fatal (char *s1, char *s2, char *s3);
static void error (char *s1, char *s2, char *s3);
@@ -564,7 +558,7 @@ mail_spool_name (inname)
char *indir, *fname;
int status;
- if (! (fname = rindex (inname, '/')))
+ if (! (fname = strrchr (inname, '/')))
return NULL;
fname++;
@@ -714,7 +708,7 @@ popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse
char *user, *hostname;
user = mailbox;
- if ((hostname = index(mailbox, ':')))
+ if ((hostname = strchr (mailbox, ':')))
*hostname++ = '\0';
server = pop_open (hostname, user, password, POP_NO_GETPASS);
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 9eaefa4cb83..26a992fa0b0 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -465,7 +465,7 @@ pop_list (popserver server, int message, int **IDs, int **sizes)
return (-1);
}
(*IDs)[0] = atoi (&fromserver[4]);
- fromserver = index (&fromserver[4], ' ');
+ fromserver = strchr (&fromserver[4], ' ');
if (! fromserver)
{
strcpy (pop_error,
@@ -496,7 +496,7 @@ pop_list (popserver server, int message, int **IDs, int **sizes)
return (-1);
}
(*IDs)[i] = atoi (fromserver);
- fromserver = index (fromserver, ' ');
+ fromserver = strchr (fromserver, ' ');
if (! fromserver)
{
strcpy (pop_error,
diff --git a/msdos/ChangeLog b/msdos/ChangeLog
index d50c3dc9cc0..ad62a740fa8 100644
--- a/msdos/ChangeLog
+++ b/msdos/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sed2v2.inp (HAVE_INDEX, HAVE_RINDEX): Don't edit.
+ (HAVE_STRCHR, HAVE_STRRCHR): Edit to 1.
+
2010-07-08 Eli Zaretskii <eliz@gnu.org>
* sed1v2.inp (stamp-oldxmenu): Don't edit out in `temacs:' target,
diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp
index a802202d9c4..e1f007f1bab 100644
--- a/msdos/sed2v2.inp
+++ b/msdos/sed2v2.inp
@@ -46,9 +46,9 @@
/^#undef HAVE_TM_GMTOFF *$/s/^.*$/#define HAVE_TM_GMTOFF 1/
/^#undef HAVE_MBLEN *$/s/^.*$/#define HAVE_MBLEN 1/
/^#undef HAVE_STRUCT_TIMEZONE *$/s/^.*$/#define HAVE_STRUCT_TIMEZONE 1/
-/^#undef HAVE_INDEX *$/s/^.*$/#define HAVE_INDEX 1/
+/^#undef HAVE_STRCHR *$/s/^.*$/#define HAVE_STRCHR 1/
/^#undef HAVE_SIZE_T *$/s/^.*$/#define HAVE_SIZE_T 1/
-/^#undef HAVE_RINDEX *$/s/^.*$/#define HAVE_RINDEX 1/
+/^#undef HAVE_STRRCHR *$/s/^.*$/#define HAVE_STRRCHR 1/
/^#undef HAVE_MKSTEMP *$/s/^.*$/#define HAVE_MKSTEMP 1/
/^#undef HAVE_STRUCT_TM_TM_ZONE *$/s/^.*$/#define HAVE_STRUCT_TM_TM_ZONE 1/
/^#undef HAVE_SYNC *$/s/^.*$/#define HAVE_SYNC 1/
diff --git a/src/ChangeLog b/src/ChangeLog
index 89eb486b8bf..fd8de7553e3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,21 @@
2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
+ * callint.c (Fcall_interactively): Use strchr, strrchr instead of
+ index, rindex.
+ * doc.c (get_doc_string, Fsnarf_documentation): Likewise.
+ * editfns.c (Fuser_full_name, Fformat): Likewise.
+ * emacs.c (argmatch, sort_args, decode_env_path): Likewise.
+ * fileio.c (Ffile_symlink_p): Likewise.
+ * filelock.c (current_lock_owner): Likewise.
+ * font.c (font_parse_name, font_parse_family_registry): Likewise.
+ * fontset.c (fontset_pattern_regexp): Likewise.
+ * lread.c (read1): Likewise.
+ * sysdep.c (init_system_name): Likewise.
+ * xfns.c (select_visual): Likewise.
+ * s/hpux10-20.h (index, rindex): Don't define.
+ * s/ms-w32.h (index): Likewise.
+ * s/usg5-4.h: Likewise.
+
* callproc.c (relocate_fd): Use F_DUPFD if defined.
* alloc.c (pending_malloc_warning, malloc_warning): Add const.
diff --git a/src/callint.c b/src/callint.c
index 3d4782e7bd6..fa0be112bea 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -29,10 +29,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "window.h"
#include "keymap.h"
-#ifdef HAVE_INDEX
-extern char *index (const char *, int);
-#endif
-
extern Lisp_Object Qcursor_in_echo_area;
extern Lisp_Object Qfile_directory_p;
extern Lisp_Object Qonly;
@@ -469,7 +465,7 @@ invoke it. If KEYS is omitted or nil, the return value of
j += 2;
else
j++;
- tem = (unsigned char *) index (tem, '\n');
+ tem = (unsigned char *) strchr (tem, '\n');
if (tem)
++tem;
else
@@ -500,11 +496,11 @@ invoke it. If KEYS is omitted or nil, the return value of
{
strncpy (prompt1, tem + 1, sizeof prompt1 - 1);
prompt1[sizeof prompt1 - 1] = 0;
- tem1 = (char *) index (prompt1, '\n');
+ tem1 = strchr (prompt1, '\n');
if (tem1) *tem1 = 0;
visargs[0] = build_string (prompt1);
- if (index (prompt1, '%'))
+ if (strchr (prompt1, '%'))
callint_message = Fformat (i, visargs);
else
callint_message = visargs[0];
@@ -809,7 +805,7 @@ invoke it. If KEYS is omitted or nil, the return value of
if (NILP (visargs[i]) && STRINGP (args[i]))
visargs[i] = args[i];
- tem = (unsigned char *) index (tem, '\n');
+ tem = (unsigned char *) strchr (tem, '\n');
if (tem) tem++;
else tem = (unsigned char *) "";
}
diff --git a/src/config.in b/src/config.in
index 1ef407c158b..40b62633446 100644
--- a/src/config.in
+++ b/src/config.in
@@ -288,9 +288,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if netdb.h declares h_errno. */
#undef HAVE_H_ERRNO
-/* Define to 1 if you have the `index' function. */
-#undef HAVE_INDEX
-
/* Define to 1 if you have inet sockets. */
#undef HAVE_INET_SOCKETS
@@ -537,9 +534,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if res_init is available. */
#undef HAVE_RES_INIT
-/* Define to 1 if you have the `rindex' function. */
-#undef HAVE_RINDEX
-
/* Define to 1 if you have the `rint' function. */
#undef HAVE_RINT
@@ -597,6 +591,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
@@ -609,6 +606,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
/* Define to 1 if you have the `strsignal' function. */
#undef HAVE_STRSIGNAL
@@ -1154,6 +1154,14 @@ void *alloca (size_t);
typedef unsigned size_t;
#endif
+#ifndef HAVE_STRCHR
+#define strchr(a, b) index (a, b)
+#endif
+
+#ifndef HAVE_STRRCHR
+#define strrchr(a, b) rindex (a, b)
+#endif
+
#if defined __GNUC__ && (__GNUC__ > 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
#define NO_RETURN __attribute__ ((__noreturn__))
diff --git a/src/doc.c b/src/doc.c
index a8f6217c4ce..fc3cbc1c215 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -45,10 +45,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "keymap.h"
#include "buildobj.h"
-#ifdef HAVE_INDEX
-extern char *index (const char *, int);
-#endif
-
Lisp_Object Vdoc_file_name;
Lisp_Object Qfunction_documentation;
@@ -218,9 +214,9 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
if (!nread)
break;
if (p == get_doc_string_buffer)
- p1 = (char *) index (p + offset, '\037');
+ p1 = strchr (p + offset, '\037');
else
- p1 = (char *) index (p, '\037');
+ p1 = strchr (p, '\037');
if (p1)
{
*p1 = 0;
@@ -633,7 +629,7 @@ the same file name is found in the `doc-directory'. */)
/* p points to ^_Ffunctionname\n or ^_Vvarname\n. */
if (p != end)
{
- end = (char *) index (p, '\n');
+ end = strchr (p, '\n');
/* See if this is a file name, and if it is a file in build-files. */
if (p[1] == 'S' && end - p > 4 && end[-2] == '.'
diff --git a/src/editfns.c b/src/editfns.c
index 93ae5647b04..2d8fcb6c85b 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -109,10 +109,6 @@ static Lisp_Object subst_char_in_region_unwind (Lisp_Object);
static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object);
static void transpose_markers (int, int, int, int, int, int, int, int);
-#ifdef HAVE_INDEX
-extern char *index (const char *, int);
-#endif
-
Lisp_Object Vbuffer_access_fontify_functions;
Lisp_Object Qbuffer_access_fontify_functions;
Lisp_Object Vbuffer_access_fontified_property;
@@ -1369,12 +1365,12 @@ name, or nil if there is no such user. */)
p = (unsigned char *) USER_FULL_NAME;
/* Chop off everything after the first comma. */
- q = (unsigned char *) index (p, ',');
+ q = (unsigned char *) strchr (p, ',');
full = make_string (p, q ? q - p : strlen (p));
#ifdef AMPERSAND_FULL_NAME
p = SDATA (full);
- q = (unsigned char *) index (p, '&');
+ q = (unsigned char *) strchr (p, '&');
/* Substitute the login name for the &, upcasing the first character. */
if (q)
{
@@ -3813,7 +3809,7 @@ usage: (format STRING &rest OBJECTS) */)
discarded[format - format_start] = 1;
format++;
- while (index ("-+0# ", *format))
+ while (strchr ("-+0# ", *format))
{
if (*format == '-')
{
diff --git a/src/emacs.c b/src/emacs.c
index 180b2276f4c..e00c49b8d24 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -90,10 +90,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
const char emacs_version[] = "24.0.50";
-#ifdef HAVE_INDEX
-extern char *index (const char *, int);
-#endif
-
/* Make these values available in GDB, which doesn't see macros. */
#ifdef USE_LSB_TAG
@@ -662,7 +658,7 @@ argmatch (char **argv, int argc, char *sstr, char *lstr, int minlen, char **valp
*skipptr += 1;
return 1;
}
- arglen = (valptr != NULL && (p = index (arg, '=')) != NULL
+ arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL
? p - arg : strlen (arg));
if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0)
return 0;
@@ -1974,7 +1970,7 @@ sort_args (int argc, char **argv)
{
match = -1;
thislen = strlen (argv[from]);
- equals = index (argv[from], '=');
+ equals = strchr (argv[from], '=');
if (equals != 0)
thislen = equals - argv[from];
@@ -2369,7 +2365,7 @@ decode_env_path (const char *evarname, const char *defalt)
lpath = Qnil;
while (1)
{
- p = index (path, SEPCHAR);
+ p = strchr (path, SEPCHAR);
if (!p)
p = path + strlen (path);
element = (p - path ? make_string (path, p - path)
diff --git a/src/fileio.c b/src/fileio.c
index 7c0921a0e39..c942803e280 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1455,7 +1455,7 @@ See also the function `substitute-in-file-name'.")
/* Get past ~ to user */
unsigned char *user = nm + 1;
/* Find end of name. */
- unsigned char *ptr = (unsigned char *) index (user, '/');
+ unsigned char *ptr = (unsigned char *) strchr (user, '/');
int len = ptr ? ptr - user : strlen (user);
/* Copy the user name into temp storage. */
o = (unsigned char *) alloca (len + 1);
@@ -2729,7 +2729,7 @@ points to a nonexistent file. */)
while (valsize >= bufsize);
val = make_string (buf, valsize);
- if (buf[0] == '/' && index (buf, ':'))
+ if (buf[0] == '/' && strchr (buf, ':'))
val = concat2 (build_string ("/:"), val);
xfree (buf);
val = DECODE_FILE (val);
diff --git a/src/filelock.c b/src/filelock.c
index 8eb6060e531..c3f1bfde292 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -413,9 +413,6 @@ within_one_second (time_t a, time_t b)
static int
current_lock_owner (lock_info_type *owner, char *lfname)
{
-#ifndef index
- extern char *rindex (const char *, int), *index (const char *, int);
-#endif
int len, ret;
int local_owner = 0;
char *at, *dot, *colon;
@@ -457,8 +454,8 @@ current_lock_owner (lock_info_type *owner, char *lfname)
/* Parse USER@HOST.PID:BOOT_TIME. If can't parse, return -1. */
/* The USER is everything before the last @. */
- at = rindex (lfinfo, '@');
- dot = rindex (lfinfo, '.');
+ at = strrchr (lfinfo, '@');
+ dot = strrchr (lfinfo, '.');
if (!at || !dot)
{
xfree (lfinfo);
diff --git a/src/font.c b/src/font.c
index 42a61a5eccd..cb92074df91 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1815,7 +1815,7 @@ font_unparse_gtkname (Lisp_Object font, struct frame *f, char *name, int nbytes)
static int
font_parse_name (char *name, Lisp_Object font)
{
- if (name[0] == '-' || index (name, '*') || index (name, '?'))
+ if (name[0] == '-' || strchr (name, '*') || strchr (name, '?'))
return font_parse_xlfd (name, font);
return font_parse_fcname (name, font);
}
@@ -1837,7 +1837,7 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec
CHECK_STRING (family);
len = SBYTES (family);
p0 = (char *) SDATA (family);
- p1 = index (p0, '-');
+ p1 = strchr (p0, '-');
if (p1)
{
if ((*p0 != '*' && p1 - p0 > 0)
@@ -1856,7 +1856,7 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec
CHECK_STRING (registry);
len = SBYTES (registry);
p0 = (char *) SDATA (registry);
- p1 = index (p0, '-');
+ p1 = strchr (p0, '-');
if (! p1)
{
if (SDATA (registry)[len - 1] == '*')
diff --git a/src/fontset.c b/src/fontset.c
index 676e96fd88c..9a27fc3e36b 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1065,8 +1065,8 @@ static Lisp_Object Vcached_fontset_data;
static Lisp_Object
fontset_pattern_regexp (Lisp_Object pattern)
{
- if (!index ((char *) SDATA (pattern), '*')
- && !index ((char *) SDATA (pattern), '?'))
+ if (!strchr ((char *) SDATA (pattern), '*')
+ && !strchr ((char *) SDATA (pattern), '?'))
/* PATTERN does not contain any wild cards. */
return Qnil;
diff --git a/src/lread.c b/src/lread.c
index b9e47e3fccf..79214936f4c 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2725,7 +2725,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
ok = (next_next_char <= 040
|| (next_next_char < 0200
- && (index ("\"';([#?", next_next_char)
+ && (strchr ("\"';([#?", next_next_char)
|| (!first_in_list && next_next_char == '`')
|| (new_backquote_flag && next_next_char == ','))));
}
@@ -2733,7 +2733,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
{
ok = (next_char <= 040
|| (next_char < 0200
- && (index ("\"';()[]#?", next_char)
+ && (strchr ("\"';()[]#?", next_char)
|| (!first_in_list && next_char == '`')
|| (new_backquote_flag && next_char == ','))));
}
@@ -2878,7 +2878,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
if (next_char <= 040
|| (next_char < 0200
- && (index ("\"';([#?", next_char)
+ && (strchr ("\"';([#?", next_char)
|| (!first_in_list && next_char == '`')
|| (new_backquote_flag && next_char == ','))))
{
@@ -2905,7 +2905,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
while (c > 040
&& c != 0x8a0 /* NBSP */
&& (c >= 0200
- || (!index ("\"';()[]#", c)
+ || (!strchr ("\"';()[]#", c)
&& !(!first_in_list && c == '`')
&& !(new_backquote_flag && c == ','))))
{
diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h
index dd0e1bea9ad..ee841041edb 100644
--- a/src/s/hpux10-20.h
+++ b/src/s/hpux10-20.h
@@ -146,9 +146,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* No underscore please. */
#define LDAV_SYMBOL "avenrun"
-/* On USG systems these have different names. */
-#define index strchr
-#define rindex strrchr
-
/* arch-tag: 8d8dcbf1-ca9b-48a1-94be-b750de18a5c6
(do not change this comment) */
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index df9929f6823..a87e22b338c 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -274,8 +274,6 @@ typedef int pid_t;
#define pclose _pclose
#define umask _umask
#define utimbuf _utimbuf
-#define index strchr
-#define rindex strrchr
#define strdup _strdup
#define strupr _strupr
#define strnicmp _strnicmp
diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h
index e667ffdc106..b92a5bbb450 100644
--- a/src/s/usg5-4.h
+++ b/src/s/usg5-4.h
@@ -50,14 +50,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define _setjmp setjmp
#define _longjmp longjmp
-/* On USG systems these have different names. */
-#ifndef HAVE_INDEX
-#define index strchr
-#endif /* ! defined (HAVE_INDEX) */
-#ifndef HAVE_RINDEX
-#define rindex strrchr
-#endif /* ! defined (HAVE_RINDEX) */
-
/* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */
#define HAVE_SYSV_SIGPAUSE
diff --git a/src/sysdep.c b/src/sysdep.c
index daca9d12510..e45664a8bd6 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1555,7 +1555,7 @@ init_system_name (void)
#ifndef CANNOT_DUMP
if (initialized)
#endif /* not CANNOT_DUMP */
- if (! index (hostname, '.'))
+ if (! strchr (hostname, '.'))
{
int count;
#ifdef HAVE_GETADDRINFO
@@ -1584,7 +1584,7 @@ init_system_name (void)
while (it)
{
char *fqdn = it->ai_canonname;
- if (fqdn && index (fqdn, '.')
+ if (fqdn && strchr (fqdn, '.')
&& strcmp (fqdn, "localhost.localdomain") != 0)
break;
it = it->ai_next;
@@ -1620,13 +1620,13 @@ init_system_name (void)
{
char *fqdn = (char *) hp->h_name;
- if (!index (fqdn, '.'))
+ if (!strchr (fqdn, '.'))
{
/* We still don't have a fully qualified domain name.
Try to find one in the list of alternate names */
char **alias = hp->h_aliases;
while (*alias
- && (!index (*alias, '.')
+ && (!strchr (*alias, '.')
|| !strcmp (*alias, "localhost.localdomain")))
alias++;
if (*alias)
diff --git a/src/xfns.c b/src/xfns.c
index 988725ead00..5a96598eaee 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4005,7 +4005,7 @@ select_visual (struct x_display_info *dpyinfo)
XVisualInfo vinfo;
strcpy (s, SDATA (value));
- dash = index (s, '-');
+ dash = strchr (s, '-');
if (dash)
{
dpyinfo->n_planes = atoi (dash + 1);