fix: fixed a bug which prevented some keys from being correctly parsed from the duckyscript parser (fixes #466)

This commit is contained in:
evilsocket 2019-03-02 12:07:46 +01:00
commit 56922c9be6
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -107,7 +107,7 @@ func (p DuckyParser) Parse(kmap KeyMap, path string) (cmds []*Command, err error
}
cmds = make([]*Command, 0)
for lineno, line := range source {
for _, line := range source {
cmd := &Command{}
if p.lineIs(line, "CTRL", "CONTROL") {
if cmd, err = p.parseModifier(line, kmap, 1); err != nil {
@ -177,8 +177,8 @@ func (p DuckyParser) Parse(kmap KeyMap, path string) (cmds []*Command, err error
}
continue
} else {
err = fmt.Errorf("can't parse line %d ('%s') of %s", lineno+1, line, path)
} else if cmd, err = p.parseLiteral(line, kmap); err != nil {
err = fmt.Errorf("error parsing '%s': %s", line, err)
return
}