From 86a4e23c780d6035a5488155edb1be8715d6e50b Mon Sep 17 00:00:00 2001 From: "mbelshe@google.com" Date: Tue, 27 Oct 2009 16:26:46 +0000 Subject: FilePath::Append() doesn't allow you to append a fully-qualified path (like "C:\foo\bar"). The current code was attempting to append "c:\foo\bar" to "\\?\" for long filename support. Reworked so that this could work. I feel back about using the ToWStringHack() function, but there is literally no other choice. BUG=none TEST=none Review URL: http://codereview.chromium.org/337033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30206 0039d316-1c4b-4281-b951-d872f2087c98 --- net/tools/dump_cache/cache_dumper.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'net/tools') diff --git a/net/tools/dump_cache/cache_dumper.cc b/net/tools/dump_cache/cache_dumper.cc index 6232d55..1120817 100644 --- a/net/tools/dump_cache/cache_dumper.cc +++ b/net/tools/dump_cache/cache_dumper.cc @@ -70,7 +70,11 @@ bool DiskDumper::CreateEntry(const std::string& key, // In order for long filenames to work, we'll need to prepend // the windows magic token. const std::wstring kLongFilenamePrefix(L"\\\\?\\"); - entry_path_ = FilePath(kLongFilenamePrefix).Append(entry_path_); + // There is no way to prepend to a filename. We simply *have* + // to convert to a wstring to do this. + std::wstring name = kLongFilenamePrefix; + name.append(entry_path_.ToWStringHack()); + entry_path_ = FilePath(name); #endif entry_url_ = key; -- cgit v1.1