1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-22 16:20:23 +02:00

Prevent "print -m" from crashing (complains about missing pattern).

This commit is contained in:
Wayne Davison 2003-03-28 20:21:00 +00:00
parent 1e57c42f47
commit ca8ad2e262

View file

@ -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);