mirror of
https://github.com/bettercap/bettercap
synced 2025-07-07 13:32:07 -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
|
doubleQuoted := false
|
||||||
finish := false
|
finish := false
|
||||||
|
|
||||||
|
line = strings.Replace(line, `""`, `"<empty>"`, -1)
|
||||||
for _, c := range line {
|
for _, c := range line {
|
||||||
switch c {
|
switch c {
|
||||||
case ';':
|
case ';':
|
||||||
|
@ -50,6 +51,7 @@ func ParseCommands(line string) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
if finish {
|
if finish {
|
||||||
|
buf = strings.Replace(buf, `<empty>`, `""`, -1)
|
||||||
args = append(args, buf)
|
args = append(args, buf)
|
||||||
finish = false
|
finish = false
|
||||||
buf = ""
|
buf = ""
|
||||||
|
@ -57,6 +59,7 @@ func ParseCommands(line string) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
|
buf = strings.Replace(buf, `<empty>`, `""`, -1)
|
||||||
args = append(args, buf)
|
args = append(args, buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue