diff --git a/AUTHORS b/AUTHORS index 9d711ec62..4b5ff0201 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,6 +16,7 @@ Brian Silverman Dmitriy Arbitman Google Inc. Guillaume Dumont +LingBin Marco Wang Michael Tanner MiniLight diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 5780377c6..82aead939 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -36,6 +36,7 @@ HÃ¥kan L. S. Younes Ivan Penkov Jacob Trimble Jim Ray +LingBin Marco Wang Michael Darr Michael Tanner diff --git a/src/logging.cc b/src/logging.cc index 23295f57a..a364e4f1b 100644 --- a/src/logging.cc +++ b/src/logging.cc @@ -35,6 +35,7 @@ #include #include #include +#include #include #ifdef HAVE_UNISTD_H @@ -2397,8 +2398,13 @@ const vector& GetLoggingDirectories() { logging_directories_list = new vector; if ( !FLAGS_log_dir.empty() ) { - // A dir was specified, we should use it - logging_directories_list->push_back(FLAGS_log_dir); + // Ensure the specified path ends with a directory delimiter. + if (std::find(std::begin(possible_dir_delim), std::end(possible_dir_delim), + FLAGS_log_dir.back()) == std::end(possible_dir_delim)) { + logging_directories_list->push_back(FLAGS_log_dir + "/"); + } else { + logging_directories_list->push_back(FLAGS_log_dir); + } } else { GetTempDirectories(logging_directories_list); #ifdef GLOG_OS_WINDOWS