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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 while (i < argc) { | 384 while (i < argc) { |
385 if (ProcessMainOptions(argv[i])) { | 385 if (ProcessMainOptions(argv[i])) { |
386 i++; | 386 i++; |
387 } else { | 387 } else { |
388 // Check if this flag is a potentially valid VM flag. | 388 // Check if this flag is a potentially valid VM flag. |
389 const char* kChecked = "-c"; | 389 const char* kChecked = "-c"; |
390 const char* kPackageRoot = "-p"; | 390 const char* kPackageRoot = "-p"; |
391 if (strncmp(argv[i], kPackageRoot, strlen(kPackageRoot)) == 0) { | 391 if (strncmp(argv[i], kPackageRoot, strlen(kPackageRoot)) == 0) { |
392 if (!ProcessPackageRootOption(argv[i] + strlen(kPackageRoot))) { | 392 if (!ProcessPackageRootOption(argv[i] + strlen(kPackageRoot))) { |
393 i++; | 393 i++; |
394 if (!ProcessPackageRootOption(argv[i])) { | 394 if ((argv[i] == NULL) || !ProcessPackageRootOption(argv[i])) { |
395 Log::PrintErr("Invalid option specification : '%s'\n", argv[i - 1]); | 395 Log::PrintErr("Invalid option specification : '%s'\n", argv[i - 1]); |
396 i++; | 396 i++; |
397 break; | 397 break; |
398 } | 398 } |
399 } | 399 } |
400 } else if (strncmp(argv[i], kChecked, strlen(kChecked)) == 0) { | 400 } else if (strncmp(argv[i], kChecked, strlen(kChecked)) == 0) { |
401 vm_options->AddArgument("--checked"); | 401 vm_options->AddArgument("--checked"); |
402 } else if (!IsValidFlag(argv[i], kPrefix, kPrefixLen)) { | 402 } else if (!IsValidFlag(argv[i], kPrefix, kPrefixLen)) { |
403 break; | 403 break; |
404 } | 404 } |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 exit(Process::GlobalExitCode()); | 1136 exit(Process::GlobalExitCode()); |
1137 } | 1137 } |
1138 | 1138 |
1139 } // namespace bin | 1139 } // namespace bin |
1140 } // namespace dart | 1140 } // namespace dart |
1141 | 1141 |
1142 int main(int argc, char** argv) { | 1142 int main(int argc, char** argv) { |
1143 dart::bin::main(argc, argv); | 1143 dart::bin::main(argc, argv); |
1144 UNREACHABLE(); | 1144 UNREACHABLE(); |
1145 } | 1145 } |
OLD | NEW |