src/operations.cpp | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/operations.cpp b/src/operations.cpp
index f34b076..f8b9c3a 100644
a
|
b
|
namespace
|
508 | 508 | || errval == ERROR_BAD_NETPATH; // "//nosuch" on Win32 |
509 | 509 | } |
510 | 510 | |
511 | | // some distributions of mingw as early as GLIBCXX__ 20110325 have _stricmp, but the |
| 511 | // some distributions of mingw as early as GLIBCXX__ 20110325 have _wcsicmp, but the |
512 | 512 | // offical 4.6.2 release with __GLIBCXX__ 20111026 doesn't. Play it safe for now, and |
513 | | // only use _stricmp if _MSC_VER is defined |
| 513 | // only use _wcsicmp if _MSC_VER is defined |
514 | 514 | #if defined(_MSC_VER) // || (defined(__GLIBCXX__) && __GLIBCXX__ >= 20110325) |
515 | | # define BOOST_FILESYSTEM_STRICMP _stricmp |
| 515 | # define BOOST_FILESYSTEM_STRICMP _wcsicmp |
516 | 516 | #else |
517 | | # define BOOST_FILESYSTEM_STRICMP strcmp |
| 517 | # define BOOST_FILESYSTEM_STRICMP wcscmp |
518 | 518 | #endif |
519 | 519 | |
520 | 520 | perms make_permissions(const path& p, DWORD attr) |
… |
… |
namespace
|
522 | 522 | perms prms = fs::owner_read | fs::group_read | fs::others_read; |
523 | 523 | if ((attr & FILE_ATTRIBUTE_READONLY) == 0) |
524 | 524 | prms |= fs::owner_write | fs::group_write | fs::others_write; |
525 | | if (BOOST_FILESYSTEM_STRICMP(p.extension().string().c_str(), ".exe") == 0 |
526 | | || BOOST_FILESYSTEM_STRICMP(p.extension().string().c_str(), ".com") == 0 |
527 | | || BOOST_FILESYSTEM_STRICMP(p.extension().string().c_str(), ".bat") == 0 |
528 | | || BOOST_FILESYSTEM_STRICMP(p.extension().string().c_str(), ".cmd") == 0) |
| 525 | path ext = p.extension(); |
| 526 | if (BOOST_FILESYSTEM_STRICMP(ext.c_str(), L".exe") == 0 |
| 527 | || BOOST_FILESYSTEM_STRICMP(ext.c_str(), L".com") == 0 |
| 528 | || BOOST_FILESYSTEM_STRICMP(ext.c_str(), L".bat") == 0 |
| 529 | || BOOST_FILESYSTEM_STRICMP(ext.c_str(), L".cmd") == 0) |
529 | 530 | prms |= fs::owner_exe | fs::group_exe | fs::others_exe; |
530 | 531 | return prms; |
531 | 532 | } |