about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2003-03-28 20:32:47 +0000
committerWayne Davison <wayned@users.sourceforge.net>2003-03-28 20:32:47 +0000
commit6a121ae3edb1b68bb9a3bf42e55c43701397ffc5 (patch)
treedb02230429e0376d16bffb35eac67624891c9ef6 /Src/builtin.c
parentcd04c05ecf1bd1e2436252a155ea5deda6bf02e9 (diff)
downloadzsh-6a121ae3edb1b68bb9a3bf42e55c43701397ffc5.tar.gz
zsh-6a121ae3edb1b68bb9a3bf42e55c43701397ffc5.tar.xz
zsh-6a121ae3edb1b68bb9a3bf42e55c43701397ffc5.zip
Prevent "print -m" from crashing (complains about missing pattern).
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 8b59accf1..c1468c6aa 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2895,6 +2895,10 @@ bin_print(char *name, char **args, char *ops, int func)
 	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);