diff sources/patches/toybox-grep.patch @ 1805:bbe71b3a271d draft

Upgrade toybox and musl versions.
author Rob Landley <rob@landley.net>
date Wed, 04 Nov 2015 00:14:29 -0600
parents 0494012aca6d
children
line wrap: on
line diff
--- a/sources/patches/toybox-grep.patch	Mon Nov 02 01:15:36 2015 -0600
+++ b/sources/patches/toybox-grep.patch	Wed Nov 04 00:14:29 2015 -0600
@@ -2,23 +2,24 @@
 happen in glibc, musl, or bionic, so it's not worth adding a workaround
 upstream.
 
-diff -r dbee4e656aa6 toys/posix/grep.c
---- a/toys/posix/grep.c	Thu Mar 26 13:25:20 2015 -0500
-+++ b/toys/posix/grep.c	Fri Mar 27 20:10:08 2015 -0500
-@@ -62,16 +62,21 @@
- 
+diff --git a/toys/posix/grep.c b/toys/posix/grep.c
+index d44a92d..b9c2def 100644
+--- a/toys/posix/grep.c
++++ b/toys/posix/grep.c
+@@ -63,7 +63,8 @@ GLOBALS(
+ // Show matches in one file
  static void do_grep(int fd, char *name)
  {
 -  FILE *file = fdopen(fd, "r");
 +  struct stat *st = (void *)(toybuf+sizeof(regex_t));
 +  FILE *file = 0;
    long offset = 0;
-   int lcount = 0, mcount = 0, which = toys.optflags & FLAG_w ? 2 : 0;
+   int lcount = 0, mcount = 0;
    char indelim = '\n' * !(toys.optflags&FLAG_z),
-        outdelim = '\n' * !(toys.optflags&FLAG_Z);
+@@ -71,8 +72,13 @@ static void do_grep(int fd, char *name)
  
    if (!fd) name = "(standard input)";
--
+ 
 +  if (!fstat(fd, st)) {
 +    // grep * hits directories, skip but don't treat them as errors.
 +    if (S_ISDIR(st->st_mode)) errno = 0;
@@ -30,13 +31,3 @@
      return;
    }
  
-@@ -88,8 +93,7 @@
- 
-     start = line;
- 
--    for (;;)
--    {
-+    for (;;) {
-       int rc = 0, skip = 0;
- 
-       if (toys.optflags & FLAG_F) {