From 614b92cfbea4cd9f3200ba839574b81b329e5f46 Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg42.2a@gmail.com>
Date: Wed, 15 May 2013 10:48:04 +0200
Subject: sync with Context as of 2013-05-15

---
 lualibs-file.lua | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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)
-- 
cgit v1.2.3