From 016f3eef983cfe509272ce4b1a85864434ed308d Mon Sep 17 00:00:00 2001 From: millert Date: Thu, 30 Apr 2015 13:49:04 +0000 Subject: [PATCH] Add warning when user specifies -R but no files, like GNU grep. OK schwarze@ ian@ --- usr.bin/grep/grep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.20.1