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

Issue 3007038: Factor out command-line quoting code on Windows. (Closed)

Created:
10 years, 4 months ago by Evan Martin
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

Factor out command-line quoting code on Windows. Our command line code is not very good with respect to getting quoting right. Because of this, callers will sometimes themselves attempt to quote arguments, though some of them get it wrong(!) by just surrounding with quotes. The first step is to add a quoting function that we think is correct and update the unit test to test it. (Note that most of this is Windows-specific, because on POSIX we can pass arguments to commands as a vector -- trying to do quoting on POSIX is usually wrong.) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=55591

Patch Set 1 #

Patch Set 2 : better #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -16 lines) Patch
M base/command_line.cc View 3 chunks +49 lines, -16 lines 4 comments Download
M base/command_line_unittest.cc View 1 7 chunks +31 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Evan Martin
10 years, 4 months ago (2010-08-06 03:42:45 UTC) #1
cpu_(ooo_6.6-7.5)
http://codereview.chromium.org/3007038/diff/2001/3001 File base/command_line.cc (right): http://codereview.chromium.org/3007038/diff/2001/3001#newcode399 base/command_line.cc:399: return arg; I am lost on that first if(). ...
10 years, 4 months ago (2010-08-06 20:09:04 UTC) #2
Evan Martin
http://codereview.chromium.org/3007038/diff/2001/3001 File base/command_line.cc (right): http://codereview.chromium.org/3007038/diff/2001/3001#newcode399 base/command_line.cc:399: return arg; On 2010/08/06 20:09:04, cpu wrote: > I ...
10 years, 4 months ago (2010-08-06 20:10:59 UTC) #3
Evan Martin
On 2010/08/06 20:10:59, Evan Martin wrote: > http://codereview.chromium.org/3007038/diff/2001/3001 > File base/command_line.cc (right): > > http://codereview.chromium.org/3007038/diff/2001/3001#newcode399 ...
10 years, 4 months ago (2010-08-06 20:11:38 UTC) #4
Evan Martin
Ping. Chris, don't be afraid to review too -- it's security-sensitive code. :)
10 years, 4 months ago (2010-08-06 20:54:35 UTC) #5
cevans
[+jschuh] I think Justin is more familiar with the nuances of Windows command line parsing? ...
10 years, 4 months ago (2010-08-06 21:01:35 UTC) #6
cpu_(ooo_6.6-7.5)
http://codereview.chromium.org/3007038/diff/2001/3001 File base/command_line.cc (right): http://codereview.chromium.org/3007038/diff/2001/3001#newcode399 base/command_line.cc:399: return arg; Got it. What confused me what the ...
10 years, 4 months ago (2010-08-07 01:00:27 UTC) #7
Evan Martin
On 2010/08/07 01:00:27, cpu wrote: I'll use [] to delimit the ends of a string ...
10 years, 4 months ago (2010-08-09 17:12:27 UTC) #8
cpu_(ooo_6.6-7.5)
10 years, 4 months ago (2010-08-09 23:00:33 UTC) #9
http://codereview.chromium.org/3007038/diff/2001/3001
File base/command_line.cc (left):

http://codereview.chromium.org/3007038/diff/2001/3001#oldcode399
base/command_line.cc:399: (value_string[0] != L'"') &&
my last comment was due to line 399 here. I guess that current callers use
AppendLooseValue? 

Anyhow, lgtm

Powered by Google App Engine
This is Rietveld 408576698