void-packages/srcpkgs/xbps/patches/0002-xbps-create-8-calculate-correctly-target-file-for-re.patch

27 lines
817 B
Diff

From d6605e1b97fcec16169c788b9bd35d269134d1ca Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Mon, 27 May 2013 10:27:55 +0200
Subject: [PATCH] xbps-create(8): calculate correctly target file for relative
symlinks.
---
NEWS | 2 ++
bin/xbps-create/main.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c
index 9a6c2be..2a2373d 100644
--- bin/xbps-create/main.c
+++ bin/xbps-create/main.c
@@ -237,7 +237,7 @@ ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf)
*/
xe->target = strdup(buf);
} else {
- xe->target = strdup(p + strlen(destdir));
+ xe->target = strdup(p + strlen(destdir) - 1);
free(p);
}
} else if (strchr(buf, '/') == NULL) {
--
1.8.3