diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/url.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/url.lua b/src/url.lua index 466d4fa..0a3a80a 100644 --- a/src/url.lua +++ b/src/url.lua | |||
@@ -83,9 +83,10 @@ end | |||
83 | -- Returns | 83 | -- Returns |
84 | -- dot-normalized path | 84 | -- dot-normalized path |
85 | local function remove_dot_components(path) | 85 | local function remove_dot_components(path) |
86 | local marker = string.char(1) | ||
86 | repeat | 87 | repeat |
87 | local was = path | 88 | local was = path |
88 | path = path:gsub('//', '/'..0x00..'/', 1) | 89 | path = path:gsub('//', '/'..marker..'/', 1) |
89 | until path == was | 90 | until path == was |
90 | repeat | 91 | repeat |
91 | local was = path | 92 | local was = path |
@@ -99,7 +100,7 @@ local function remove_dot_components(path) | |||
99 | path = path:gsub('/%.%.$', '/') | 100 | path = path:gsub('/%.%.$', '/') |
100 | path = path:gsub('/%.$', '/') | 101 | path = path:gsub('/%.$', '/') |
101 | path = path:gsub('^/%.%./', '/') | 102 | path = path:gsub('^/%.%./', '/') |
102 | path = path:gsub(0x00, '') | 103 | path = path:gsub(marker, '') |
103 | return path | 104 | return path |
104 | end | 105 | end |
105 | 106 | ||