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

Unified Diff: runtime/bin/process_patch.dart

Issue 15861004: Temporary, only escape quotes if run in shell. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_patch.dart
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index 729a7b5f492df88269d41130423090dab933aac2..0acd6c0498172154f50b4b0cd2eaf2be84df3599 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.dart
@@ -69,7 +69,8 @@ class _ProcessImpl extends NativeFieldWrapperClass1 implements Process {
String this._workingDirectory,
Map<String, String> environment,
bool runInShell) {
- if (identical(runInShell, true)) {
+ runInShell = identical(runInShell, true);
+ if (runInShell) {
arguments = _getShellArguments(path, arguments);
path = _getShellCommand();
}
@@ -91,7 +92,8 @@ class _ProcessImpl extends NativeFieldWrapperClass1 implements Process {
}
_arguments[i] = arguments[i];
if (Platform.operatingSystem == 'windows') {
- _arguments[i] = _windowsArgumentEscape(_arguments[i]);
+ _arguments[i] = _windowsArgumentEscape(_arguments[i],
+ shellEscape: runInShell);
}
}
@@ -156,11 +158,12 @@ class _ProcessImpl extends NativeFieldWrapperClass1 implements Process {
return shellArguments;
}
- String _windowsArgumentEscape(String argument) {
+ String _windowsArgumentEscape(String argument, { bool shellEscape: false }) {
var result = argument;
if (argument.contains('\t') ||
argument.contains(' ') ||
- argument.contains('"')) {
+ // TODO(ajohnsen): Remove shellEscape.
+ (shellEscape && argument.contains('"'))) {
// Produce something that the C runtime on Windows will parse
// back as this string.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698