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

Issue 9701061: Change quoting in Process implementation on Windows. (Closed)

Created:
8 years, 9 months ago by Mads Ager (google)
Modified:
8 years, 9 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Change quoting in Process implementation on Windows. Only quote command and arguments if they contain a space or a tab. This seems consistent with the way it is handled in other systems. R=antonm@google.com,sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=5522

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address comment. #

Total comments: 4

Patch Set 3 : Extract backslash char code once #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -5 lines) Patch
M runtime/bin/process_impl.dart View 1 2 2 chunks +49 lines, -0 lines 0 comments Download
M runtime/bin/process_win.cc View 1 2 chunks +4 lines, -5 lines 0 comments Download
A tests/standalone/src/io/ProcessCheckArgumentsScript.dart View 1 1 chunk +17 lines, -0 lines 0 comments Download
A tests/standalone/src/io/ProcessCheckArgumentsTest.dart View 1 1 chunk +35 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Mads Ager (google)
8 years, 9 months ago (2012-03-15 11:34:11 UTC) #1
Anton Muhin
https://chromiumcodereview.appspot.com/9701061/diff/1/runtime/bin/process_win.cc File runtime/bin/process_win.cc (right): https://chromiumcodereview.appspot.com/9701061/diff/1/runtime/bin/process_win.cc#newcode579 runtime/bin/process_win.cc:579: char* format = strchr(path, ' ') != NULL ? ...
8 years, 9 months ago (2012-03-15 11:52:48 UTC) #2
Mads Ager (google)
Urgh, this is more complicated. We are now escaping in a way such that the ...
8 years, 9 months ago (2012-03-15 14:32:22 UTC) #3
Anton Muhin
LGTM https://chromiumcodereview.appspot.com/9701061/diff/4001/runtime/bin/process_impl.dart File runtime/bin/process_impl.dart (right): https://chromiumcodereview.appspot.com/9701061/diff/4001/runtime/bin/process_impl.dart#newcode63 runtime/bin/process_impl.dart:63: // twice as many '\' followed by '\"'. ...
8 years, 9 months ago (2012-03-15 14:59:38 UTC) #4
Mads Ager (google)
8 years, 9 months ago (2012-03-15 15:32:02 UTC) #5
https://chromiumcodereview.appspot.com/9701061/diff/4001/runtime/bin/process_...
File runtime/bin/process_impl.dart (right):

https://chromiumcodereview.appspot.com/9701061/diff/4001/runtime/bin/process_...
runtime/bin/process_impl.dart:63: // twice as many '\' followed by '\"'.
On 2012/03/15 14:59:39, antonmuhin wrote:
> I don't know the current status of RegExps, but it looks like a perfect match
> for them, something like:
> 
> re.replace('(\+)"', '$1$1\"\).

Yeah, it does. I don't believe that there is support for this syntax though.
Therefore you will have to pick out substrings by hand and the code becomes
almost as big. At that point I don't think the regexp machinery is worth it.

https://chromiumcodereview.appspot.com/9701061/diff/4001/runtime/bin/process_...
runtime/bin/process_impl.dart:67: while (quotePos != -1) {
On 2012/03/15 14:59:39, antonmuhin wrote:
> absolutely up to you,  but I would structure the loop somewhat differently:
> 
> while (true) {
>   quotePos = ...
>   if (quotePos == -1) {
>     finish and break;
>   }
>   ...
> }

I don't really like any of them. I like the explicit break condition the best
though, so leaving as is. Thanks.

Powered by Google App Engine
This is Rietveld 408576698