From 5f9ff9e158d415de286d7ee22b188eb2449b4df3 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Mon, 30 Oct 2023 17:42:09 -0700 Subject: [PATCH] Fix bug that caused unreleased presaving feature to accidentally save entries that were prefixed with a space --- client/cmd/saveHistoryEntry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cmd/saveHistoryEntry.go b/client/cmd/saveHistoryEntry.go index 167ad0f..e423d47 100644 --- a/client/cmd/saveHistoryEntry.go +++ b/client/cmd/saveHistoryEntry.go @@ -149,7 +149,7 @@ func presaveHistoryEntry(ctx context.Context) { cmd, err := extractCommandFromArg(ctx, shellName, os.Args[3] /* isPresave = */, true) lib.CheckFatalError(err) entry.Command = cmd - if strings.HasPrefix(" ", entry.Command) || strings.TrimSpace(entry.Command) == "" { + if strings.HasPrefix(entry.Command, " ") || strings.TrimSpace(entry.Command) == "" { // Don't save commands that start with a space return }