pkgtools

morpheus pkg tools
git clone git://git.2f30.org/pkgtools.git
Log | Files | Refs | README | LICENSE

commit a848f47036cc6edca573c6ca5f6787da16fff659
parent 89a198c8e55c2da7551a237392fa796eb2a6fddf
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sat Jun 21 00:35:52 +0200

if realpath fails use normal path

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>

Diffstat:
db.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/db.c b/db.c @@ -257,7 +257,8 @@ pkg_load(struct db *db, const char *filename) estrlcpy(path, db->prefix, sizeof(path)); estrlcat(path, "/", sizeof(path)); estrlcat(path, buf, sizeof(path)); - realpath(path, pe->path); + if(!realpath(path, pe->path)) + estrlcpy(pe->path, path, sizeof(pe->path)); estrlcpy(pe->rpath, buf, sizeof(pe->rpath)); pe->next = pkg->head; pkg->head = pe; @@ -325,7 +326,8 @@ pkg_load_file(struct db *db, const char *filename) estrlcat(path, "/", sizeof(path)); estrlcat(path, archive_entry_pathname(entry), sizeof(path)); - realpath(path, pe->path); + if(!realpath(path, pe->path)) + estrlcpy(pe->path, path, sizeof(pe->path)); estrlcpy(pe->rpath, archive_entry_pathname(entry), sizeof(pe->rpath)); pe->next = pkg->head;