]> git.plutz.net Git - clickslide/commitdiff
honour treeroot variable in file serving
authorpaul <paul@plutz.net>
Tue, 17 Jan 2017 13:02:25 +0000 (13:02 +0000)
committerpaul <paul@plutz.net>
Tue, 17 Jan 2017 13:02:25 +0000 (13:02 +0000)
svn path=/trunk/; revision=52

server.sh

index f8760696dd4f75bf5cfdcdac1439899e0b77e298..c49c0d8e7f1fd1039eb147a283499c6e6aa037d3 100755 (executable)
--- a/server.sh
+++ b/server.sh
@@ -94,6 +94,6 @@ HTTP_format(){
 if [ -z "$QUERY_STRING" ]; then
   PATH_INFO="$(printf "$(printf %s "$PATH_INFO" |sed 's:+: :g;s:\\:\\\\:g;s:%:\\x:g')")"
   PATH_INFO="$(invalidate "${PATH_INFO}" '(^|.*/)\.\./.*' '')"
-  [ -f "$_DATA/$PATH_INFO" ] && . "$_EXEC/shcgi/static.sh" "$_DATA/$PATH_INFO"
+  [ -f "${treeroot:-${_DATA}}/$PATH_INFO" ] && . "$_EXEC/shcgi/static.sh" "${treeroot:-${_DATA}}/$PATH_INFO"
   exit 0
 fi |HTTP_format