/* a non-word constituent char, like a space, tab, curly, paren, etc */
char c = yytext[yyleng-1];
STORE_POS;
- yylval->str = strdup(yytext);
- yylval->str[yyleng-1] = 0;
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
unput(c); /* put this ending char back in the stream */
BEGIN(0);
prev_word = yylval->str;
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
parencount2--;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
parencount3--;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
prev_word = 0;
return word;
}
yymore();
} else {
STORE_LOC;
- yylval->str = strdup(yytext);
- yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
unput(')');
BEGIN(0);
return word;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
BEGIN(0);
if ( !strcmp(yytext, ")") )
return RP;
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
unput(')');
return word;
}
<argg>{NOARGG}\, {
- if( parencount != 0) { /* printf("Folding in a comma!\n"); */
+ if( parencount != 0) { /* ast_log(LOG_NOTICE,"Folding in a comma!\n"); */
yymore();
} else {
STORE_LOC;
if( !strcmp(yytext,"," ) )
return COMMA;
- yylval->str = strdup(yytext);
- yylval->str[yyleng-1] = '\0';
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
unput(',');
return word;
}
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
<semic>{NOSEMIC}; {
STORE_LOC;
- yylval->str = strdup(yytext);
- yylval->str[yyleng-1] = '\0';
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
unput(';');
BEGIN(0);
return word;
/* a non-word constituent char, like a space, tab, curly, paren, etc */
char c = yytext[yyleng-1];
STORE_POS;
- yylval->str = strdup(yytext);
- yylval->str[yyleng-1] = 0;
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
unput(c); /* put this ending char back in the stream */
BEGIN(0);
prev_word = yylval->str;
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
parencount2--;
case 57:
/* rule 57 can match eol */
YY_RULE_SETUP
-#line 329 "ael.flex"
+#line 330 "ael.flex"
{
char c = yytext[yyleng-1];
if (c == '{')
case 58:
/* rule 58 can match eol */
YY_RULE_SETUP
-#line 337 "ael.flex"
+#line 338 "ael.flex"
{
char c = yytext[yyleng-1];
if ( pbcpop2(c)) { /* error */
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
case 59:
/* rule 59 can match eol */
YY_RULE_SETUP
-#line 351 "ael.flex"
+#line 353 "ael.flex"
{
if ( pbcpop3(']') ) { /* error */
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
parencount3--;
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
-#line 368 "ael.flex"
+#line 371 "ael.flex"
{
char c = yytext[yyleng-1];
if (c == '[')
case 61:
/* rule 61 can match eol */
YY_RULE_SETUP
-#line 376 "ael.flex"
+#line 379 "ael.flex"
{
char c = yytext[yyleng-1];
if ( pbcpop3(c)) { /* error */
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
case 62:
/* rule 62 can match eol */
YY_RULE_SETUP
-#line 397 "ael.flex"
+#line 401 "ael.flex"
{
if ( pbcpop(')') ) { /* error */
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
prev_word = 0;
return word;
}
yymore();
} else {
STORE_LOC;
- yylval->str = strdup(yytext);
- yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
unput(')');
BEGIN(0);
return word;
case 63:
/* rule 63 can match eol */
YY_RULE_SETUP
-#line 419 "ael.flex"
+#line 424 "ael.flex"
{
char c = yytext[yyleng-1];
if (c == '(')
case 64:
/* rule 64 can match eol */
YY_RULE_SETUP
-#line 427 "ael.flex"
+#line 432 "ael.flex"
{
char c = yytext[yyleng-1];
if ( pbcpop(c)) { /* error */
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
case 65:
/* rule 65 can match eol */
YY_RULE_SETUP
-#line 449 "ael.flex"
+#line 455 "ael.flex"
{
char c = yytext[yyleng-1];
if (c == '(')
case 66:
/* rule 66 can match eol */
YY_RULE_SETUP
-#line 457 "ael.flex"
+#line 463 "ael.flex"
{
if ( pbcpop(')') ) { /* error */
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
BEGIN(0);
if ( !strcmp(yytext, ")") )
return RP;
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
unput(')');
return word;
case 67:
/* rule 67 can match eol */
YY_RULE_SETUP
-#line 481 "ael.flex"
+#line 489 "ael.flex"
{
- if( parencount != 0) { /* printf("Folding in a comma!\n"); */
+ if( parencount != 0) { /* ast_log(LOG_NOTICE,"Folding in a comma!\n"); */
yymore();
} else {
STORE_LOC;
if( !strcmp(yytext,"," ) )
return COMMA;
- yylval->str = strdup(yytext);
- yylval->str[yyleng-1] = '\0';
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
unput(',');
return word;
}
case 68:
/* rule 68 can match eol */
YY_RULE_SETUP
-#line 495 "ael.flex"
+#line 503 "ael.flex"
{
char c = yytext[yyleng-1];
if ( pbcpop(c) ) { /* error */
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
case 69:
/* rule 69 can match eol */
YY_RULE_SETUP
-#line 512 "ael.flex"
+#line 521 "ael.flex"
{
char c = yytext[yyleng-1];
yymore();
case 70:
/* rule 70 can match eol */
YY_RULE_SETUP
-#line 518 "ael.flex"
+#line 527 "ael.flex"
{
char c = yytext[yyleng-1];
if ( pbcpop(c) ) { /* error */
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = strdup(yytext);
+ yylval->str = ast_malloc(yyleng+1);
+ ast_copy_string(yylval->str, yytext, yyleng+1);
return word;
}
yymore();
case 71:
/* rule 71 can match eol */
YY_RULE_SETUP
-#line 530 "ael.flex"
+#line 540 "ael.flex"
{
STORE_LOC;
- yylval->str = strdup(yytext);
- yylval->str[yyleng-1] = '\0';
+ yylval->str = ast_malloc(yyleng);
+ ast_copy_string(yylval->str, yytext, yyleng);
unput(';');
BEGIN(0);
return word;
case 72:
/* rule 72 can match eol */
YY_RULE_SETUP
-#line 539 "ael.flex"
+#line 549 "ael.flex"
{
char fnamebuf[1024],*p1,*p2;
int glob_ret;
case YY_STATE_EOF(curlystate):
case YY_STATE_EOF(wordstate):
case YY_STATE_EOF(brackstate):
-#line 580 "ael.flex"
+#line 590 "ael.flex"
{
char fnamebuf[2048];
if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 612 "ael.flex"
+#line 622 "ael.flex"
ECHO;
YY_BREAK
-#line 1991 "ael_lex.c"
+#line 2001 "ael_lex.c"
case YY_END_OF_BUFFER:
{
#define YYTABLES_NAME "yytables"
-#line 612 "ael.flex"
+#line 622 "ael.flex"