Skip to content

Commit

Permalink
Fixes issue #256. If config path in envvar is not absolute, make it so.
Browse files Browse the repository at this point in the history
  • Loading branch information
crass committed Sep 1, 2018
1 parent eb36238 commit ce4c710
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/common.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "common.h"
#include "debug.h"
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
Expand Down Expand Up @@ -94,5 +95,11 @@ char *get_config_path(char* default_path, char* pbuf, size_t bufsize) {

return NULL;
have:
if(path[0] != '/') {
path = realpath(path, NULL);
setenv(PROXYCHAINS_CONF_FILE_ENV_VAR, path, 1);
free(path);
path = getenv(PROXYCHAINS_CONF_FILE_ENV_VAR);
}
return path;
}

0 comments on commit ce4c710

Please sign in to comment.