diff --git a/ivlpp/lexor.lex b/ivlpp/lexor.lex index d862f4236..70cfd7b2a 100644 --- a/ivlpp/lexor.lex +++ b/ivlpp/lexor.lex @@ -50,7 +50,7 @@ static void do_expand(int use_args); static const char* do_magic(const char*name); static const char* macro_name(void); -static void include_filename(void); +static void include_filename(int macro_str); static void do_include(void); static int load_next_input(void); @@ -290,7 +290,8 @@ keywords (include|define|undef|ifdef|ifndef|else|elsif|endif) if (macro_needs_args(yytext+1)) yy_push_state(MA_START); else do_expand(0); } -\"[^\"]*\" { include_filename(); } +\"[^\"]*\" { include_filename(0); } /* A normal (") string */ +`\"[^\"]*`\" { include_filename(1); } /* A macro (`") string */ [ \t\b\f] { ; } @@ -1706,7 +1707,7 @@ static void output_init(void) } } -static void include_filename(void) +static void include_filename(int macro_str) { if(standby) { emit_pathline(istack); @@ -1717,8 +1718,8 @@ static void include_filename(void) } standby = malloc(sizeof(struct include_stack_t)); - standby->path = strdup(yytext+1); - standby->path[strlen(standby->path)-1] = 0; + standby->path = strdup(yytext+1+macro_str); + standby->path[strlen(standby->path)-1-macro_str] = 0; standby->lineno = 0; standby->comment = NULL; }