diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-02-05 05:48:58 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-02-05 05:48:58 +0000 |
commit | 44e9d09144ef132e88f019224c61f3c9f943957d (patch) | |
tree | f2b0ba5421fadf87276cc72a8c97e7aa0d1df314 /websvcs | |
parent | bac42e137b04f40bad31f3b84d4c6d983e9f9e8b (diff) | |
download | ATCD-44e9d09144ef132e88f019224c61f3c9f943957d.tar.gz |
ChangeLogTag:Thu Feb 4 23:11:26 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'websvcs')
-rw-r--r-- | websvcs/lib/URL_Addr.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/websvcs/lib/URL_Addr.cpp b/websvcs/lib/URL_Addr.cpp index 439e4d130c2..19054c3a601 100644 --- a/websvcs/lib/URL_Addr.cpp +++ b/websvcs/lib/URL_Addr.cpp @@ -327,13 +327,15 @@ path_copy (LPCTSTR begin, switch (c) { case '/': - if (*(src + 1) == '.' - && (*src + 2) == '.' - && (*src + 3) == '/') + if (src[1] == '.' && src[2] == '.' && url[3] == '/') { while (target != begin && *(--target) != '/'); src += 3; } + else if (src[1] == '.' && src[2] == '/') + { + src += 2; + } else { *target = c; @@ -396,10 +398,20 @@ ACE_HTTP_Addr::create_relative_address (LPCTSTR url) const // Go back to the last / to remove the basename. while (target != buf && *(--target) != '/'); // Go back if we begin with '../' - while (url[0] == '.' && url[1] == '.' && url[2] == '/') + while ((url[0] == '.' && url[1] == '.' && url[2] == '/') + || (url[0] == '.' && url[1] == '/')) { - while (target != buf && *(--target) != '/'); - url += 3; + if (url[1] == '.') + { + // A ../ go back + while (target != buf && *(--target) != '/'); + url += 3; + } + else + { + // A ./ remove + url += 2; + } } *target = '/'; ++target; |