mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
parse lines more robustly
This commit is contained in:
parent
4e56ea1bdc
commit
a894e3f37f
@ -107,7 +107,9 @@ func parseLine(line string) (command string, args []string) {
|
||||
for arg, rest := parseArg(line); arg != ""; arg, rest = parseArg(rest) {
|
||||
args = append(args, arg)
|
||||
}
|
||||
command, args = strings.ToUpper(args[0]), args[1:]
|
||||
if len(args) > 0 {
|
||||
command, args = strings.ToUpper(args[0]), args[1:]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user