ConSol-Monitoring / mod-gearman-worker-go

Mod-Gearman Worker rewrite in Golang
GNU General Public License v3.0
7 stars 10 forks source link

Command execution problem when more then one space between arguments and / or options #1

Closed dirtyren closed 5 years ago

dirtyren commented 5 years ago

Hey, I found that if you have more than one space between the arguments and / or options of a plugin, the extra space will be treated as a parameter by exec.CommandContext, at least for one of my PHP plugins.

I replaced splitted := strings.Split(received.commandLine, " ") per splitted := strings.Fields(received.commandLine)

and it solved my problem, as Fields will split one or more spaces.

Should a pull this request ?

Tks.

sni commented 5 years ago

Sounds good. Yes, please create a pull request.

sni commented 5 years ago

nevermind, did it already since i wanted to cut off a new release. Thanks for pointing this out.