diff options
-rw-r--r-- | src/grep.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -86,8 +86,10 @@ int main(int argc, char **argv) flags |= 1U << strchr(optpat, b)-optpat; if (b-'e'<2U) addpats(argv[0], b, optarg); } - if (!argv[optind]) usage(); - if (!head) addpats(argv[0], 'e', argv[optind++]); + if (!head) { + if (!argv[optind]) usage(); + addpats(argv[0], 'e', argv[optind++]); + } if (!(flags & FLAG_F)) { int re_opts = (flags & FLAG_E) |