summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fetch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fetch.c b/src/fetch.c
index 09b4e97..5cea5db 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -90,7 +90,9 @@ static int fetch_package(struct fetch_ctx *fctx,
fd = STDOUT_FILENO;
} else {
if ((fctx->flags & FETCH_LINK) && apk_url_local_file(infile)) {
- if (link(infile, outfile) == 0)
+ char real_infile[256];
+ readlink(infile, real_infile, sizeof(real_infile));
+ if (link(real_infile, outfile) == 0)
return 0;
}
fd = creat(outfile, 0644);