mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 07:01:09 +00:00
Reverting index() fix, applying a different methodology, based upon developer discussions.
(related to issue #15639) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
5
configure
vendored
5
configure
vendored
@@ -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
|
||||
|
@@ -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(
|
||||
|
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -40,7 +40,6 @@
|
||||
getloadavg;
|
||||
strlcat;
|
||||
strlcpy;
|
||||
index;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user