mirror of https://github.com/Hilbis/Hilbish
"feat: fix double quotes being an issue in commands"
parent
f0163fc2e9
commit
7aaeb77871
10
main.go
10
main.go
|
@ -59,7 +59,15 @@ func main() {
|
||||||
|
|
||||||
if err == nil { continue }
|
if err == nil { continue }
|
||||||
|
|
||||||
cmdArgs := strings.Fields(cmdString)
|
quoted := false
|
||||||
|
q := func(r rune) bool {
|
||||||
|
if r == '"' {
|
||||||
|
quoted = !quoted
|
||||||
|
}
|
||||||
|
return !quoted && r == ' '
|
||||||
|
}
|
||||||
|
|
||||||
|
cmdArgs := strings.FieldsFunc(cmdString, q)
|
||||||
|
|
||||||
if len(cmdArgs) == 0 { continue }
|
if len(cmdArgs) == 0 { continue }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue