make_squishy: Fix traceback when file doesn't contain any path component

Thu, 08 Jul 2010 01:11:40 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 08 Jul 2010 01:11:40 +0100
changeset 69
df181dcc02b7
parent 68
16d59655c817
child 70
0fd43db11abc

make_squishy: Fix traceback when file doesn't contain any path component

make_squishy file | annotate | diff | comparison | revisions
--- a/make_squishy	Thu Jul 08 01:11:12 2010 +0100
+++ b/make_squishy	Thu Jul 08 01:11:40 2010 +0100
@@ -61,7 +61,7 @@
 local LUA_DIRSEP = package.config:sub(1,1);
 local LUA_PATH_MARK = package.config:sub(5,5);
 
-local base_path = files[1]:match("^(.-)"..LUA_DIRSEP.."[^"..LUA_DIRSEP.."]*$").."/";
+local base_path = (files[1]:match("^(.-)"..LUA_DIRSEP.."[^"..LUA_DIRSEP.."]*$") or ".").."/";
 
 local package_path = package.path:gsub("[^;]+", function (path)
 		if not path:match("^%"..LUA_DIRSEP) then

mercurial