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

Unified Diff: runtime/bin/process_win.cc

Issue 10163004: Revert "Support passing an environment variable map to child processes." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « runtime/bin/process_macos.cc ('k') | tests/standalone/src/io/PrintEnv.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_win.cc
diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc
index c896b4179b9d39657a4c59ac1f3d74b09e4e7f32..00b51ed60a4e0d1628dfeeb2830f06f059651130 100644
--- a/runtime/bin/process_win.cc
+++ b/runtime/bin/process_win.cc
@@ -469,8 +469,6 @@ int Process::Start(const char* path,
char* arguments[],
intptr_t arguments_length,
const char* working_directory,
- char* environment[],
- intptr_t environment_length,
intptr_t* in,
intptr_t* out,
intptr_t* err,
@@ -587,32 +585,6 @@ int Process::Start(const char* path,
ASSERT(remaining >= 0);
}
- // Create environment block if an environment is supplied.
- char* environment_block = NULL;
- if (environment != NULL) {
- // An environment block is a sequence of zero-terminated strings
- // followed by a block-terminating zero char.
- intptr_t block_size = 1;
- for (intptr_t i = 0; i < environment_length; i++) {
- block_size += strlen(environment[i]) + 1;
- }
- environment_block = new char[block_size];
- intptr_t block_index = 0;
- for (intptr_t i = 0; i < environment_length; i++) {
- intptr_t len = strlen(environment[i]);
- intptr_t result = snprintf(environment_block + block_index,
- len,
- "%s",
- environment[i]);
- ASSERT(result == len);
- block_index += len;
- environment_block[block_index++] = '\0';
- }
- // Block-terminating zero char.
- environment_block[block_index++] = '\0';
- ASSERT(block_index == block_size);
- }
-
// Create process.
BOOL result = CreateProcess(NULL, // ApplicationName
command_line,
@@ -620,14 +592,13 @@ int Process::Start(const char* path,
NULL, // ThreadAttributes
TRUE, // InheritHandles
0, // CreationFlags
- environment_block,
+ NULL, // Environment
working_directory,
&startup_info,
&process_info);
- // Deallocate command-line and environment block strings.
+ // Deallocate command-line string.
delete[] command_line;
- delete[] environment_block;
if (result == 0) {
int error_code = SetOsErrorMessage(os_error_message, os_error_message_len);
« no previous file with comments | « runtime/bin/process_macos.cc ('k') | tests/standalone/src/io/PrintEnv.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698