File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 10
10
#pragma once
11
11
12
12
#include " fwd.h"
13
+ #include < algorithm>
13
14
#include < string>
14
15
#include < vector>
15
16
#include < stdexcept>
@@ -197,7 +198,7 @@ class path {
197
198
// Windows requires a \\?\ prefix to handle paths longer than MAX_PATH
198
199
// (including their null character). NOTE: relative paths >MAX_PATH are
199
200
// not supported at all in Windows.
200
- if (length > MAX_PATH )
201
+ if (length > MAX_PATH_WINDOWS_LEGACY )
201
202
oss << " \\\\ ?\\ " ;
202
203
}
203
204
}
@@ -350,6 +351,7 @@ class path {
350
351
#if defined(_WIN32)
351
352
static const size_t MAX_PATH_WINDOWS = 32767 ;
352
353
#endif
354
+ static const size_t MAX_PATH_WINDOWS_LEGACY = 260 ;
353
355
path_type m_type;
354
356
std::vector<std::string> m_path;
355
357
bool m_absolute;
@@ -365,7 +367,7 @@ inline bool create_directory(const path& p) {
365
367
366
368
inline bool create_directories (const path& p) {
367
369
#if defined(_WIN32)
368
- return SHCreateDirectory (nullptr , make_absolute ().wstr ().c_str ()) == ERROR_SUCCESS;
370
+ return SHCreateDirectory (nullptr , p. make_absolute ().wstr ().c_str ()) == ERROR_SUCCESS;
369
371
#else
370
372
if (create_directory (p.str ().c_str ()))
371
373
return true ;
You can’t perform that action at this time.
0 commit comments