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

Issue 2543503003: Handle spaces and quotes in chrome_elf command line parser (Closed)

Created:
4 years ago by scottmg
Modified:
4 years ago
Reviewers:
grt (UTC plus 2)
CC:
chromium-reviews, ananta
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Handle spaces and quotes in chrome_elf command line parser This is the worst sort of procedural stateful goopy code. I followed the pseudo-code from http://www.windowsinspired.com/how-a-windows-programs-splits-its-command-line-into-individual-arguments/ and verified against calling CommandLineToArgvW() which is what we're attempting to emulate here. Two tests were removed from InstallStaticTest.GetSwitchValueFromCommandLineTest because I don't believe they were correct (spaces after the equal sign), but maybe Ananta can correct me on that. R=grt@chromium.org BUG=670012 Committed: https://crrev.com/e8882778ceb608911d96e7e485dbbff4db5c2b83 Cr-Commit-Position: refs/heads/master@{#436056}

Patch Set 1 #

Total comments: 4

Patch Set 2 : unsigned #

Patch Set 3 : use wcs* #

Total comments: 30

Patch Set 4 : fixes, test cases from blogs, special argv[0] handling #

Patch Set 5 : refactor argv0 a bit #

Total comments: 8

Patch Set 6 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+283 lines, -42 lines) Patch
M chrome/install_static/install_util.h View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/install_static/install_util.cc View 1 2 3 4 5 1 chunk +112 lines, -34 lines 0 comments Download
M chrome/install_static/install_util_unittest.cc View 1 2 3 4 1 chunk +165 lines, -8 lines 0 comments Download

Messages

Total messages: 41 (28 generated)
scottmg
4 years ago (2016-12-01 00:13:08 UTC) #4
scottmg
I'm not sure this is perfect, but it's ... better.
4 years ago (2016-12-01 00:28:39 UTC) #7
Nico
Since you're writing C... (feel free to ignore!) https://codereview.chromium.org/2543503003/diff/1/chrome/install_static/install_util.cc File chrome/install_static/install_util.cc (right): https://codereview.chromium.org/2543503003/diff/1/chrome/install_static/install_util.cc#newcode615 chrome/install_static/install_util.cc:615: while ...
4 years ago (2016-12-01 05:01:09 UTC) #10
Nico
4 years ago (2016-12-01 05:01:18 UTC) #12
scottmg
https://codereview.chromium.org/2543503003/diff/1/chrome/install_static/install_util.cc File chrome/install_static/install_util.cc (right): https://codereview.chromium.org/2543503003/diff/1/chrome/install_static/install_util.cc#newcode615 chrome/install_static/install_util.cc:615: while (p[0] == L' ' || p[0] == L'\t') ...
4 years ago (2016-12-01 05:34:26 UTC) #15
grt (UTC plus 2)
such fun! https://codereview.chromium.org/2543503003/diff/40001/chrome/install_static/install_util.cc File chrome/install_static/install_util.cc (right): https://codereview.chromium.org/2543503003/diff/40001/chrome/install_static/install_util.cc#newcode603 chrome/install_static/install_util.cc:603: enum class SpecialChars { i think some ...
4 years ago (2016-12-01 09:07:13 UTC) #20
scottmg
Thanks Greg. https://codereview.chromium.org/2543503003/diff/40001/chrome/install_static/install_util.cc File chrome/install_static/install_util.cc (right): https://codereview.chromium.org/2543503003/diff/40001/chrome/install_static/install_util.cc#newcode603 chrome/install_static/install_util.cc:603: enum class SpecialChars { On 2016/12/01 09:07:13, ...
4 years ago (2016-12-01 19:04:22 UTC) #21
Nico
I'll shut up now. I tried to uncheck "add as reviewer" when I left my ...
4 years ago (2016-12-02 01:02:33 UTC) #32
grt (UTC plus 2)
lgtm w/ nits https://codereview.chromium.org/2543503003/diff/40001/chrome/install_static/install_util.cc File chrome/install_static/install_util.cc (right): https://codereview.chromium.org/2543503003/diff/40001/chrome/install_static/install_util.cc#newcode636 chrome/install_static/install_util.cc:636: for (int i = 1; i ...
4 years ago (2016-12-02 10:18:03 UTC) #33
scottmg
Thanks! https://codereview.chromium.org/2543503003/diff/100001/chrome/install_static/install_util.cc File chrome/install_static/install_util.cc (right): https://codereview.chromium.org/2543503003/diff/100001/chrome/install_static/install_util.cc#newcode612 chrome/install_static/install_util.cc:612: // The first argument (the program) is handled ...
4 years ago (2016-12-02 21:25:55 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2543503003/120001
4 years ago (2016-12-02 21:26:35 UTC) #37
commit-bot: I haz the power
Committed patchset #6 (id:120001)
4 years ago (2016-12-02 22:28:52 UTC) #39
commit-bot: I haz the power
4 years ago (2016-12-02 22:31:24 UTC) #41
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/e8882778ceb608911d96e7e485dbbff4db5c2b83
Cr-Commit-Position: refs/heads/master@{#436056}

Powered by Google App Engine
This is Rietveld 408576698