8000 rkt: skip parsing in case of an empty string by dongsupark · Pull Request #3822 · rkt/rkt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

rkt: skip parsing in case of an empty string #3822

Merged
merged 1 commit into from
Oct 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rkt/cli_apps.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 The rkt Authors
// Copyright 2015-2017 The rkt Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,6 +49,9 @@ func parseApps(al *apps.Apps, args []string, flags *pflag.FlagSet, allowAppArgs
inAppArgs := false
for i := 0; i < len(args); i++ {
a := args[i]
if len(a) == 0 {
continue
}
if inAppArgs {
switch a {
case "---":
Expand Down
9 changes: 9 additions & 0 deletions rkt/cli_apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ func TestParseAppArgs(t *testing.T) {
},
false,
},
{
"example.com/foo example.com/bar",
[]string{"example.com/foo", "example.com/bar"},
[][]string{
nil,
nil,
},
false,
},
}

for i, tt := range tests {
Expand Down
0