mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 11:57:50 +02:00
Fix bug that caused unreleased presaving feature to accidentally save entries that were prefixed with a space
This commit is contained in:
parent
be377dee82
commit
5f9ff9e158
@ -149,7 +149,7 @@ func presaveHistoryEntry(ctx context.Context) {
|
|||||||
cmd, err := extractCommandFromArg(ctx, shellName, os.Args[3] /* isPresave = */, true)
|
cmd, err := extractCommandFromArg(ctx, shellName, os.Args[3] /* isPresave = */, true)
|
||||||
lib.CheckFatalError(err)
|
lib.CheckFatalError(err)
|
||||||
entry.Command = cmd
|
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
|
// Don't save commands that start with a space
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user