home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 22 gnu
/
22-gnu.zip
/
GNUGRE.ZIP
/
fgrep.patch
< prev
next >
Wrap
Text File
|
1992-07-18
|
4KB
|
105 lines
diff -cbr orig/fgrep/fgrep.c new/fgrep/fgrep.c
*** orig/fgrep/fgrep.c Thu Jun 18 15:41:09 1992
--- new/fgrep/fgrep.c Thu Jun 18 15:26:24 1992
***************
*** 444,456 ****
static const char version[] = "GNU fgrep, version 1.1";
- #define USAGE \
- "usage: %s [-[[AB] ]<num>] [-[CVchilnsvwx]] [-[ef]] <expr> [<files...>]\n"
-
static void
usage()
{
! fprintf(stderr, USAGE, prog);
exit(2);
}
--- 444,473 ----
static const char version[] = "GNU fgrep, version 1.1";
static void
usage()
{
! printf("\n%s\n", version);
! printf("\nUsage: %s [-[[AB]]<num>] [-[CVchilnsvwx]] [-[ef]] <expr> [<files...>]\n", prog);
!
! printf("\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 -C print 2 lines of context on each side of every match"
! "\n -<num> print <num> lines of context on each side"
! "\n -V print the version number on stderr");
! printf("\n -b print every match preceded by its byte offset"
! "\n -c print a total count of matching lines only"
! "\n -e <expr> search for <expr>; useful if <expr> begins with -"
! "\n -f <file> take <expr> from the given <file>"
! "\n -h don't display filenames on matches");
! printf("\n -i ignore case difference when comparing strings"
! "\n -l list files containing matches only"
! "\n -n print each match preceded by its line number"
! "\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);
}
***************
*** 462,467 ****
--- 479,489 ----
int count_matches, no_filenames, list_files;
int opt, cc, desc, count, status;
FILE *fp;
+
+ #ifdef __EMX__
+ _wildcard(&argc, &argv);
+ setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
+ #endif
prog = argv[0];
if (prog && strrchr(prog, '/'))
diff -cbr orig/fgrep/std.h new/fgrep/std.h
*** orig/fgrep/std.h Thu Jun 18 15:41:10 1992
--- new/fgrep/std.h Sun Jan 19 20:06:17 1992
***************
*** 88,94 ****
#endif
/* Declaring this here should be safe. Some losing <errno.h>'s don't. */
! extern int errno;
/* Adapt variable arguments to new implementations (with <stdarg.h>)
or old (which are assumed to have <varargs.h>). */
--- 88,94 ----
#endif
/* Declaring this here should be safe. Some losing <errno.h>'s don't. */
! /* extern int errno; */
/* Adapt variable arguments to new implementations (with <stdarg.h>)
or old (which are assumed to have <varargs.h>). */
diff -cbr orig/fgrep/unix.h new/fgrep/unix.h
*** orig/fgrep/unix.h Thu Jun 18 15:41:10 1992
--- new/fgrep/unix.h Thu Jun 18 15:23:19 1992
***************
*** 50,56 ****
extern void EXFUN(pause, (void));
extern int EXFUN(pipe, (int *));
extern int EXFUN(read, (int, char *, size_t));
! extern int EXFUN(stat, (const char *, struct stat *));
extern int EXFUN(fstat, (int, struct stat *));
extern int EXFUN(umask, (int));
extern int EXFUN(unlink, (const char *));
--- 50,56 ----
extern void EXFUN(pause, (void));
extern int EXFUN(pipe, (int *));
extern int EXFUN(read, (int, char *, size_t));
! /* extern int EXFUN(stat, (char *, struct stat *)); */
extern int EXFUN(fstat, (int, struct stat *));
extern int EXFUN(umask, (int));
extern int EXFUN(unlink, (const char *));