diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mbox.lua | 4 | ||||
-rw-r--r-- | src/url.lua | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mbox.lua b/src/mbox.lua index b7d4a2a..35adf4e 100644 --- a/src/mbox.lua +++ b/src/mbox.lua | |||
@@ -34,7 +34,7 @@ end | |||
34 | function Public.parse_headers(headers_s) | 34 | function Public.parse_headers(headers_s) |
35 | local headers_t = Public.split_headers(headers_s) | 35 | local headers_t = Public.split_headers(headers_s) |
36 | local headers = {} | 36 | local headers = {} |
37 | for i = 1, table.getn(headers_t) do | 37 | for i = 1, #headers_t do |
38 | local name, value = Public.parse_header(headers_t[i]) | 38 | local name, value = Public.parse_header(headers_t[i]) |
39 | if name then | 39 | if name then |
40 | name = string.lower(name) | 40 | name = string.lower(name) |
@@ -74,7 +74,7 @@ end | |||
74 | 74 | ||
75 | function Public.parse(mbox_s) | 75 | function Public.parse(mbox_s) |
76 | local mbox = Public.split_mbox(mbox_s) | 76 | local mbox = Public.split_mbox(mbox_s) |
77 | for i = 1, table.getn(mbox) do | 77 | for i = 1, #mbox do |
78 | mbox[i] = Public.parse_message(mbox[i]) | 78 | mbox[i] = Public.parse_message(mbox[i]) |
79 | end | 79 | end |
80 | return mbox | 80 | return mbox |
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] |