Fix PathIsAbsolute function not dealing with CYGWIN. Handle absolute paths in logfile api.

remotes/origin/master-1.2.x
Victor Julien 13 years ago
parent 7066a79c10
commit 4cd2938c68

@ -132,7 +132,11 @@ SCConfLogOpenGeneric(ConfNode *conf,
if (ConfGet("default-log-dir", &log_dir) != 1)
log_dir = DEFAULT_LOG_DIR;
snprintf(log_path, PATH_MAX, "%s/%s", log_dir, filename);
if (PathIsAbsolute(filename)) {
snprintf(log_path, PATH_MAX, "%s", filename);
} else {
snprintf(log_path, PATH_MAX, "%s/%s", log_dir, filename);
}
filetype = ConfNodeLookupChildValue(conf, "filetype");
if (filetype == NULL)

@ -40,7 +40,7 @@ int PathIsAbsolute(const char *path) {
return 1;
}
#ifdef OS_WIN32
#if (defined OS_WIN32 || defined __CYGWIN__)
if (strlen(path) > 2) {
if (isalpha(path[0]) && path[1] == ':') {
return 1;

Loading…
Cancel
Save