summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-05-15 01:50:38 -0700
committerPhilipp Gesang <phg42.2a@gmail.com>2013-05-15 01:50:38 -0700
commit7b62f2c6a0b6251bcb5295b493a92b0724e85640 (patch)
tree215ae745273550ad485b69accaa7d88b54ce8816
parentab9631db57206d97f308e0fb9b16a7a25c00bc41 (diff)
parent614b92cfbea4cd9f3200ba839574b81b329e5f46 (diff)
downloadlualibs-7b62f2c6a0b6251bcb5295b493a92b0724e85640.tar.gz
Merge pull request #9 from phi-gamma/master
update
-rw-r--r--lualibs-file.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lualibs-file.lua b/lualibs-file.lua
index 29416ca..acb4216 100644
--- a/lualibs-file.lua
+++ b/lualibs-file.lua
@@ -153,7 +153,11 @@ function file.splitname(str,splitdrive)
end
function file.splitbase(str)
- return str and lpegmatch(pattern_d,str) -- returns path, base+suffix
+ if str then
+ return lpegmatch(pattern_d,str) -- returns path, base+suffix (path has / appended, might change at some point)
+ else
+ return "", str -- assume no path
+ end
end
---- stripslash = C((1 - P("/")^1*P(-1))^0)