I think I got your point:

All in all this is still a matter of comparing the first against the
current url and counting the common dirs from the left side.
Then you compare that number(a) to the depth of the first url(b) and add
 b-a "../" so you get to the right position inside your base.

By that way if you call "wget -r --base=/somedir /server/otherdir/" a
later reference to /server/otherdir/ is correctly found as duplicate of
the first one.

I first thought of a different solution... like appending
initial-depth-times ".." to base. I admit this is silly.

Now i think this could result in different problems like what schould
happen with "wget -r --base=/home/matthias/tmp
http://server/with/a/complicated/structure/and/to/many/dirs/a.php";

If you now have a link to "/index.html" you would try to access some
file above / or am I wrong?

Greeting

Matthias

Reply via email to