Merge pull request #2178 from danielflira/master

fix weed fuse parameters parsing
This commit is contained in:
Chris Lu 2021-07-02 13:31:49 -07:00 committed by GitHub
commit 53ecae7c7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,14 +55,14 @@ func runFuse(cmd *Command, args []string) bool {
name := option.String() name := option.String()
option.Reset() option.Reset()
for i++; i < rawArgsLen && rawArgs[i] != ','; i++ { for i++; i < rawArgsLen && rawArgs[i] != ',' && rawArgs[i] != ' '; i++ {
// double quote separator read option until next double quote // double quote separator read option until next double quote
if rawArgs[i] == '"' { if rawArgs[i] == '"' {
for i++; i < rawArgsLen && rawArgs[i] != '"'; i++ { for i++; i < rawArgsLen && rawArgs[i] != '"'; i++ {
option.WriteByte(rawArgs[i]) option.WriteByte(rawArgs[i])
} }
// single quote separator read option until next single quote // single quote separator read option until next single quote
} else if rawArgs[i] == '\'' { } else if rawArgs[i] == '\'' {
for i++; i < rawArgsLen && rawArgs[i] != '\''; i++ { for i++; i < rawArgsLen && rawArgs[i] != '\''; i++ {
option.WriteByte(rawArgs[i]) option.WriteByte(rawArgs[i])