Fixup %EXECUTABLE% code.

git-svn-id: file:///svn/unbound/trunk@3552 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2015-11-30 15:07:11 +00:00
parent 12b29439f5
commit 453ff48e89

View file

@ -334,11 +334,11 @@ service_init(int r, struct daemon** d, struct config_file** c)
/* apply settings and init */
verbosity = cfg->verbosity + service_cmdline_verbose;
if(cfg->directory && cfg->directory[0]) {
TCHAR dirbuf[2*MAX_PATH+4];
char* dir = cfg->directory;
if(strcmp(dir, "%EXECUTABLE%") == 0) {
/* get executable path, and if that contains
* directories, snip off the filename part */
TCHAR dirbuf[2*MAX_PATH+4];
dirbuf[0] = 0;
if(!GetModuleFileName(NULL, path+1, MAX_PATH))
log_err("could not GetModuleFileName");