 |
Changeset 3948
- Timestamp:
- 10/01/08 01:45:56
(2 months ago)
- Author:
- kris
- Message:
fixes #1161 :: tango.net.Uri handles relative paths incorrectly
Thanks Ralith
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3681 |
r3948 |
|
| 601 | 601 | char c; |
|---|
| 602 | 602 | int i, |
|---|
| 603 | | mark, |
|---|
| 604 | | len = uri.length; |
|---|
| | 603 | mark; |
|---|
| | 604 | auto prefix = path; |
|---|
| | 605 | auto len = uri.length; |
|---|
| 605 | 606 | |
|---|
| 606 | 607 | reset; |
|---|
| … | … | |
| 625 | 626 | if (relative && uri[0] != '/') |
|---|
| 626 | 627 | { |
|---|
| 627 | | uri = toLastSlash(path) ~ uri; |
|---|
| | 628 | uri = toLastSlash(prefix) ~ uri; |
|---|
| 628 | 629 | query = fragment = null; |
|---|
| 629 | 630 | len = uri.length; |
|---|
| … | … | |
| 823 | 824 | private final char[] toLastSlash (char[] path) |
|---|
| 824 | 825 | { |
|---|
| 825 | | for (char*p = path.ptr+path.length; --p >= path.ptr;) |
|---|
| 826 | | if (*p is '/') |
|---|
| 827 | | return path [0 .. (p-path.ptr)+1]; |
|---|
| | 826 | if (path.ptr) |
|---|
| | 827 | for (auto p = path.ptr+path.length; --p >= path.ptr;) |
|---|
| | 828 | if (*p is '/') |
|---|
| | 829 | return path [0 .. (p-path.ptr)+1]; |
|---|
| 828 | 830 | return path; |
|---|
| 829 | 831 | } |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic