Gentoo Archives: gentoo-commits

From: "Naohiro Aota (naota)" <naota@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/namazu/files: namazu-2.0.21-search.patch
Date: Sun, 30 Oct 2011 07:11:46
Message-Id: 20111030071131.94AA02004C@flycatcher.gentoo.org
1 naota 11/10/30 07:11:31
2
3 Added: namazu-2.0.21-search.patch
4 Log:
5 Version bump.
6
7 (Portage version: 2.2.0_alpha71/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-text/namazu/files/namazu-2.0.21-search.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/namazu/files/namazu-2.0.21-search.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/namazu/files/namazu-2.0.21-search.patch?rev=1.1&content-type=text/plain
14
15 Index: namazu-2.0.21-search.patch
16 ===================================================================
17 --- a/nmz/search.c 2011-08-05 09:26:47.000000000 +0900
18 +++ b/nmz/search.c 2011-08-05 09:32:25.000000000 +0900
19 @@ -572,7 +572,7 @@
20 {
21 if (*expr == '*' && expr[strlen(expr) - 1] != '*') {
22 /* If suffix match such as '*bar', enforce it into regex */
23 - strcpy(expr, expr + 1);
24 + memmove(expr, expr + 1, strlen(expr));
25 escape_meta_characters(expr, BUFSIZE * 2);
26 strncat(expr, "$", BUFSIZE * 2 - strlen(expr) - 1);
27 expr[BUFSIZE * 2 - 1] = '\0';
28 @@ -584,7 +584,7 @@
29 expr[BUFSIZE * 2 - 1] = '\0';
30 } else if (*expr == '*' && expr[strlen(expr) - 1] == '*') {
31 /* If internal match such as '*foo*', enforce it into regex */
32 - strcpy(expr, expr + 1);
33 + memmove(expr, expr + 1, strlen(expr));
34 expr[strlen(expr) - 1] = '\0';
35 escape_meta_characters(expr, BUFSIZE * 2);
36 } else if (*expr == '/' && expr[strlen(expr) - 1] == '/') {
37 @@ -592,7 +592,7 @@
38 nmz_debug_printf("do REGEX search\n");
39 /* Genuine regex */
40 /* Remove the both of '/' chars at begging and end of string */
41 - strcpy(expr, expr + 1);
42 + memmove(expr, expr + 1, strlen(expr));
43 expr[strlen(expr) - 1]= '\0';
44 } else {
45 nmz_debug_printf("disabled REGEX search\n");
46 @@ -605,7 +605,7 @@
47 || (*expr == '{' && expr[strlen(expr) - 1] == '}'))
48 {
49 /* Delimiters of field search */
50 - strcpy(expr, expr + 1);
51 + memmove(expr, expr + 1, strlen(expr));
52 expr[strlen(expr) - 1] = '\0';
53 }
54 escape_meta_characters(expr, BUFSIZE * 2);
55 @@ -695,7 +695,7 @@
56 delete_beginning_backslash(char *str)
57 {
58 if (*str == '\\') {
59 - strcpy(str, str + 1);
60 + memmove(str, str + 1, strlen(str));
61 }
62 }
63
64 @@ -935,7 +935,7 @@
65 if ((strlen(str) >= 3 && (*str == '"' && str[strlen(str) - 1] == '"'))
66 || (*str == '{' && str[strlen(str) - 1] == '}'))
67 {
68 - strcpy(str, str + 1);
69 + memmove(str , str + 1, strlen(str));
70 str[strlen(str) - 1]= '\0';
71 }
72 }