Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: third_party/bspatch/mbspatch.cc

Issue 268: Fix binary patching for localized OS. Not sure how it was working till now.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/bspatch/mbspatch.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/bspatch/mbspatch.cc
===================================================================
--- third_party/bspatch/mbspatch.cc (revision 1778)
+++ third_party/bspatch/mbspatch.cc (working copy)
@@ -209,16 +209,16 @@
# define _O_BINARY 0
#endif
-int ApplyBinaryPatch(const char *old_file, const char *patch_file,
- const char *new_file) {
+int ApplyBinaryPatch(const wchar_t *old_file, const wchar_t *patch_file,
+ const wchar_t *new_file) {
int ret = 0;
- int pfd = open(patch_file, O_RDONLY | _O_BINARY);
+ int pfd = _wopen(patch_file, O_RDONLY | _O_BINARY);
if (pfd < 0) return READ_ERROR;
MBSPatchHeader header;
if (ret = MBS_ReadHeader(pfd, &header)) return ret;
- int ofd = open(old_file, O_RDONLY | _O_BINARY);
+ int ofd = _wopen(old_file, O_RDONLY | _O_BINARY);
if (ofd < 0) return READ_ERROR;
struct stat os;
@@ -232,7 +232,7 @@
if (CalculateCrc(buf, header.slen) != header.scrc32)
return CRC_ERROR;
- int nfd = open(new_file, O_WRONLY | O_TRUNC | O_CREAT | _O_BINARY);
+ int nfd = _wopen(new_file, O_WRONLY | O_TRUNC | O_CREAT | _O_BINARY);
if (nfd < 0) return READ_ERROR;
MBS_ApplyPatch(&header, pfd, buf, nfd);
« no previous file with comments | « third_party/bspatch/mbspatch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698