pkg/process: properly quote arguments (#963)

This commit is contained in:
Egon Elbre 2019-01-03 20:00:59 +02:00 committed by GitHub
parent 6505a6f310
commit 011b889ba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,7 @@ func SaveConfig(flagset *pflag.FlagSet, outfile string, overrides map[string]int
switch f.Value.Type() { switch f.Value.Type() {
case "string": case "string":
// save ourselves 250+ lines of code and just double quote strings // save ourselves 250+ lines of code and just double quote strings
fmt.Fprintf(w, "\"%s\"\n", value) fmt.Fprintf(w, "%q\n", value)
default: default:
//assume that everything else doesn't have fancy control characters //assume that everything else doesn't have fancy control characters
fmt.Fprintf(w, "%s\n", value) fmt.Fprintf(w, "%s\n", value)