main: do not munge variables which already contain sysroot_dir in their output (maybe related to #69)

pull/70/head
William Pitcock 2014-07-09 02:00:13 -05:00
parent 12ff14f856
commit 3d98bd7ff6
1 changed files with 4 additions and 2 deletions

6
main.c
View File

@ -292,7 +292,8 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
{
memset(req->buf, 0, sizeof(req->buf));
if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX))
if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
(sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
strlcat(req->buf, sysroot_dir, sizeof(req->buf));
strlcat(req->buf, var, sizeof(req->buf));
@ -301,7 +302,8 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
strlcat(req->buf, " ", sizeof(req->buf));
if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX))
if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
(sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
strlcat(req->buf, sysroot_dir, sizeof(req->buf));
strlcat(req->buf, var, sizeof(req->buf));