diff options
Diffstat (limited to 'src/url.lua')
| -rw-r--r-- | src/url.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/url.lua b/src/url.lua index 1bfecad..6ca6d68 100644 --- a/src/url.lua +++ b/src/url.lua | |||
| @@ -259,7 +259,7 @@ function parse_path(path) | |||
| 259 | path = path or "" | 259 | path = path or "" |
| 260 | --path = string.gsub(path, "%s", "") | 260 | --path = string.gsub(path, "%s", "") |
| 261 | string.gsub(path, "([^/]+)", function (s) table.insert(parsed, s) end) | 261 | string.gsub(path, "([^/]+)", function (s) table.insert(parsed, s) end) |
| 262 | for i = 1, table.getn(parsed) do | 262 | for i = 1, #parsed do |
| 263 | parsed[i] = unescape(parsed[i]) | 263 | parsed[i] = unescape(parsed[i]) |
| 264 | end | 264 | end |
| 265 | if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end | 265 | if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end |
| @@ -277,7 +277,7 @@ end | |||
| 277 | ----------------------------------------------------------------------------- | 277 | ----------------------------------------------------------------------------- |
| 278 | function build_path(parsed, unsafe) | 278 | function build_path(parsed, unsafe) |
| 279 | local path = "" | 279 | local path = "" |
| 280 | local n = table.getn(parsed) | 280 | local n = #parsed |
| 281 | if unsafe then | 281 | if unsafe then |
| 282 | for i = 1, n-1 do | 282 | for i = 1, n-1 do |
| 283 | path = path .. parsed[i] | 283 | path = path .. parsed[i] |
