commit 3c680bddab146e8c8ccf5eba1fec7e1ee978d638 from: Omar Polo date: Tue Feb 02 09:30:24 2021 UTC configless: fixing the case of the implicit "." I got bitten by the scope visibility rules. After the end of the block, the path variable is no longer valid, and in fact later load_vhosts fails to open that (because the buffer gets invalidated) commit - 35744950aa0953bee3035400e8035af844a675ba commit + 3c680bddab146e8c8ccf5eba1fec7e1ee978d638 blob - 4fbcbbb4c3303d603f6c34d0d35cc256b7a4ba4e blob + b52c5d5439571378ab5afe52c2ebc33902d31e14 --- gmid.c +++ gmid.c @@ -462,6 +462,7 @@ int main(int argc, char **argv) { int ch, p[2]; + char path[PATH_MAX]; const char *config_path = NULL, *certs_dir = NULL, *hostname = NULL; int conftest = 0, configless = 0; @@ -545,12 +546,9 @@ main(int argc, char **argv) hosts[0].locations[0].match = "*"; switch (argc) { - case 0: { - char path[PATH_MAX]; - + case 0: hosts[0].dir = getcwd(path, sizeof(path)); break; - } case 1: hosts[0].dir = absolutify_path(argv[0]); break;