Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/bti/files: bti-031-nonGNU.patch
Date: Sun, 02 Jun 2013 11:58:10
Message-Id: 20130602115802.A88282171E@flycatcher.gentoo.org
1 pacho 13/06/02 11:58:02
2
3 Added: bti-031-nonGNU.patch
4 Log:
5 Allow compilation on non-GNU systems (#384311 by Fabian Groffen)
6
7 (Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
8
9 Revision Changes Path
10 1.1 net-misc/bti/files/bti-031-nonGNU.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/bti/files/bti-031-nonGNU.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/bti/files/bti-031-nonGNU.patch?rev=1.1&content-type=text/plain
14
15 Index: bti-031-nonGNU.patch
16 ===================================================================
17 Avoid using strchrnul, it's a GNU addition. The code in question,
18 actually doesn't really benefit from strchrnul's behaviour.
19
20 --- config.c
21 +++ config.c
22 @@ -351,20 +351,21 @@
23 * marker if it occurs at the beginning of the line, or after
24 * whitespace
25 */
26 - hashmarker = strchrnul(line, '#');
27 + hashmarker = strchr(line, '#');
28 if (line == hashmarker)
29 line[0] = '\0';
30 else {
31 - while (hashmarker[0] != '\0') {
32 + while (hashmarker != NULL) {
33 --hashmarker;
34 - if (isblank(hashmarker[0]))
35 + if (isblank(hashmarker[0])) {
36 hashmarker[0] = '\0';
37 - else {
38 + break;
39 + } else {
40 /*
41 * false positive; '#' occured
42 * within a string
43 */
44 - hashmarker = strchrnul(hashmarker+2, '#');
45 + hashmarker = strchr(hashmarker+2, '#');
46 }
47 }
48 }