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

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

grep 2.5


From: Dave Yearke
Subject: grep 2.5
Date: Wed, 3 Apr 2002 09:26:20 -0500 (EST)

Hi,

In grep 2.5, "egrep" and "fgrep" are no longer separate executables,
but links to the "grep" program.  The logic that determines what name
it was invoked as is incomplete, as some of us prefix GNU programs
with "g" to distinguish them from system-delivered programs with the
same names, eg. "ggrep" (I believe this is the reason why egrep and
fgrep were separate programs in previous releases).  This patch is
one possible solution to this problem:

*** src/grep.c.orig     Wed Mar 13 09:49:52 2002
--- src/grep.c  Wed Apr  3 09:21:41 2002
***************
*** 1289,1297 ****
    if (program_name && strrchr (program_name, '/'))
      program_name = strrchr (program_name, '/') + 1;
  
!   if (!strcmp(program_name, "egrep"))
      setmatcher ("egrep");
!   if (!strcmp(program_name, "fgrep"))
      setmatcher ("fgrep");
  
  #if defined(__MSDOS__) || defined(_WIN32)
--- 1289,1297 ----
    if (program_name && strrchr (program_name, '/'))
      program_name = strrchr (program_name, '/') + 1;
  
!   if ((!strcmp(program_name, "egrep")) || (!strcmp(program_name, "gegrep")))
      setmatcher ("egrep");
!   if ((!strcmp(program_name, "fgrep")) || (!strcmp(program_name, "gfgrep")))
      setmatcher ("fgrep");
  
  #if defined(__MSDOS__) || defined(_WIN32)


I hope this helps.

-- 
                      Dave Yearke, address@hidden




reply via email to

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