aboutsummaryrefslogtreecommitdiff
path: root/src/url.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2002-12-03 07:20:34 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2002-12-03 07:20:34 +0000
commit7da19138e37c4e0123860f1fecbceb80c3d2627d (patch)
tree8453f003a9ba212807d9c9590c2f2b850d323f0f /src/url.lua
parentd7e80592a69c076991ed4f4cc15d5390e14d1f0b (diff)
downloadluasocket-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.lua6
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
149end 149end
150 150
@@ -214,7 +214,7 @@ end
214-- corresponding absolute path 214-- corresponding absolute path
215----------------------------------------------------------------------------- 215-----------------------------------------------------------------------------
216function Private.absolute_path(base_path, relative_path) 216function 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)