bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep: problem with invalid argument to --context


From: Daniel Resare
Subject: grep: problem with invalid argument to --context
Date: Sat, 28 Jul 2001 19:43:46 +0200
User-agent: Mutt/1.2.5i

When working with the swedish transaltion of grep i stumbled across this:

An obvious fix to an obvious problem in grep-2.5e.

Problem:

when grep is called with --context=NON-NUMERIC a simple bug in the
parametrs to error() causes grep to segfault.

Fix: 

diff -ur grep-2.5e.vanilla/src/grep.c grep-2.5e/src/grep.c
--- grep-2.5e.vanilla/src/grep.c        Sun Mar  4 20:31:00 2001
+++ grep-2.5e/src/grep.c        Sat Jul 28 19:30:10 2001
@@ -188,7 +188,7 @@
         && 0 <= (*out = value)
         && *out == value))
     {
-      error (2, 0, "%s: %s: %s\n", str, _("invalid context length argument"));
+      error (2, 0, "%s: %s", str, _("invalid context length argument"));
     }
 }
 

cheers
/daniel

-- 
begin:vcard fn:Daniel Resare tel;cell:+46739442044 tel;work:+468332040
adr;work:Scheelegatan 36; 112 28; Stockholm; Sweden end:vcard
pgp fingerprint: 8D97 F297 CA0D 8751 D8EB  12B6 6EA6 727F 9B8D EC2A



reply via email to

[Prev in Thread] Current Thread [Next in Thread]