From a7dd64fb0bdac9b04d3bceed8ecea5e0bf6ee582 Mon Sep 17 00:00:00 2001 From: Zachary Wasserman Date: Thu, 28 Jun 2018 12:02:46 -0700 Subject: [PATCH] Fix newline handling in fleetctl convert (#1856) Previously we stripped all non-word characters which worked for some cases, but removed necessary characters in others. What we really want (and now do) is to remove only whitespace characters. Fixes #1854 --- cmd/fleetctl/convert.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/fleetctl/convert.go b/cmd/fleetctl/convert.go index ded58664a3..aefc489ae8 100644 --- a/cmd/fleetctl/convert.go +++ b/cmd/fleetctl/convert.go @@ -104,7 +104,7 @@ func convertCommand() cli.Command { // valid JSON but osquery accepts them) and replace // with \n so that we get them in the YAML output where // they are allowed. - re := regexp.MustCompile(`\W*\\\n`) + re := regexp.MustCompile(`\s*\\\n`) b = re.ReplaceAll(b, []byte(`\n`)) var specs *specGroup