Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#178 Incomplete design of 'maps' feature

Browsing (93)

Release 0.9.9 and earlier
lxr.conf 'maps' is a great device to select a file among many directories based on the value of variables. It works fine when clicking on a link e.g. in an #include. You are warped directly to the desired file. But if you want to compare this file to another one using "diff", LXR is confused about the second target file, because it is unable to correctly generate the path to the second file: it uses the transformed path of the first file, then tries to apply 'maps' and very often discovers that the file designated by this multiple processed path does not exist.

How can we circumvent that? Comments and advice wanted.

There is an incomplete implementation of something (what? it is lost in time) in httpinit: a parameter named 'file' seems to be "reserved". Could it be used to keep the original path? The function mappath would then be applied in httpinit and the result used as the target file.
I have not yet thought about it, nor determined the exact circumstances under which the aforementioned error occurs. At least, I know of it in diff.

Before going ahead, I would appreciate collecting events where it has caused trouble.


  • Andre-Littoz

    • assigned_to: nobody --> ajlittoz
    • milestone: --> current_cvs
    • status: open --> closed-fixed
  • Andre-Littoz

    State transition between LXR invocation has been clarified.

    Target file designation is done through the 'variables', namely, 'v, eventually 'a' and others.
    State starting point is stored in arguments whose names start with '_' (so that they are not confused with 'variables').
    _file argument contains the non-mapped file path (only for #include files since this is the only place where mappath is applied).
    If the desired file version needs 'variables' changes, the changed variable names are prefixed with '$', e.g. $v.

    When a query string is received with _file and optional $variables, _file and $variables are combined to select a file after mappath substitution. If that selection succeeds, this file will override the content of $pathname which was initialised with the usual target file.

    With such an algorithm, successive 'variables' changes will always result in the correct file being selected, even revert to the initial file after many changes.

    This algorithm involves many changes in include processing, initialisation, link management, ... but globally involves few lines of code.