Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/elfix:master commit in: misc/install-xattr/
Date: Fri, 29 May 2015 11:32:08
Message-Id: 1432899106.d4b136d91ba101673e79836229f3155f502eb056.blueness@gentoo
1 commit: d4b136d91ba101673e79836229f3155f502eb056
2 Author: Jason Zaman <jason <AT> perfinion <DOT> com>
3 AuthorDate: Thu May 28 14:31:00 2015 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Fri May 29 11:31:46 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/elfix.git/commit/?id=d4b136d9
7
8 misc/install-xattr: ignore all whitespace in PORTAGE_XATTR_EXCLUDE
9
10 if the PORTAGE_XATTR_EXCLUDE variable contains whitespace other
11 than just ' ', the matching fails to exclude what comes after it.
12
13 This replaces all whitespace instead of only just space.
14
15 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
16
17 misc/install-xattr/install-xattr.c | 8 ++++++--
18 1 file changed, 6 insertions(+), 2 deletions(-)
19
20 diff --git a/misc/install-xattr/install-xattr.c b/misc/install-xattr/install-xattr.c
21 index b650c67..0b5eb25 100644
22 --- a/misc/install-xattr/install-xattr.c
23 +++ b/misc/install-xattr/install-xattr.c
24 @@ -261,8 +261,12 @@ main(int argc, char* argv[])
25 * strings. Also, no need to free(exclude) before we exit().
26 */
27 char *p = exclude;
28 - while ((p = strchr(p, ' ')))
29 - *p++ = '\0';
30 + char *pend = p + len_exclude;
31 + while (p != pend) {
32 + if (isspace(*p))
33 + *p = '\0';
34 + p++;
35 + }
36
37 opterr = 0; /* we skip many legitimate flags, so silence any warning */