This is a very simple request, and should be pretty easy to implement, but could vpnns use the XDG Base Directory Specification for where it puts its state files? I think it would be as simple as replacing getenv("HOME") in
|
if (asprintf(&statedir, "%s/.vpnns-%s", getenv("HOME"), name) < 0) |
with
char* state_home = getenv("XDG_STATE_HOME");
if (!state_home || strlen(state_home) == 0) {
state_home = getenv("HOME");
strncat(state_home, "/.local/state",
sizeof(state_home) - strlen(state_home) - 1);
}
if (asprintf(&statedir, "%s/.vpnns-%s", getenv("HOME"), name) < 0)
Note that this might be improved as I haven't really done any serious projects in C before, but this takes into account the cases where the variable is set to the empty string as well.
This is a very simple request, and should be pretty easy to implement, but could
vpnnsuse the XDG Base Directory Specification for where it puts its state files? I think it would be as simple as replacinggetenv("HOME")inocproxy/src/vpnns.c
Line 842 in c98f06d
with
Note that this might be improved as I haven't really done any serious projects in C before, but this takes into account the cases where the variable is set to the empty string as well.