diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2002-12-03 07:20:34 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2002-12-03 07:20:34 +0000 |
commit | 7da19138e37c4e0123860f1fecbceb80c3d2627d (patch) | |
tree | 8453f003a9ba212807d9c9590c2f2b850d323f0f /src/url.lua | |
parent | d7e80592a69c076991ed4f4cc15d5390e14d1f0b (diff) | |
download | luasocket-7da19138e37c4e0123860f1fecbceb80c3d2627d.tar.gz luasocket-7da19138e37c4e0123860f1fecbceb80c3d2627d.tar.bz2 luasocket-7da19138e37c4e0123860f1fecbceb80c3d2627d.zip |
Faltam testes de ftp e smtp. O resto passa.
Diffstat (limited to 'src/url.lua')
-rw-r--r-- | src/url.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/url.lua b/src/url.lua index 0ecec3c..4d2bfa7 100644 --- a/src/url.lua +++ b/src/url.lua | |||
@@ -143,8 +143,8 @@ function Public.parse_path(path) | |||
143 | for i = 1, table.getn(parsed) do | 143 | for i = 1, table.getn(parsed) do |
144 | parsed[i] = Code.unescape(parsed[i]) | 144 | parsed[i] = Code.unescape(parsed[i]) |
145 | end | 145 | end |
146 | if stringsub(path, 1, 1) == "/" then parsed.is_absolute = 1 end | 146 | if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end |
147 | if stringsub(path, -1, -1) == "/" then parsed.is_directory = 1 end | 147 | if string.sub(path, -1, -1) == "/" then parsed.is_directory = 1 end |
148 | return parsed | 148 | return parsed |
149 | end | 149 | end |
150 | 150 | ||
@@ -214,7 +214,7 @@ end | |||
214 | -- corresponding absolute path | 214 | -- corresponding absolute path |
215 | ----------------------------------------------------------------------------- | 215 | ----------------------------------------------------------------------------- |
216 | function Private.absolute_path(base_path, relative_path) | 216 | function Private.absolute_path(base_path, relative_path) |
217 | if stringsub(relative_path, 1, 1) == "/" then return relative_path end | 217 | if string.sub(relative_path, 1, 1) == "/" then return relative_path end |
218 | local path = string.gsub(base_path, "[^/]*$", "") | 218 | local path = string.gsub(base_path, "[^/]*$", "") |
219 | path = path .. relative_path | 219 | path = path .. relative_path |
220 | path = string.gsub(path, "([^/]*%./)", function (s) | 220 | path = string.gsub(path, "([^/]*%./)", function (s) |