+local function simplify_path(path)
+ local npath=string.gsub(path, "([^/]+)/+%.%./+", "")
+ if npath~=path then
+ return simplify_path(npath)
+ else
+ return string.gsub(string.gsub(path, "([^/]+)/+%.%.$", ""), "/+", "/")
+ end
+end
+
+local function relative_path(path)
+ return not string.find(path, "^/")
+end
+
+local function empty_path(path)
+ return (not path or path=="")
+end
+