1 |
vapier 10/09/28 16:53:47 |
2 |
|
3 |
Added: busybox-1.17.1-grep.patch busybox-1.17.1-date.patch |
4 |
Log: |
5 |
Move .config setup to src_prepare, fix from upstream for nano timestamps #335947 by Sergio Costas, and propagate strict aliasing workaround for stable preparation. |
6 |
|
7 |
(Portage version: 2.2_rc86/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-apps/busybox/files/busybox-1.17.1-grep.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/busybox-1.17.1-grep.patch?rev=1.1&view=markup |
13 |
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 |
14 |
|
15 |
Index: busybox-1.17.1-grep.patch |
16 |
=================================================================== |
17 |
diff -urpN busybox-1.17.1/findutils/grep.c busybox-1.17.1-grep/findutils/grep.c |
18 |
--- busybox-1.17.1/findutils/grep.c 2010-07-06 04:25:54.000000000 +0200 |
19 |
+++ busybox-1.17.1-grep/findutils/grep.c 2010-08-23 02:37:08.000000000 +0200 |
20 |
@@ -461,15 +461,19 @@ static int grep_file(FILE *file) |
21 |
if (found) |
22 |
print_line(gl->pattern, strlen(gl->pattern), linenum, ':'); |
23 |
} else while (1) { |
24 |
+ unsigned start = gl->matched_range.rm_so; |
25 |
unsigned end = gl->matched_range.rm_eo; |
26 |
+ unsigned len = end - start; |
27 |
char old = line[end]; |
28 |
line[end] = '\0'; |
29 |
- print_line(line + gl->matched_range.rm_so, |
30 |
- end - gl->matched_range.rm_so, |
31 |
- linenum, ':'); |
32 |
+ /* Empty match is not printed: try "echo test | grep -o ''" */ |
33 |
+ if (len != 0) |
34 |
+ print_line(line + start, len, linenum, ':'); |
35 |
if (old == '\0') |
36 |
break; |
37 |
line[end] = old; |
38 |
+ if (len == 0) |
39 |
+ end++; |
40 |
#if !ENABLE_EXTRA_COMPAT |
41 |
if (regexec(&gl->compiled_regex, line + end, |
42 |
1, &gl->matched_range, REG_NOTBOL) != 0) |
43 |
diff -urpN busybox-1.17.1/testsuite/grep.tests busybox-1.17.1-grep/testsuite/grep.tests |
44 |
--- busybox-1.17.1/testsuite/grep.tests 2010-07-06 04:25:54.000000000 +0200 |
45 |
+++ busybox-1.17.1-grep/testsuite/grep.tests 2010-08-23 02:37:08.000000000 +0200 |
46 |
@@ -98,5 +98,9 @@ testing "grep -o does not loop forever" |
47 |
'grep -o "[^/]*$"' \ |
48 |
"test\n" \ |
49 |
"" "/var/test\n" |
50 |
+testing "grep -o does not loop forever on zero-length match" \ |
51 |
+ 'grep -o "" | head -n1' \ |
52 |
+ "" \ |
53 |
+ "" "test\n" |
54 |
|
55 |
exit $FAILCOUNT |
56 |
|
57 |
|
58 |
|
59 |
1.1 sys-apps/busybox/files/busybox-1.17.1-date.patch |
60 |
|
61 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/busybox-1.17.1-date.patch?rev=1.1&view=markup |
62 |
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 |
63 |
|
64 |
Index: busybox-1.17.1-date.patch |
65 |
=================================================================== |
66 |
http://bugs.gentoo.org/335947 |
67 |
|
68 |
From f2da16f451812f40bed51fd60a304df3d7dfc1bd Mon Sep 17 00:00:00 2001 |
69 |
From: Denys Vlasenko <vda.linux@××××××××××.com> |
70 |
Date: Sun, 6 Jun 2010 17:53:48 +0200 |
71 |
Subject: [PATCH] date: make FEATURE_NANO compile on glibc systems |
72 |
|
73 |
Signed-off-by: Denys Vlasenko <vda.linux@××××××××××.com> |
74 |
--- |
75 |
coreutils/date.c | 6 +++++- |
76 |
1 files changed, 5 insertions(+), 1 deletions(-) |
77 |
|
78 |
diff --git a/coreutils/date.c b/coreutils/date.c |
79 |
index c599df7..3d78a53 100644 |
80 |
--- a/coreutils/date.c |
81 |
+++ b/coreutils/date.c |
82 |
@@ -204,7 +204,11 @@ int date_main(int argc UNUSED_PARAM, char **argv) |
83 |
xstat(filename, &statbuf); |
84 |
ts.tv_sec = statbuf.st_mtime; |
85 |
#if ENABLE_FEATURE_DATE_NANO |
86 |
- ts.tv_nsec = statbuf.st_mtim.tv_nsec; |
87 |
+# if defined __GLIBC__ && !defined __UCLIBC__ |
88 |
+ ts.tv_nsec = statbuf.st_mtim.tv_nsec; |
89 |
+# else |
90 |
+ ts.tv_nsec = statbuf.st_mtimensec; |
91 |
+# endif |
92 |
#endif |
93 |
} else { |
94 |
#if ENABLE_FEATURE_DATE_NANO |
95 |
-- |
96 |
1.7.3 |