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

Side by Side Diff: chrome/installer/util/install_util.cc

Issue 6533009: Switch from wcsftime to GetDateFormat to avoid crash in setup.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // See the corresponding header file for description of the functions in this 5 // See the corresponding header file for description of the functions in this
6 // file. 6 // file.
7 7
8 #include "chrome/installer/util/install_util.h" 8 #include "chrome/installer/util/install_util.h"
9 9
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 std::wstring command; 256 std::wstring command;
257 command.append(1, L'"') 257 command.append(1, L'"')
258 .append(no_program ? L"" : exe_path) 258 .append(no_program ? L"" : exe_path)
259 .append(L"\" ") 259 .append(L"\" ")
260 .append(arguments); 260 .append(arguments);
261 261
262 // If we have a program name, return this complete command line. 262 // If we have a program name, return this complete command line.
263 *command_line = CommandLine::FromString(command); 263 *command_line = CommandLine::FromString(command);
264 } 264 }
265 } 265 }
266
267 std::wstring InstallUtil::GetCurrentDate() {
268 static const wchar_t kDateFormat[] = L"yyyyMMdd";
269 wchar_t date_str[arraysize(kDateFormat)] = {0};
270 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat,
271 date_str, arraysize(date_str));
272 if (len) {
273 --len; // Subtract terminating \0.
274 } else {
275 PLOG(DFATAL) << "GetDateFormat";
276 }
277
278 return std::wstring(date_str, len);
279 }
OLDNEW
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698