aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-03 16:11:29 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-03 16:11:29 +0000
commit728babbe04baf27f4cc76f59c6414f8ab1798405 (patch)
treee6b6fa8fe67dec552e7e9161166da310d16188c3
parent2ffaec5b53773e415cbab6e20c45c75113f07406 (diff)
Reverting index() fix, applying a different methodology, based upon developer discussions.
(related to issue #15639) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@210066 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_playback.c8
-rw-r--r--channels/chan_oss.c2
-rwxr-xr-xconfigure5
-rw-r--r--configure.ac2
-rw-r--r--funcs/func_cut.c4
-rw-r--r--include/asterisk/autoconfig.h.in3
-rw-r--r--include/asterisk/compat.h4
-rw-r--r--main/asterisk.exports1
-rw-r--r--main/strcompat.c7
9 files changed, 10 insertions, 26 deletions
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 8f78bef78..6763bd917 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -207,13 +207,13 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
pbx_substitute_variables_varshead(&head, x, fn, sizeof(fn));
/* locate prefix and data, if any */
- fmt = index(fn, ':');
+ fmt = strchr(fn, ':');
if (!fmt || fmt == fn) { /* regular filename */
ret = s_streamwait3(a, fn);
continue;
}
fmt++;
- data = index(fmt, ':'); /* colon before data */
+ data = strchr(fmt, ':'); /* colon before data */
if (!data || data == fmt) { /* simple prefix-fmt */
ret = do_say(a, fn, options, depth);
continue;
@@ -226,14 +226,14 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
if (*p == '\'') {/* file name - we trim them */
char *y;
strcpy(fn2, ast_skip_blanks(p+1)); /* make a full copy */
- y = index(fn2, '\'');
+ y = strchr(fn2, '\'');
if (!y) {
p = data; /* invalid. prepare to end */
break;
}
*y = '\0';
ast_trim_blanks(fn2);
- p = index(p+1, '\'');
+ p = strchr(p + 1, '\'');
ret = s_streamwait3(a, fn2);
} else {
int l = fmt-fn;
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 73297f4ef..d3730eb48 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -1715,7 +1715,7 @@ static void store_mixer(struct chan_oss_pvt *o, char *s)
int i;
for (i = 0; i < strlen(s); i++) {
- if (!isalnum(s[i]) && index(" \t-/", s[i]) == NULL) {
+ if (!isalnum(s[i]) && strchr(" \t-/", s[i]) == NULL) {
ast_log(LOG_WARNING, "Suspect char %c in mixer cmd, ignoring:\n\t%s\n", s[i], s);
return;
}
diff --git a/configure b/configure
index c69a7b1df..51e75d214 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 190092 .
+# From configure.ac Revision: 210064 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.4.
#
@@ -14633,8 +14633,7 @@ done
-
-for ac_func in asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday index inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf ioperm
+for ac_func in asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf ioperm
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
diff --git a/configure.ac b/configure.ac
index 55def2607..48fbb72b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -273,7 +273,7 @@ AC_FUNC_STRNLEN
AC_FUNC_STRTOD
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday index inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf ioperm])
+AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf ioperm])
AC_MSG_CHECKING(for timersub in time.h)
AC_LINK_IFELSE(
diff --git a/funcs/func_cut.c b/funcs/func_cut.c
index 1bafbd669..66f464dd6 100644
--- a/funcs/func_cut.c
+++ b/funcs/func_cut.c
@@ -89,7 +89,7 @@ static int sort_internal(struct ast_channel *chan, char *data, char *buffer, siz
/* Parse each into a struct */
count2 = 0;
while ((ptrkey = strsep(&strings, "|"))) {
- ptrvalue = index(ptrkey, ':');
+ ptrvalue = strchr(ptrkey, ':');
if (!ptrvalue) {
count--;
continue;
@@ -191,7 +191,7 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size
/* Get to start, if any */
if (num1 > 0) {
while (tmp2 != (char *)NULL + 1 && curfieldnum < num1) {
- tmp2 = index(tmp2, d) + 1;
+ tmp2 = strchr(tmp2, d) + 1;
curfieldnum++;
}
}
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index 8f043b7b6..9fddef692 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -181,9 +181,6 @@
or greater. */
#undef HAVE_IMAP_TK2006
-/* Define to 1 if you have the `index' function. */
-#undef HAVE_INDEX
-
/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
diff --git a/include/asterisk/compat.h b/include/asterisk/compat.h
index f321665cd..d91ce4a1a 100644
--- a/include/asterisk/compat.h
+++ b/include/asterisk/compat.h
@@ -50,10 +50,6 @@ size_t strnlen(const char *, size_t);
char* strsep(char** str, const char* delims);
#endif
-#ifndef HAVE_INDEX
-char *index(const char *haystack, int needle);
-#endif
-
#ifndef HAVE_STRTOQ
uint64_t strtoq(const char *nptr, char **endptr, int base);
#endif
diff --git a/main/asterisk.exports b/main/asterisk.exports
index fa9b33192..b50350606 100644
--- a/main/asterisk.exports
+++ b/main/asterisk.exports
@@ -40,7 +40,6 @@
getloadavg;
strlcat;
strlcpy;
- index;
local:
*;
};
diff --git a/main/strcompat.c b/main/strcompat.c
index 52347db17..243ef76cb 100644
--- a/main/strcompat.c
+++ b/main/strcompat.c
@@ -84,13 +84,6 @@ int unsetenv(const char *name)
}
#endif
-#ifndef HAVE_INDEX
-char *index(const char *haystack, int needle)
-{
- return strchr(haystack, needle);
-}
-#endif
-
#ifndef HAVE_STRCASESTR
static char *upper(const char *orig, char *buf, int bufsize)
{