[svn-commits] tilghman: branch 1.4 r210066 - in /branches/1.4: ./ apps/ channels/ funcs/ in...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 3 11:11:34 CDT 2009


Author: tilghman
Date: Mon Aug  3 11:11:29 2009
New Revision: 210066

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=210066
Log:
Reverting index() fix, applying a different methodology, based upon developer discussions.
(related to issue #15639)

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

Modified: branches/1.4/apps/app_playback.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/apps/app_playback.c?view=diff&rev=210066&r1=210065&r2=210066
==============================================================================
--- branches/1.4/apps/app_playback.c (original)
+++ branches/1.4/apps/app_playback.c Mon Aug  3 11:11:29 2009
@@ -207,13 +207,13 @@
 		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 @@
 			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;

Modified: branches/1.4/channels/chan_oss.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/channels/chan_oss.c?view=diff&rev=210066&r1=210065&r2=210066
==============================================================================
--- branches/1.4/channels/chan_oss.c (original)
+++ branches/1.4/channels/chan_oss.c Mon Aug  3 11:11:29 2009
@@ -1715,7 +1715,7 @@
 	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;
 		}

Modified: branches/1.4/configure.ac
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/configure.ac?view=diff&rev=210066&r1=210065&r2=210066
==============================================================================
--- branches/1.4/configure.ac (original)
+++ branches/1.4/configure.ac Mon Aug  3 11:11:29 2009
@@ -273,7 +273,7 @@
 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(

Modified: branches/1.4/funcs/func_cut.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/funcs/func_cut.c?view=diff&rev=210066&r1=210065&r2=210066
==============================================================================
--- branches/1.4/funcs/func_cut.c (original)
+++ branches/1.4/funcs/func_cut.c Mon Aug  3 11:11:29 2009
@@ -89,7 +89,7 @@
 	/* 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 @@
 				/* 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++;
 					}
 				}

Modified: branches/1.4/include/asterisk/autoconfig.h.in
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/include/asterisk/autoconfig.h.in?view=diff&rev=210066&r1=210065&r2=210066
==============================================================================
--- branches/1.4/include/asterisk/autoconfig.h.in (original)
+++ branches/1.4/include/asterisk/autoconfig.h.in Mon Aug  3 11:11:29 2009
@@ -180,9 +180,6 @@
 /* Define if your system has the UW IMAP Toolkit c-client library version 2006
    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

Modified: branches/1.4/include/asterisk/compat.h
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/include/asterisk/compat.h?view=diff&rev=210066&r1=210065&r2=210066
==============================================================================
--- branches/1.4/include/asterisk/compat.h (original)
+++ branches/1.4/include/asterisk/compat.h Mon Aug  3 11:11:29 2009
@@ -48,10 +48,6 @@
 
 #ifndef HAVE_STRSEP
 char* strsep(char** str, const char* delims);
-#endif
-
-#ifndef HAVE_INDEX
-char *index(const char *haystack, int needle);
 #endif
 
 #ifndef HAVE_STRTOQ

Modified: branches/1.4/main/asterisk.exports
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/main/asterisk.exports?view=diff&rev=210066&r1=210065&r2=210066
==============================================================================
--- branches/1.4/main/asterisk.exports (original)
+++ branches/1.4/main/asterisk.exports Mon Aug  3 11:11:29 2009
@@ -40,7 +40,6 @@
 		getloadavg;
 		strlcat;
 		strlcpy;
-		index;
 	local:
 		*;
 };

Modified: branches/1.4/main/strcompat.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/main/strcompat.c?view=diff&rev=210066&r1=210065&r2=210066
==============================================================================
--- branches/1.4/main/strcompat.c (original)
+++ branches/1.4/main/strcompat.c Mon Aug  3 11:11:29 2009
@@ -81,13 +81,6 @@
 int unsetenv(const char *name)
 {
 	return setenv(name, "", 0);
-}
-#endif
-
-#ifndef HAVE_INDEX
-char *index(const char *haystack, int needle)
-{
-	return strchr(haystack, needle);
 }
 #endif
 




More information about the svn-commits mailing list