From 4421869b85d6c35f33f655f79ba622e75c863448 Mon Sep 17 00:00:00 2001 From: sammyette Date: Sat, 30 Sep 2023 23:21:00 -0400 Subject: [PATCH] fix: check length of args in aliases resolve this shouldnt be a problem.. but ... what --- aliases.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aliases.go b/aliases.go index fc5777e..c211729 100644 --- a/aliases.go +++ b/aliases.go @@ -51,6 +51,11 @@ func (a *aliasModule) Resolve(cmdstr string) string { arg, _ := regexp.Compile(`[\\]?%\d+`) args, _ := splitInput(cmdstr) + if len(args) == 0 { + // this shouldnt reach but...???? + return + } + for a.aliases[args[0]] != "" { alias := a.aliases[args[0]] alias = arg.ReplaceAllStringFunc(alias, func(a string) string {