- started to build the expresion & acion tree/list
[sip-router] / cfg.lex
diff --git a/cfg.lex b/cfg.lex
index d31c2b2..6581c69 100644 (file)
--- a/cfg.lex
+++ b/cfg.lex
@@ -149,19 +149,19 @@ EAT_ABLE  [\ \t\b\r]
                                                addstr(yytext, &str);
                                                if (str){
                                                        printf("Found string1 <%s>\n", str);
-                                                       yyleng=strlen(str)+1;
-                                                       memcpy(yytext, str, yyleng);
-                                                       free(str);
-                                                       str=0;
                                                }else{
                                                        printf("WARNING: empty string\n");
                                                }
-                                               yylval.strval=yytext; return STRING;
+                                               yylval.strval=str; str=0;
+                                               return STRING;
                                        }
 <STRING2>{TICK}  { count(); state=INITIAL_S; BEGIN(INITIAL); 
                                                yytext[yyleng-1]=0; yyleng--;
                                                printf("Found string1 <%s>\n", yytext);
-                                               yylval.strval=yytext; return STRING;
+                                               addstr(yytext, &str);
+                                               yylval.strval=str;
+                                               str=0;
+                                               return STRING;
                                        }
 <STRING2>.|{EAT_ABLE}|{CR}     { yymore(); }