[asterisk-commits] tilghman: branch 1.6.0 r118301 - in /branches/1.6.0: ./ pbx/pbx_realtime.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 27 08:14:36 CDT 2008


Author: tilghman
Date: Tue May 27 08:14:35 2008
New Revision: 118301

URL: http://svn.digium.com/view/asterisk?view=rev&rev=118301
Log:
Merged revisions 118300 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r118300 | tilghman | 2008-05-27 08:13:17 -0500 (Tue, 27 May 2008) | 4 lines

In compat14 mode, don't translate pipes inside expressions, as they aren't
argument delimiters, but rather 'or' symbols.
(Closes issue #12723)

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/pbx/pbx_realtime.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/pbx/pbx_realtime.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/pbx/pbx_realtime.c?view=diff&rev=118301&r1=118300&r2=118301
==============================================================================
--- branches/1.6.0/pbx/pbx_realtime.c (original)
+++ branches/1.6.0/pbx/pbx_realtime.c Tue May 27 08:14:35 2008
@@ -181,17 +181,26 @@
 			else if (!strcasecmp(v->name, "appdata")) {
 				if (!compat16) {
 					char *ptr;
+					int in = 0;
 					tmp = alloca(strlen(v->value) * 2 + 1);
 					for (ptr = tmp; *v->value; v->value++) {
 						if (*v->value == ',') {
 							*ptr++ = '\\';
 							*ptr++ = ',';
-						} else if (*v->value == '|') {
+						} else if (*v->value == '|' && !in) {
 							*ptr++ = ',';
 						} else {
 							*ptr++ = *v->value;
 						}
+
+						/* Don't escape '|', meaning 'or', inside expressions ($[ ]) */
+						if (v->value[0] == '[' && v->value[-1] == '$') {
+							in++;
+						} else if (v->value[0] == ']' && in) {
+							in--;
+						}
 					}
+					*ptr = '\0';
 				} else {
 					tmp = ast_strdupa(v->value);
 				}




More information about the asterisk-commits mailing list