Commit 2170b60cc7e8b02cd709e1c4bc1d3d6b19dc9356

Authored by Henry Fredrick Schreiner
1 parent 8725de67

Windows fixes

include/CLI/Validators.hpp
... ... @@ -27,7 +27,7 @@ namespace CLI {
27 27 bool ExistingFile(std::string filename) {
28 28 struct stat buffer;
29 29 bool exist = stat(filename.c_str(), &buffer) == 0;
30   - bool is_dir = buffer.st_mode & S_IFDIR != 0;
  30 + bool is_dir = (buffer.st_mode & S_IFDIR != 0);
31 31 if(!exist) {
32 32 std::cerr << "File does not exist: " << filename << std::endl;
33 33 return false;
... ... @@ -43,7 +43,7 @@ bool ExistingFile(std::string filename) {
43 43 bool ExistingDirectory(std::string filename) {
44 44 struct stat buffer;
45 45 bool exist = stat(filename.c_str(), &buffer) == 0;
46   - bool is_dir = buffer.st_mode & S_IFDIR != 0;
  46 + bool is_dir = (buffer.st_mode & S_IFDIR) != 0;
47 47 if(!exist) {
48 48 std::cerr << "Directory does not exist: " << filename << std::endl;
49 49 return false;
... ...
tests/AppTest.cpp
... ... @@ -489,7 +489,7 @@ TEST_F(TApp, RequiresChainedFlags) {
489 489  
490 490 TEST_F(TApp, Env) {
491 491  
492   - put_env("CLI11_TEST_ENV_TMP", "2", true);
  492 + put_env("CLI11_TEST_ENV_TMP", "2");
493 493  
494 494 int val=1;
495 495 CLI::Option* vopt = app.add_option("--tmp", val)->envname("CLI11_TEST_ENV_TMP");
... ...