Ticket #10731: filesystem_10731.patch

File filesystem_10731.patch, 1.9 KB (added by Daniel Kruegler <daniel.kruegler@…>, 6 years ago)

Patch suggestion

  • src/operations.cpp

     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  
    508508      || errval == ERROR_BAD_NETPATH;  // "//nosuch" on Win32
    509509  }
    510510
    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
    512512// 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
    514514#if defined(_MSC_VER) // || (defined(__GLIBCXX__) && __GLIBCXX__ >= 20110325)
    515 #  define BOOST_FILESYSTEM_STRICMP _stricmp
     515#  define BOOST_FILESYSTEM_STRICMP _wcsicmp
    516516#else
    517 #  define BOOST_FILESYSTEM_STRICMP strcmp
     517#  define BOOST_FILESYSTEM_STRICMP wcscmp
    518518#endif
    519519
    520520  perms make_permissions(const path& p, DWORD attr)
    namespace  
    522522    perms prms = fs::owner_read | fs::group_read | fs::others_read;
    523523    if  ((attr & FILE_ATTRIBUTE_READONLY) == 0)
    524524      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)
    529530      prms |= fs::owner_exe | fs::group_exe | fs::others_exe;
    530531    return prms;
    531532  }