Chromium Code Reviews| Index: runtime/bin/main.cc |
| diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc |
| index 6c8ca4b2a23e5a5a3d1af7a9193603a0fe1906a5..44eb8913c4eb0ca30943430663661d23626d931c 100644 |
| --- a/runtime/bin/main.cc |
| +++ b/runtime/bin/main.cc |
| @@ -207,7 +207,7 @@ static bool ProcessVerboseOption(const char* arg, |
| static bool ProcessPackageRootOption(const char* arg, |
| CommandLineOptions* vm_options) { |
| ASSERT(arg != NULL); |
| - if (*arg == '\0' || *arg == '-') { |
| + if (*arg == '-') { |
| return false; |
| } |
| commandline_package_root = arg; |
| @@ -218,7 +218,7 @@ static bool ProcessPackageRootOption(const char* arg, |
| static bool ProcessPackagesOption(const char* arg, |
| CommandLineOptions* vm_options) { |
|
regis
2016/06/20 21:53:12
This is the opportunity to fix this bad indentatio
hausner
2016/06/20 22:37:05
Done.
|
| ASSERT(arg != NULL); |
| - if ((*arg == '\0') || (*arg == '-')) { |
| + if (*arg == '-') { |
| return false; |
| } |
| commandline_packages_file = arg; |
| @@ -592,6 +592,16 @@ static int ParseArguments(int argc, |
| "file is invalid.\n"); |
| return -1; |
| } |
| + if ((commandline_package_root != NULL) && |
| + (strlen(commandline_package_root) == 0)) { |
| + Log::PrintErr("Empty package root specified.\n"); |
| + return -1; |
| + } |
| + if ((commandline_packages_file != NULL) && |
| + (strlen(commandline_packages_file) == 0)) { |
| + Log::PrintErr("Empty package file name specified.\n"); |
| + return -1; |
| + } |
| if (is_noopt && gen_snapshot_kind != kNone) { |
| Log::PrintErr("Generating a snapshot with dart_noopt is invalid.\n"); |
| return -1; |