Introduction
Introduction Statistics Contact Development Disclaimer Help
tgrep: update from Plan 9 - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit 93c75d2bad341af383520409fd354dcff3f2c279
parent de3b6d5848d5361490ed049154985d01dd5068f9
Author: David du Colombier <[email protected]>
Date: Mon, 1 Oct 2018 17:20:35 +0200
grep: update from Plan 9
This change fixes a segfault in grep -e when no argument
has been provided. Thanks to Sean Hinchee for reporting
tthis issue.
Fixes #186.
Diffstat:
M src/cmd/grep/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/cmd/grep/main.c b/src/cmd/grep/main.c
t@@ -5,7 +5,7 @@ char *validflags = "bchiLlnsv";
void
usage(void)
{
- fprint(2, "usage: grep [-%s] [-f file] [-e expr] [file ...]\n", validf…
+ fprint(2, "usage: grep [-%s] [-e pattern] [-f patternfile] [file ...]\…
exits("usage");
}
t@@ -31,12 +31,12 @@ main(int argc, char *argv[])
case 'e':
flags['e']++;
lineno = 0;
- str2top(ARGF());
+ str2top(EARGF(usage()));
break;
case 'f':
flags['f']++;
- filename = ARGF();
+ filename = EARGF(usage());
rein = Bopen(filename, OREAD);
if(rein == 0) {
fprint(2, "grep: can't open %s: %r\n", filename);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.