[Asterisk-cvs] asterisk ast_expr.y,1.4,1.5
markster at lists.digium.com
markster at lists.digium.com
Mon May 3 21:36:55 CDT 2004
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv24967
Modified Files:
ast_expr.y
Log Message:
Update for backwards compatability (bug #1548)
Index: ast_expr.y
===================================================================
RCS file: /usr/cvsroot/asterisk/ast_expr.y,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ast_expr.y 2 May 2004 04:09:35 -0000 1.4
+++ ast_expr.y 4 May 2004 01:45:00 -0000 1.5
@@ -276,7 +276,9 @@
{
char *p=0;
char *t1=0;
-
+ char savep = 0;
+ char *savepp = 0;
+
if (karoto->firsttoken==1) {
t1 = karoto->argv;
karoto->firsttoken = 0;
@@ -306,9 +308,28 @@
t2++;
if( *t2 == '"' )
{
- *t2 = 0;
- karoto->ptrptr = t2+1;
- p = t1+1;
+ if( *(t2+1) == ' ' || *(t2+1) == 0 )
+ {
+ if( *(t2+1) )
+ {
+ *(t2+1) = 0;
+ karoto->ptrptr = t2+2;
+ }
+ else
+ {
+ karoto->ptrptr = t2+1;
+ }
+ }
+ else
+ {
+ /* hmmm. what if another token is here? */
+ /* maybe we can insert a space? */
+ savep = *(t2+1);
+ savepp = t2+1;
+ *(t2+1) = 0;
+ karoto->ptrptr = t2+1;
+ }
+ p = t1;
}
else
{
@@ -344,6 +365,12 @@
}
lvalp->val = make_str (p);
+ if( savep )
+ {
+ *savepp = savep; /* restore the null terminated string */
+ savepp = 0;
+ savep = 0;
+ }
return (TOKEN);
}
More information about the svn-commits
mailing list