summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--hittpd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hittpd.c b/hittpd.c
index f2e2062..4c9ac4f 100644
--- a/hittpd.c
+++ b/hittpd.c
@@ -78,10 +78,10 @@ char mimetypes[] =
     ":.txt=text/plain";
 
 char default_mimetype[] = "text/plain";   // "application/octet-stream"
-
-char wwwroot[] = "/tmp";
+char default_wwwroot[] = "/var/www";
 char default_vhost[] = "_default";
 
+char *wwwroot = default_wwwroot;
 int tilde = 0;
 int vhost = 0;
 int quiet = 0;
@@ -849,6 +849,9 @@ main(int argc, char *argv[])
                         exit(1);
 		}
 
+	if (argc > optind)
+		wwwroot = argv[optind];
+
 	int i, maxi, listenfd, sockfd;
 	int nready;
 	int r = 0;