summaryrefslogtreecommitdiff
path: root/usr.bin/mg/grep.c
diff options
context:
space:
mode:
authorVincent Labrecque <vincent@cvs.openbsd.org>2002-07-25 16:37:55 +0000
committerVincent Labrecque <vincent@cvs.openbsd.org>2002-07-25 16:37:55 +0000
commit4ddef896553dfa013b86c100b72f54645767fa38 (patch)
tree3a9601779a3057c0c7fb547963f86d276329f9e8 /usr.bin/mg/grep.c
parent46e317fa17af020f1947cd02ac6e9aa3a46ac08b (diff)
replace the ugly and buggy adjustname function by a simple one using
simple APIs. makes mg not crash with 65k filenames... ok art@
Diffstat (limited to 'usr.bin/mg/grep.c')
-rw-r--r--usr.bin/mg/grep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c
index a3418dd2cd6..37b4bbd5d32 100644
--- a/usr.bin/mg/grep.c
+++ b/usr.bin/mg/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.6 2002/07/01 14:33:44 vincent Exp $ */
+/* $OpenBSD: grep.c,v 1.7 2002/07/25 16:37:54 vincent Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved.
*
@@ -213,6 +213,8 @@ retry:
free(line);
adjf = adjustname(fname);
+ if (adjf == NULL)
+ return (FALSE);
if ((bp = findbuffer(adjf)) == NULL)
return FALSE;
if ((wp = popbuf(bp)) == NULL)