home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 22 gnu
/
22-gnu.zip
/
gnugrep.zip
/
patches.os2
< prev
next >
Wrap
Text File
|
1994-05-20
|
3KB
|
89 lines
Only in new: patches.os2
Only in new: Makefile
Only in new: grep.def
Only in new: gnugrep.def
Only in new: gnuregex.def
Only in new: main.c
diff -cb orig/grep.c new/grep.c
*** orig/grep.c Sun May 23 06:52:52 1993
--- new/grep.c Mon Jul 05 21:53:30 1993
***************
*** 368,373 ****
--- 368,374 ----
if (out_byte)
printf("%lu%c", totalcc + (beg - bufbeg), sep);
fwrite(beg, 1, lim - beg, stdout);
+ fflush(stdout);
if (ferror(stdout))
error("writing output", errno);
lastout = lim;
***************
*** 566,577 ****
static char version[] = "GNU grep version 2.0";
#define USAGE \
! "usage: %s [-[[AB] ]<num>] [-[CEFGVchilnqsvwx]] [-[ef]] <expr> [<files...>]\n"
static void
usage()
{
! fprintf(stderr, USAGE, prog);
exit(2);
}
--- 566,600 ----
static char version[] = "GNU grep version 2.0";
#define USAGE \
! "Usage: %s [-[[AB] ]<num>] [-[CEFGVLbchilnqsvwxy]] [-[ef]] <expr> [<files...>]\n"
static void
usage()
{
! printf("\n%s\n\n", version);
! printf(USAGE, prog);
! printf(
! " -G -E -F behave like grep, egrep, fgrep\n"
! " -<num> print <num> lines of context on each side\n"
! " -A <num> print <num> lines of context after every matching line\n"
! " -B <num> print <num> lines of context before every matching line\n"
! " -e <expr> search for <expr>; useful if <expr> begins with -\n"
! " -f <file> take <expr> from the given <file>\n"
! " -C print 2 lines of context on each side of every match\n"
! " -V print the version number on stderr\n"
! " -b print every match preceded by its byte offset\n"
! " -c print a total count of matching lines only\n"
! " -h don't display filenames on matches\n"
! " -i -y ignore case difference when comparing strings\n"
! " -l list files containing matches only\n"
! " -L like -l but list files that don't contain matches\n"
! " -n print each match preceded by its line number\n"
! " -q be quiet\n"
! " -s run silently producing no output except error messages\n"
! " -v print only lines that contain no matches for the <expr>\n"
! " -w print only lines where the match is a complete word\n"
! " -x print only lines where the match is a whole line\n");
!
exit(2);
}
***************
*** 605,610 ****
--- 628,643 ----
FILE *fp;
extern char *optarg;
extern int optind;
+
+ #ifdef __EMX__
+ _wildcard(&argc, &argv);
+ setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
+ if ((prog = strrchr(argv[0], '.')) != NULL && stricmp(prog, ".exe") == 0)
+ *prog = 0;
+ if ((prog = strrchr(argv[0], '\\')) != NULL)
+ *prog = '/';
+ strlwr(argv[0]);
+ #endif
prog = argv[0];
if (prog && strrchr(prog, '/'))