From: millert Date: Thu, 30 Apr 2015 13:49:04 +0000 (+0000) Subject: Add warning when user specifies -R but no files, like GNU grep. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=016f3eef983cfe509272ce4b1a85864434ed308d;p=openbsd Add warning when user specifies -R but no files, like GNU grep. OK schwarze@ ian@ --- diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index f9fd3911ede..041d81ec9f8 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grep.c,v 1.50 2015/03/16 13:27:59 millert Exp $ */ +/* $OpenBSD: grep.c,v 1.51 2015/04/30 13:49:04 millert Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -444,6 +444,8 @@ main(int argc, char *argv[]) ++argv; } + if (Rflag && argc == 0) + warnx("warning: recursive search of stdin"); if (Eflag) cflags |= REG_EXTENDED; if (Fflag)