home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / GNUGRE.ZIP / fgrep.patch < prev    next >
Text File  |  1992-07-18  |  4KB  |  105 lines

  1. diff -cbr orig/fgrep/fgrep.c new/fgrep/fgrep.c
  2. *** orig/fgrep/fgrep.c    Thu Jun 18 15:41:09 1992
  3. --- new/fgrep/fgrep.c    Thu Jun 18 15:26:24 1992
  4. ***************
  5. *** 444,456 ****
  6.   
  7.   static const char version[] = "GNU fgrep, version 1.1";
  8.   
  9. - #define USAGE \
  10. -   "usage: %s [-[[AB] ]<num>] [-[CVchilnsvwx]] [-[ef]] <expr> [<files...>]\n"
  11.   static void
  12.   usage()
  13.   {
  14. !   fprintf(stderr, USAGE, prog);
  15.     exit(2);
  16.   }
  17.   
  18. --- 444,473 ----
  19.   
  20.   static const char version[] = "GNU fgrep, version 1.1";
  21.   
  22.   static void
  23.   usage()
  24.   {
  25. !   printf("\n%s\n", version);
  26. !   printf("\nUsage: %s [-[[AB]]<num>] [-[CVchilnsvwx]] [-[ef]] <expr> [<files...>]\n", prog);
  27. !   
  28. !   printf("\n  -A <num>  print <num> lines of context after every matching line"
  29. !          "\n  -B <num>  print <num> lines of context before every matching line"
  30. !          "\n  -C        print 2 lines of context on each side of every match"
  31. !          "\n  -<num>    print <num> lines of context on each side"
  32. !          "\n  -V        print the version number on stderr");
  33. !   printf("\n  -b        print every match preceded by its byte offset"
  34. !          "\n  -c        print a total count of matching lines only"
  35. !          "\n  -e <expr> search for <expr>; useful if <expr> begins with -"
  36. !          "\n  -f <file> take <expr> from the given <file>"
  37. !          "\n  -h        don't display filenames on matches");
  38. !   printf("\n  -i        ignore case difference when comparing strings"
  39. !          "\n  -l        list files containing matches only"
  40. !          "\n  -n        print each match preceded by its line number"
  41. !          "\n  -s        run silently producing no output except error messages"
  42. !          "\n  -v        print only lines that contain no matches for the <expr>"
  43. !          "\n  -w        print only lines where the match is a complete word"
  44. !          "\n  -x        print only lines where the match is a whole line\n");
  45. !   
  46.     exit(2);
  47.   }
  48.   
  49. ***************
  50. *** 462,467 ****
  51. --- 479,489 ----
  52.     int count_matches, no_filenames, list_files;
  53.     int opt, cc, desc, count, status;
  54.     FILE *fp;
  55. + #ifdef __EMX__
  56. +   _wildcard(&argc, &argv);
  57. +   setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
  58. + #endif
  59.   
  60.     prog = argv[0];
  61.     if (prog && strrchr(prog, '/'))
  62. diff -cbr orig/fgrep/std.h new/fgrep/std.h
  63. *** orig/fgrep/std.h    Thu Jun 18 15:41:10 1992
  64. --- new/fgrep/std.h    Sun Jan 19 20:06:17 1992
  65. ***************
  66. *** 88,94 ****
  67.   #endif
  68.   
  69.   /* Declaring this here should be safe.  Some losing <errno.h>'s don't. */
  70. ! extern int errno;
  71.   
  72.   /* Adapt variable arguments to new implementations (with <stdarg.h>)
  73.      or old (which are assumed to have <varargs.h>). */
  74. --- 88,94 ----
  75.   #endif
  76.   
  77.   /* Declaring this here should be safe.  Some losing <errno.h>'s don't. */
  78. ! /* extern int errno; */
  79.   
  80.   /* Adapt variable arguments to new implementations (with <stdarg.h>)
  81.      or old (which are assumed to have <varargs.h>). */
  82. diff -cbr orig/fgrep/unix.h new/fgrep/unix.h
  83. *** orig/fgrep/unix.h    Thu Jun 18 15:41:10 1992
  84. --- new/fgrep/unix.h    Thu Jun 18 15:23:19 1992
  85. ***************
  86. *** 50,56 ****
  87.   extern void EXFUN(pause, (void));
  88.   extern int EXFUN(pipe, (int *));
  89.   extern int EXFUN(read, (int, char *, size_t));
  90. ! extern int EXFUN(stat, (const char *, struct stat *));
  91.   extern int EXFUN(fstat, (int, struct stat *));
  92.   extern int EXFUN(umask, (int));
  93.   extern int EXFUN(unlink, (const char *));
  94. --- 50,56 ----
  95.   extern void EXFUN(pause, (void));
  96.   extern int EXFUN(pipe, (int *));
  97.   extern int EXFUN(read, (int, char *, size_t));
  98. ! /* extern int EXFUN(stat, (char *, struct stat *)); */
  99.   extern int EXFUN(fstat, (int, struct stat *));
  100.   extern int EXFUN(umask, (int));
  101.   extern int EXFUN(unlink, (const char *));
  102.  
  103.