mirror of
https://github.com/bettercap/bettercap
synced 2025-07-07 05:22:04 -07:00
fix: correctly parsing empty strings (fixes #403)
This commit is contained in:
parent
99ee5c00c4
commit
31c28f0c8d
1 changed files with 3 additions and 0 deletions
|
@ -15,6 +15,7 @@ func ParseCommands(line string) []string {
|
|||
doubleQuoted := false
|
||||
finish := false
|
||||
|
||||
line = strings.Replace(line, `""`, `"<empty>"`, -1)
|
||||
for _, c := range line {
|
||||
switch c {
|
||||
case ';':
|
||||
|
@ -50,6 +51,7 @@ func ParseCommands(line string) []string {
|
|||
}
|
||||
|
||||
if finish {
|
||||
buf = strings.Replace(buf, `<empty>`, `""`, -1)
|
||||
args = append(args, buf)
|
||||
finish = false
|
||||
buf = ""
|
||||
|
@ -57,6 +59,7 @@ func ParseCommands(line string) []string {
|
|||
}
|
||||
|
||||
if len(buf) > 0 {
|
||||
buf = strings.Replace(buf, `<empty>`, `""`, -1)
|
||||
args = append(args, buf)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue