Skip to content

Commit 727f9c3

Browse files
committed
fixed relative path problem
1 parent 4159515 commit 727f9c3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/main.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <thread>
88
#include <unistd.h>
99
#include <signal.h>
10+
#include <unistd.h>
1011

1112
#include "http_server.h"
1213

@@ -34,6 +35,12 @@ int main(int argc, char **argv)
3435

3536
case 'd':
3637
directory = optarg;
38+
if(!directory.empty())
39+
{
40+
char buf[PATH_MAX];
41+
realpath(directory.c_str(), buf);
42+
directory = buf;
43+
}
3744
break;
3845

3946
default: break;

0 commit comments

Comments
 (0)