From a5a9b4f1edb7bf0796cb8ed10c92d5296d362705 Mon Sep 17 00:00:00 2001 From: "J. Lowell Wofford" Date: Tue, 5 Jan 2021 12:25:21 -0700 Subject: [PATCH] SplitCommandLine should be aware of tabs and newlines --- modules/cmdline/cmdline.txt | 2 +- util.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cmdline/cmdline.txt b/modules/cmdline/cmdline.txt index 059df4a..51bb481 100644 --- a/modules/cmdline/cmdline.txt +++ b/modules/cmdline/cmdline.txt @@ -1 +1 @@ -BOOT_IMAGE=(hd0,msdos1)/boot/vmlinuz-4.18.0-80.el8.x86_64 root=UUID=d5f5b677-6350-416d-b1d3-47d723d94d88 ro no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop uinit.bool uinit.empty= uinit.key=value uinit.quote="once upon a time" \ No newline at end of file +BOOT_IMAGE=(hd0,msdos1)/boot/vmlinuz-4.18.0-80.el8.x86_64 root=UUID=d5f5b677-6350-416d-b1d3-47d723d94d88 ro no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop uinit.bool uinit.empty= uinit.key=value uinit.quote="once upon a time" uinit.newline="ends in a newline" diff --git a/util.go b/util.go index 49bc3e5..3787987 100644 --- a/util.go +++ b/util.go @@ -39,7 +39,7 @@ func SplitCommandLine(s string) []string { case mapGt(lastRune, 0): return false default: - return c == ' ' + return c == ' ' || c == '\n' || c == '\t' } } return strings.FieldsFunc(s, f)