From be387148c95ee5ed4e45dc841cd12fee010b998a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 29 Oct 2007 23:12:37 -0500 Subject: 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 --- lib/libalpm/handle.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/libalpm') 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); } -- cgit v1.2.3-24-g4f1b