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

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 wchar_t date_str[10] = {0};
grt (UTC plus 2) 2011/02/17 04:04:10 Why 10?
tommi (sloooow) - chröme 2011/02/17 19:40:09 nervousness around yyyyy
269 const wchar_t kDateFormat[] = L"yyyyMMdd";
grt (UTC plus 2) 2011/02/17 04:04:10 nit: static const?
tommi (sloooow) - chröme 2011/02/17 19:40:09 Done.
270 size_t ret = GetDateFormatW(LOCALE_USER_DEFAULT, 0, NULL, kDateFormat,
grt (UTC plus 2) 2011/02/17 04:04:10 Use LOCALE_INVARIANT. Otherwise, you could potent
grt (UTC plus 2) 2011/02/17 04:04:10 MSDN says GetDateFormat returns an int. If you ch
tommi (sloooow) - chröme 2011/02/17 19:40:09 Done.
271 date_str, arraysize(date_str));
272 DCHECK_EQ(arraysize(kDateFormat), ret);
grt (UTC plus 2) 2011/02/17 04:04:10 MSDN says that 'yyyy' can yield a 5-digit year, wh
tommi (sloooow) - chröme 2011/02/17 19:40:09 Done.
273 return date_str;
grt (UTC plus 2) 2011/02/17 04:04:10 I'm a huge fan of std::wstring(date_str, ret), whi
tommi (sloooow) - chröme 2011/02/17 19:40:09 Done.
274 }
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