Last night I found the problem for relative filenames in the config parser.

Starts about line 118 of conf_lexer.lxx:

                        // handle ${var} in file name
                        String ParsedFilename = \
                        config.ParseString(yytext);

                        yyin = fopen( ParsedFilename.get(), "r" );

The original code was:

             ParsedString        ps(value);
             String              str(ps.get(dict));
             if (str[0] != '/')          // Given file name not fully qualified
             {
                 str = filename;         // so strip dir. name from current one
                 len = str.lastIndexOf('/') + 1;
                 if (len > 0)
                     str.chop(str.length() - len);
                 else
                     str = "";           // No slash in current filename
                 str << ps.get(dict);
             }
             Read(str.get());

Now the first two lines and the last line of both of these 
correspond, but it's the rest of the code that's missing. But it was 
getting late, so I didn't have much time to think about how to 
implement the rest. My guess is we'll want to save the filename off 
the top of the stack before we throw it away and then we can pretty 
much just re-use the code. In other words:

at line 115:
                        include_stack[include_stack_ptr++] =
                            YY_CURRENT_BUFFER;

Here we grab include_stack[include_stack_ptr] *before* we increment 
the pointer and do our directory munging.

If someone gets to it, great. If not, I'll try to work on it tonight.

-Geoff

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] 
You will receive a message to confirm this. 


Reply via email to