diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-10-19 00:41:19 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-10-19 00:41:19 +0300 |
commit | 4be6981c6d8eefb28383358b7a0beaeca8100a0d (patch) | |
tree | 1e53f1ee3d890f7ac5a0c1aa8a1612c16150cb6a /indra | |
parent | 454c7f4543688126b2fa5c0560710f5a1733702e (diff) |
SL-15964 Fix gzip failing to compress files into unicode paths
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llsys.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 94f669b0f9..e94973ac29 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -1261,7 +1261,12 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile) LLFILE *dst = NULL; S32 bytes = 0; tmpfile = dstfile + ".t"; - src = gzopen(srcfile.c_str(), "rb"); +#ifdef LL_WINDOWS + llutf16string utf16filename = utf8str_to_utf16str(srcfile); + src = gzopen_w(utf16filename.c_str(), "rb"); +#else + src = gzopen(srcfile.c_str(), "rb"); +#endif if (! src) goto err; dst = LLFile::fopen(tmpfile, "wb"); /* Flawfinder: ignore */ if (! dst) goto err; @@ -1295,7 +1300,14 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile) LLFILE *src = NULL; S32 bytes = 0; tmpfile = dstfile + ".t"; - dst = gzopen(tmpfile.c_str(), "wb"); /* Flawfinder: ignore */ + +#ifdef LL_WINDOWS + llutf16string utf16filename = utf8str_to_utf16str(tmpfile); + dst = gzopen_w(utf16filename.c_str(), "wb"); +#else + dst = gzopen(tmpfile.c_str(), "wb"); +#endif + if (! dst) goto err; src = LLFile::fopen(srcfile, "rb"); /* Flawfinder: ignore */ if (! src) goto err; |