public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-apps/busybox/files: busybox-1.17.1-grep.patch busybox-1.17.1-date.patch
@ 2010-09-28 16:53 Mike Frysinger (vapier)
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2010-09-28 16:53 UTC (permalink / raw
  To: gentoo-commits

vapier      10/09/28 16:53:47

  Added:                busybox-1.17.1-grep.patch busybox-1.17.1-date.patch
  Log:
  Move .config setup to src_prepare, fix from upstream for nano timestamps #335947 by Sergio Costas, and propagate strict aliasing workaround for stable preparation.
  
  (Portage version: 2.2_rc86/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  sys-apps/busybox/files/busybox-1.17.1-grep.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/busybox-1.17.1-grep.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/busybox-1.17.1-grep.patch?rev=1.1&content-type=text/plain

Index: busybox-1.17.1-grep.patch
===================================================================
diff -urpN busybox-1.17.1/findutils/grep.c busybox-1.17.1-grep/findutils/grep.c
--- busybox-1.17.1/findutils/grep.c	2010-07-06 04:25:54.000000000 +0200
+++ busybox-1.17.1-grep/findutils/grep.c	2010-08-23 02:37:08.000000000 +0200
@@ -461,15 +461,19 @@ static int grep_file(FILE *file)
 						if (found)
 							print_line(gl->pattern, strlen(gl->pattern), linenum, ':');
 					} else while (1) {
+						unsigned start = gl->matched_range.rm_so;
 						unsigned end = gl->matched_range.rm_eo;
+						unsigned len = end - start;
 						char old = line[end];
 						line[end] = '\0';
-						print_line(line + gl->matched_range.rm_so,
-								end - gl->matched_range.rm_so,
-								linenum, ':');
+						/* Empty match is not printed: try "echo test | grep -o ''" */
+						if (len != 0)
+							print_line(line + start, len, linenum, ':');
 						if (old == '\0')
 							break;
 						line[end] = old;
+						if (len == 0)
+							end++;
 #if !ENABLE_EXTRA_COMPAT
 						if (regexec(&gl->compiled_regex, line + end,
 								1, &gl->matched_range, REG_NOTBOL) != 0)
diff -urpN busybox-1.17.1/testsuite/grep.tests busybox-1.17.1-grep/testsuite/grep.tests
--- busybox-1.17.1/testsuite/grep.tests	2010-07-06 04:25:54.000000000 +0200
+++ busybox-1.17.1-grep/testsuite/grep.tests	2010-08-23 02:37:08.000000000 +0200
@@ -98,5 +98,9 @@ testing "grep -o does not loop forever" 
 	'grep -o "[^/]*$"' \
 	"test\n" \
 	"" "/var/test\n"
+testing "grep -o does not loop forever on zero-length match" \
+	'grep -o "" | head -n1' \
+	"" \
+	"" "test\n"
 
 exit $FAILCOUNT



1.1                  sys-apps/busybox/files/busybox-1.17.1-date.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/busybox-1.17.1-date.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/busybox-1.17.1-date.patch?rev=1.1&content-type=text/plain

Index: busybox-1.17.1-date.patch
===================================================================
http://bugs.gentoo.org/335947

From f2da16f451812f40bed51fd60a304df3d7dfc1bd Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Sun, 6 Jun 2010 17:53:48 +0200
Subject: [PATCH] date: make FEATURE_NANO compile on glibc systems

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 coreutils/date.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/coreutils/date.c b/coreutils/date.c
index c599df7..3d78a53 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -204,7 +204,11 @@ int date_main(int argc UNUSED_PARAM, char **argv)
 		xstat(filename, &statbuf);
 		ts.tv_sec = statbuf.st_mtime;
 #if ENABLE_FEATURE_DATE_NANO
-		ts.tv_nsec = statbuf.st_mtim.tv_nsec;
+# if defined __GLIBC__ && !defined __UCLIBC__
+		ts.tv_nsec = statbuf.st_mtim.tv_nsec;
+# else
+		ts.tv_nsec = statbuf.st_mtimensec;
+# endif
 #endif
 	} else {
 #if ENABLE_FEATURE_DATE_NANO
-- 
1.7.3







^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-28 16:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28 16:53 [gentoo-commits] gentoo-x86 commit in sys-apps/busybox/files: busybox-1.17.1-grep.patch busybox-1.17.1-date.patch Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox