mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-10-28 12:22:37 +00:00
Fix crash when providing a folder name to fileGet
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
//#include <filesystem>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/*
|
||||
#ifdef USE_STD_REGEX
|
||||
@@ -856,7 +857,8 @@ bool fileExist(const std::string &path, bool scope_limit)
|
||||
//return std::filesystem::exists(path);
|
||||
if(scope_limit && !isInScope(path))
|
||||
return false;
|
||||
return _access(path.data(), 4) != -1;
|
||||
struct stat st;
|
||||
return stat(path.data(), &st) == 0 && S_ISREG(st.st_mode);
|
||||
}
|
||||
|
||||
bool fileCopy(const std::string &source, const std::string &dest)
|
||||
|
||||
Reference in New Issue
Block a user