aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-10-18 05:30:23 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-10-18 05:30:23 +0000
commit21dc570e5f920795f6ba839ca6354cf9634ae9fc (patch)
tree136a8c27db5dc066cb73e0f3b5b5e22aa74bd31e /ui
parent95e84af3993a4bbdc07f8ade62444c96656dd5f6 (diff)
parent6ac63ef003642cf12ee728ae897179bdf5ed7030 (diff)
downloadbuild_soong-21dc570e5f920795f6ba839ca6354cf9634ae9fc.tar.gz
build_soong-21dc570e5f920795f6ba839ca6354cf9634ae9fc.tar.bz2
build_soong-21dc570e5f920795f6ba839ca6354cf9634ae9fc.zip
Merge "Fix soong_ui with empty arguments"
Diffstat (limited to 'ui')
-rw-r--r--ui/build/config.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/build/config.go b/ui/build/config.go
index c8d72921..191a1029 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -154,7 +154,7 @@ func (c *configImpl) parseArgs(ctx Context, args []string) {
c.verbose = true
} else if arg == "--skip-make" {
c.skipMake = true
- } else if arg[0] == '-' {
+ } else if len(arg) > 0 && arg[0] == '-' {
parseArgNum := func(def int) int {
if len(arg) > 2 {
p, err := strconv.ParseUint(arg[2:], 10, 31)
@@ -172,9 +172,9 @@ func (c *configImpl) parseArgs(ctx Context, args []string) {
return def
}
- if arg[1] == 'j' {
+ if len(arg) > 1 && arg[1] == 'j' {
c.parallel = parseArgNum(c.parallel)
- } else if arg[1] == 'k' {
+ } else if len(arg) > 1 && arg[1] == 'k' {
c.keepGoing = parseArgNum(0)
} else {
ctx.Fatalln("Unknown option:", arg)