From 9cb32e016388fde789f6aec4876c744003039f2e Mon Sep 17 00:00:00 2001 From: Sean Hinchee Date: Wed, 16 Jan 2019 21:17:40 -0600 Subject: [PATCH] fix a whoopsie (thanks vik) --- commands.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 554bcacfaae2c42731405f6ee3910a621e8dd1d4..bbe21ee11f15cd735712b3e4b70d42526c779828 100644 --- a/commands.go +++ b/commands.go @@ -7,8 +7,12 @@ import ( "strings" ) -//ParseForCommands parses input for Commands, returns message if no command specified, else return is empty +// ParseForCommands parses input for Commands, returns message if no command specified, else return is empty func ParseForCommands(line string) string { + if len(line) < 2 { + return line + } + switch line[:2] { case "s/": r := regexp.MustCompile(`s/([^/]+)/([^/]*)/$`)