commit: d4b136d91ba101673e79836229f3155f502eb056
Author: Jason Zaman <jason <AT> perfinion <DOT> com>
AuthorDate: Thu May 28 14:31:00 2015 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri May 29 11:31:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/elfix.git/commit/?id=d4b136d9
misc/install-xattr: ignore all whitespace in PORTAGE_XATTR_EXCLUDE
if the PORTAGE_XATTR_EXCLUDE variable contains whitespace other
than just ' ', the matching fails to exclude what comes after it.
This replaces all whitespace instead of only just space.
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
misc/install-xattr/install-xattr.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/misc/install-xattr/install-xattr.c
b/misc/install-xattr/install-xattr.c
index b650c67..0b5eb25 100644
--- a/misc/install-xattr/install-xattr.c
+++ b/misc/install-xattr/install-xattr.c
@@ -261,8 +261,12 @@ main(int argc, char* argv[])
* strings. Also, no need to free(exclude) before we exit().
*/
char *p = exclude;
- while ((p = strchr(p, ' ')))
- *p++ = '\0';
+ char *pend = p + len_exclude;
+ while (p != pend) {
+ if (isspace(*p))
+ *p = '\0';
+ p++;
+ }
opterr = 0; /* we skip many legitimate flags, so silence any warning */