From 2170b60cc7e8b02cd709e1c4bc1d3d6b19dc9356 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sun, 19 Feb 2017 15:19:49 -0500 Subject: [PATCH] Windows fixes --- include/CLI/Validators.hpp | 4 ++-- tests/AppTest.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/CLI/Validators.hpp b/include/CLI/Validators.hpp index 44eaaed0..e32b7970 100644 --- a/include/CLI/Validators.hpp +++ b/include/CLI/Validators.hpp @@ -27,7 +27,7 @@ namespace CLI { bool ExistingFile(std::string filename) { struct stat buffer; bool exist = stat(filename.c_str(), &buffer) == 0; - bool is_dir = buffer.st_mode & S_IFDIR != 0; + bool is_dir = (buffer.st_mode & S_IFDIR != 0); if(!exist) { std::cerr << "File does not exist: " << filename << std::endl; return false; @@ -43,7 +43,7 @@ bool ExistingFile(std::string filename) { bool ExistingDirectory(std::string filename) { struct stat buffer; bool exist = stat(filename.c_str(), &buffer) == 0; - bool is_dir = buffer.st_mode & S_IFDIR != 0; + bool is_dir = (buffer.st_mode & S_IFDIR) != 0; if(!exist) { std::cerr << "Directory does not exist: " << filename << std::endl; return false; diff --git a/tests/AppTest.cpp b/tests/AppTest.cpp index ed486176..a90b2f20 100644 --- a/tests/AppTest.cpp +++ b/tests/AppTest.cpp @@ -489,7 +489,7 @@ TEST_F(TApp, RequiresChainedFlags) { TEST_F(TApp, Env) { - put_env("CLI11_TEST_ENV_TMP", "2", true); + put_env("CLI11_TEST_ENV_TMP", "2"); int val=1; CLI::Option* vopt = app.add_option("--tmp", val)->envname("CLI11_TEST_ENV_TMP");