summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-10-30 05:12:37 +0100
committerDan McGee <dan@archlinux.org>2007-10-30 05:12:37 +0100
commitbe387148c95ee5ed4e45dc841cd12fee010b998a (patch)
treec8d2c3e2ed04d051a646e35e5c56325c2d73688d /lib/libalpm
parent6af7dbcf72b0e95f7c36b17fac88fd2658c2a8e4 (diff)
downloadpacman-be387148c95ee5ed4e45dc841cd12fee010b998a.tar.gz
pacman-be387148c95ee5ed4e45dc841cd12fee010b998a.tar.xz
libalpm/handle.c: make realpath() call portable
BSD didn't support the NULL second argument GNU extension, so do it the old fashioned way. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/handle.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 5cbb0157..4c18943a 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -285,10 +285,9 @@ int SYMEXPORT alpm_option_set_root(const char *root)
pm_errno = PM_ERR_NOT_A_DIR;
return(-1);
}
- /* According to the man page, realpath is safe to use IFF the second arg is
- * NULL. */
- realroot = realpath(root, NULL);
- if(!realroot) {
+
+ realroot = calloc(PATH_MAX+1, sizeof(char));
+ if(!realpath(root, realroot)) {
pm_errno = PM_ERR_NOT_A_DIR;
return(-1);
}