home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / GNUGREP / PATCHES.OS2 < prev    next >
Text File  |  1994-05-20  |  3KB  |  89 lines

  1. Only in new: patches.os2
  2. Only in new: Makefile
  3. Only in new: grep.def
  4. Only in new: gnugrep.def
  5. Only in new: gnuregex.def
  6. Only in new: main.c
  7. diff -cb orig/grep.c new/grep.c
  8. *** orig/grep.c    Sun May 23 06:52:52 1993
  9. --- new/grep.c    Mon Jul 05 21:53:30 1993
  10. ***************
  11. *** 368,373 ****
  12. --- 368,374 ----
  13.     if (out_byte)
  14.       printf("%lu%c", totalcc + (beg - bufbeg), sep);
  15.     fwrite(beg, 1, lim - beg, stdout);
  16. +   fflush(stdout);
  17.     if (ferror(stdout))
  18.       error("writing output", errno);
  19.     lastout = lim;
  20. ***************
  21. *** 566,577 ****
  22.   static char version[] = "GNU grep version 2.0";
  23.   
  24.   #define USAGE \
  25. !   "usage: %s [-[[AB] ]<num>] [-[CEFGVchilnqsvwx]] [-[ef]] <expr> [<files...>]\n"
  26.   
  27.   static void
  28.   usage()
  29.   {
  30. !   fprintf(stderr, USAGE, prog);
  31.     exit(2);
  32.   }
  33.   
  34. --- 566,600 ----
  35.   static char version[] = "GNU grep version 2.0";
  36.   
  37.   #define USAGE \
  38. !   "Usage: %s [-[[AB] ]<num>] [-[CEFGVLbchilnqsvwxy]] [-[ef]] <expr> [<files...>]\n"
  39.   
  40.   static void
  41.   usage()
  42.   {
  43. !   printf("\n%s\n\n", version);
  44. !   printf(USAGE, prog);
  45. !   printf(
  46. !   "  -G -E -F  behave like grep, egrep, fgrep\n"
  47. !   "  -<num>    print <num> lines of context on each side\n"
  48. !   "  -A <num>  print <num> lines of context after every matching line\n"
  49. !   "  -B <num>  print <num> lines of context before every matching line\n"
  50. !   "  -e <expr> search for <expr>; useful if <expr> begins with -\n"
  51. !   "  -f <file> take <expr> from the given <file>\n"
  52. !   "  -C        print 2 lines of context on each side of every match\n"
  53. !   "  -V        print the version number on stderr\n"
  54. !   "  -b        print every match preceded by its byte offset\n"
  55. !   "  -c        print a total count of matching lines only\n"
  56. !   "  -h        don't display filenames on matches\n"
  57. !   "  -i -y     ignore case difference when comparing strings\n"
  58. !   "  -l        list files containing matches only\n"
  59. !   "  -L        like -l but list files that don't contain matches\n"
  60. !   "  -n        print each match preceded by its line number\n"
  61. !   "  -q        be quiet\n"
  62. !   "  -s        run silently producing no output except error messages\n"
  63. !   "  -v        print only lines that contain no matches for the <expr>\n"
  64. !   "  -w        print only lines where the match is a complete word\n"
  65. !   "  -x        print only lines where the match is a whole line\n");
  66.     exit(2);
  67.   }
  68.   
  69. ***************
  70. *** 605,610 ****
  71. --- 628,643 ----
  72.     FILE *fp;
  73.     extern char *optarg;
  74.     extern int optind;
  75. + #ifdef __EMX__
  76. +   _wildcard(&argc, &argv);
  77. +   setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
  78. +   if ((prog = strrchr(argv[0], '.')) != NULL && stricmp(prog, ".exe") == 0)
  79. +     *prog = 0;
  80. +   if ((prog = strrchr(argv[0], '\\')) != NULL)
  81. +     *prog = '/';
  82. +   strlwr(argv[0]);
  83. + #endif
  84.   
  85.     prog = argv[0];
  86.     if (prog && strrchr(prog, '/'))
  87.