]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Reverting index() fix, applying a different methodology, based upon developer discuss...
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 3 Aug 2009 16:11:29 +0000 (16:11 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 3 Aug 2009 16:11:29 +0000 (16:11 +0000)
(related to issue #15639)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210066 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_playback.c
channels/chan_oss.c
configure
configure.ac
funcs/func_cut.c
include/asterisk/autoconfig.h.in
include/asterisk/compat.h
main/asterisk.exports
main/strcompat.c

index 8f78bef78618257b47b3f7ebebad8682d6f65861..6763bd917f50f7a6b29980f386228b2c48d049b6 100644 (file)
@@ -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;
index 73297f4efd27245865f963a935dc42c47d7c076f..d3730eb489a7e36f8667e960239c8e6fbf7d8b33 100644 (file)
@@ -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;
                }
index c69a7b1df5b6a692b4162d2f24805098c8b3ba2c..51e75d214aac57e8a613b9cfa693cc589e39e0a4 100755 (executable)
--- 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
index 55def26075ca7e87818cf779280cda935a5e221d..48fbb72b9c9739e7822887f9c586f5d68e81373c 100644 (file)
@@ -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(
index 1bafbd6695c18de5e1987967b6fa781d4175dffe..66f464dd6dc863e81d618ae464ceb7586c41c3bc 100644 (file)
@@ -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++;
                                        }
                                }
index 8f043b7b6e639d5fcf83d31080dfb7232903b9fa..9fddef692a4eabc02563bf3acb2601b1fcece39d 100644 (file)
    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
 
index f321665cd9571c8f232537731ece7a3aa155503e..d91ce4a1ac17784aab32d0aea1f66fedbd86618c 100644 (file)
@@ -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
index fa9b33192b62e44b9f7fa337cd80ba04985105b9..b50350606869b6c68f59483dae8b6161fe081072 100644 (file)
@@ -40,7 +40,6 @@
                getloadavg;
                strlcat;
                strlcpy;
-               index;
        local:
                *;
 };
index 52347db175ce2109c226c5f853d55e9fef9b0644..243ef76cb0292f70574c51d50c991bedd0fc7207 100644 (file)
@@ -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)
 {