about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 4750e8d8b..7013e89af 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3111,7 +3111,11 @@ bin_print(char *name, char **args, Options ops, int func)
     if (OPT_ISSET(ops,'m')) {
 	Patprog pprog;
 	char **t, **p;
-	
+
+	if (!*args) {
+	    zwarnnam(name, "no pattern specified", NULL, 0);
+	    return 1;
+	}
 	tokenize(*args);
 	if (!(pprog = patcompile(*args, PAT_STATIC, NULL))) {
 	    untokenize(*args);