Mercurial > prosody-hg
comparison util/paths.lua @ 6505:2dc8dbd0940e
util.paths: Add function for joining path segments
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 08 Nov 2014 12:28:49 +0100 |
| parents | ef4024f6bc40 |
| children | 91085371cfc5 |
comparison
equal
deleted
inserted
replaced
| 6504:e1659f32852e | 6505:2dc8dbd0940e |
|---|---|
| 1 local t_concat = table.concat; | |
| 2 | |
| 1 local path_sep = package.config:sub(1,1); | 3 local path_sep = package.config:sub(1,1); |
| 2 | 4 |
| 3 local path_util = {} | 5 local path_util = {} |
| 4 | 6 |
| 5 -- Helper function to resolve relative paths (needed by config) | 7 -- Helper function to resolve relative paths (needed by config) |
| 33 return "%"..c; | 35 return "%"..c; |
| 34 end | 36 end |
| 35 end).."$"; | 37 end).."$"; |
| 36 end | 38 end |
| 37 | 39 |
| 40 function path_util.join(...) | |
| 41 return t_concat({...}, path_sep); | |
| 42 end | |
| 43 | |
| 38 return path_util; | 44 return path_util; |
