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

Unified Diff: third_party/zlib/google/zip.cc

Issue 106663006: Followup for bug when zipping a folder with non-ascii chars in its name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 | « no previous file | third_party/zlib/google/zip_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/zlib/google/zip.cc
diff --git a/third_party/zlib/google/zip.cc b/third_party/zlib/google/zip.cc
index 64aead1d64a1edfae35e9d21acb8025c97b151e4..ae33c151fccd5dbf0976e0d63c5d2507a9802d9f 100644
--- a/third_party/zlib/google/zip.cc
+++ b/third_party/zlib/google/zip.cc
@@ -51,8 +51,10 @@ bool AddFileToZip(zipFile zip_file, const base::FilePath& src_dir) {
bool AddEntryToZip(zipFile zip_file, const base::FilePath& path,
const base::FilePath& root_path) {
- std::string str_path =
- path.AsUTF8Unsafe().substr(root_path.AsUTF8Unsafe().length() + 1);
+ base::FilePath relative_path;
+ bool result = root_path.AppendRelativePath(path, &relative_path);
+ DCHECK(result);
+ std::string str_path = relative_path.AsUTF8Unsafe();
#if defined(OS_WIN)
ReplaceSubstringsAfterOffset(&str_path, 0u, "\\", "/");
#endif
« no previous file with comments | « no previous file | third_party/zlib/google/zip_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698