aboutsummaryrefslogtreecommitdiffstats
path: root/ast_expr.y
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 01:45:00 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 01:45:00 +0000
commita8bcf1cdd4fb282b31951144e6585cf3553f771d (patch)
treed2b50e7df9f4712e894f8ed42eb3f31f0249d497 /ast_expr.y
parent6a109e91355e6060e613f0ee881bbb301332ed30 (diff)
Update for backwards compatability (bug #1548)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2881 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'ast_expr.y')
-rwxr-xr-xast_expr.y35
1 files changed, 31 insertions, 4 deletions
diff --git a/ast_expr.y b/ast_expr.y
index 67b56fdd8..4f4bc2375 100755
--- a/ast_expr.y
+++ b/ast_expr.y
@@ -276,7 +276,9 @@ ast_yylex (YYSTYPE *lvalp, YYLTYPE *yylloc, struct parser_control *karoto)
{
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 @@ ast_yylex (YYSTYPE *lvalp, YYLTYPE *yylloc, struct parser_control *karoto)
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 @@ ast_yylex (YYSTYPE *lvalp, YYLTYPE *yylloc, struct parser_control *karoto)
}
lvalp->val = make_str (p);
+ if( savep )
+ {
+ *savepp = savep; /* restore the null terminated string */
+ savepp = 0;
+ savep = 0;
+ }
return (TOKEN);
}