- Applied upstream patch to fix '-D skip' (bug #189580).

This commit is contained in:
Tim Waugh 2006-05-31 09:01:15 +00:00
parent a8485b3c26
commit 35b335f11c
2 changed files with 48 additions and 1 deletions

42
grep-skip.patch Normal file
View File

@ -0,0 +1,42 @@
--- grep-2.5.1a/src/grep.c.skip 2006-05-31 09:26:58.000000000 +0100
+++ grep-2.5.1a/src/grep.c 2006-05-31 09:28:24.000000000 +0100
@@ -261,19 +261,6 @@
bufbeg[-1] = eolbyte;
bufdesc = fd;
- if (fstat (fd, &stats->stat) != 0)
- {
- error (0, errno, "fstat");
- return 0;
- }
- if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
- return 0;
-#ifndef DJGPP
- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
-#else
- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
-#endif
- return 0;
if (S_ISREG (stats->stat.st_mode))
{
if (file)
@@ -875,6 +862,19 @@
}
else
{
+ if (stat (file, &stats->stat) != 0)
+ {
+ suppressible_error (file, errno);
+ return 1;
+ }
+ if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
+ return 1;
+#ifndef DJGPP
+ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
+#else
+ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
+#endif
+ return 1;
while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
continue;

View File

@ -1,7 +1,7 @@
Summary: The GNU versions of grep pattern matching utilities. Summary: The GNU versions of grep pattern matching utilities.
Name: grep Name: grep
Version: 2.5.1 Version: 2.5.1
Release: 53 Release: 54
License: GPL License: GPL
Group: Applications/Text Group: Applications/Text
Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}a.tar.bz2 Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}a.tar.bz2
@ -12,6 +12,7 @@ Patch3: grep-2.5.1-oi.patch
Patch4: grep-2.5.1-manpage.patch Patch4: grep-2.5.1-manpage.patch
Patch5: grep-2.5.1-color.patch Patch5: grep-2.5.1-color.patch
Patch6: grep-2.5.1-icolor.patch Patch6: grep-2.5.1-icolor.patch
Patch7: grep-skip.patch
Patch10: grep-2.5.1-egf-speedup.patch Patch10: grep-2.5.1-egf-speedup.patch
Patch11: grep-2.5.1-dfa-optional.patch Patch11: grep-2.5.1-dfa-optional.patch
Patch12: grep-2.5.1-tests.patch Patch12: grep-2.5.1-tests.patch
@ -40,6 +41,7 @@ utility for searching through text.
%patch4 -p1 -b .manpage %patch4 -p1 -b .manpage
%patch5 -p1 -b .color %patch5 -p1 -b .color
%patch6 -p1 -b .icolor %patch6 -p1 -b .icolor
%patch7 -p1 -b .skip
%patch10 -p1 -b .egf-speedup %patch10 -p1 -b .egf-speedup
%patch11 -p1 -b .dfa-optional %patch11 -p1 -b .dfa-optional
%patch12 -p1 -b .tests %patch12 -p1 -b .tests
@ -94,6 +96,9 @@ fi
%{_mandir}/*/* %{_mandir}/*/*
%changelog %changelog
* Wed May 31 2006 Tim Waugh <twaugh@redhat.com> 2.5.1-54
- Applied upstream patch to fix '-D skip' (bug #189580).
* Mon Feb 20 2006 Tim Waugh <twaugh@redhat.com> 2.5.1-53 * Mon Feb 20 2006 Tim Waugh <twaugh@redhat.com> 2.5.1-53
- Applied Tim Robbins' patch for 'grep -w' (bug #179698). - Applied Tim Robbins' patch for 'grep -w' (bug #179698).