Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 { NULL, NULL } | 255 { NULL, NULL } |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 | 258 |
| 259 static bool ProcessMainOptions(const char* option) { | 259 static bool ProcessMainOptions(const char* option) { |
| 260 int i = 0; | 260 int i = 0; |
| 261 const char* name = main_options[0].option_name; | 261 const char* name = main_options[0].option_name; |
| 262 int option_length = strlen(option); | 262 int option_length = strlen(option); |
| 263 while (name != NULL) { | 263 while (name != NULL) { |
| 264 int length = strlen(name); | 264 int length = strlen(name); |
| 265 if ((option_length >= length) && (strncmp(option, name, length) == 0)) { | 265 if (option_length == length && strncmp(option, name, length) == 0) { |
|
Ivan Posva
2013/06/11 09:55:49
Please keep the parens.
How will this match "--sn
Anders Johnsen
2013/06/11 10:44:32
Done. I see, updated.
| |
| 266 if (!main_options[i].process(option + length)) { | 266 if (!main_options[i].process(option + length)) { |
| 267 Log::PrintErr("Invalid option specification : '%s'\n", option); | 267 Log::PrintErr("Invalid option specification : '%s'\n", option); |
| 268 } | 268 } |
| 269 return true; | 269 return true; |
| 270 } | 270 } |
| 271 i += 1; | 271 i += 1; |
| 272 name = main_options[i].option_name; | 272 name = main_options[i].option_name; |
| 273 } | 273 } |
| 274 return false; | 274 return false; |
| 275 } | 275 } |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 874 | 874 |
| 875 return Process::GlobalExitCode(); | 875 return Process::GlobalExitCode(); |
| 876 } | 876 } |
| 877 | 877 |
| 878 } // namespace bin | 878 } // namespace bin |
| 879 } // namespace dart | 879 } // namespace dart |
| 880 | 880 |
| 881 int main(int argc, char** argv) { | 881 int main(int argc, char** argv) { |
| 882 return dart::bin::main(argc, argv); | 882 return dart::bin::main(argc, argv); |
| 883 } | 883 } |
| OLD | NEW |