diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-22 17:21:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 17:21:59 -0700 |
commit | 0308a2679ed87aa9cb07e2bde19e165dc454c322 (patch) | |
tree | a1d29aacabab533673bff8043ec11864d68ed022 /src/common/fs/file.cpp | |
parent | 255f8d22d7cbb85b6d7742d46a1a6c55262ad4e1 (diff) | |
parent | 2fa207058ba6cb1c4d519942e5543bd942f03f6c (diff) |
Merge pull request #6493 from Morph1984/fs-nodiscard
common: fs: Miscellaneous changes
Diffstat (limited to 'src/common/fs/file.cpp')
-rw-r--r-- | src/common/fs/file.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/fs/file.cpp b/src/common/fs/file.cpp index 710e88b39..077f34995 100644 --- a/src/common/fs/file.cpp +++ b/src/common/fs/file.cpp @@ -172,7 +172,7 @@ std::string ReadStringFromFile(const std::filesystem::path& path, FileType type) size_t WriteStringToFile(const std::filesystem::path& path, FileType type, std::string_view string) { - if (!IsFile(path)) { + if (Exists(path) && !IsFile(path)) { return 0; } @@ -183,7 +183,7 @@ size_t WriteStringToFile(const std::filesystem::path& path, FileType type, size_t AppendStringToFile(const std::filesystem::path& path, FileType type, std::string_view string) { - if (!IsFile(path)) { + if (Exists(path) && !IsFile(path)) { return 0; } |