summary refs log tree commit diff
path: root/hittpd.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-05-07 23:07:07 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-05-07 23:07:07 +0200
commit50d7d7a469b0ee1d28d430a931348e827ac112a1 (patch)
treee35c78ab46e41249ee2312e49811be18d9aa8e51 /hittpd.c
parent18ab2d687f6b84513ddd7b3038d23b77e77ea8a8 (diff)
downloadhittpd-50d7d7a469b0ee1d28d430a931348e827ac112a1.tar.gz
hittpd-50d7d7a469b0ee1d28d430a931348e827ac112a1.tar.xz
hittpd-50d7d7a469b0ee1d28d430a931348e827ac112a1.zip
make wwwroot configurable
Diffstat (limited to 'hittpd.c')
-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;