grep: allow the pattern to be empty

This commit is contained in:
nemunaire 2017-10-03 07:00:08 +02:00
parent b15d18b3a5
commit bb0e958118

View File

@ -73,7 +73,7 @@ def cmd_grep(msg):
only = "only" in msg.kwargs
l = [m for m in grep(msg.args[0] if msg.args[0][0] == "^" else ".*?(" + msg.args[0] + ").*?",
l = [m for m in grep(msg.args[0] if len(msg.args[0]) and msg.args[0][0] == "^" else ".*?(" + msg.args[0] + ").*?",
" ".join(msg.args[1:]),
msg,
icase="nocase" in msg.kwargs,