From 99e713db55510dbbcb53596e887b01b67b65781f Mon Sep 17 00:00:00 2001 From: Jonatan Liljedahl Date: Mon, 21 Nov 2011 00:42:47 +0100 Subject: [PATCH] Revert "Fix sc_ResolveIfAlias() on linux, return the original path if nonexistent." The fix should be in sc_StandardizePath instead. This reverts commit 2a67c6787396c38dc094a64590c7de9daff3fe30. --- common/SC_DirUtils.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/SC_DirUtils.cpp b/common/SC_DirUtils.cpp index f057f9b31..f5ba229a9 100644 --- a/common/SC_DirUtils.cpp +++ b/common/SC_DirUtils.cpp @@ -202,15 +202,13 @@ int sc_ResolveIfAlias(const char *path, char *returnPath, bool &isAlias, int len } } #elif defined(__linux__) || defined(__FreeBSD__) - char *resolvedPath; isAlias = sc_IsSymlink(path); - if (resolvedPath = realpath(path, NULL)) + if (realpath(path, returnPath)) { - strcpy(returnPath, resolvedPath); - free(resolvedPath); return 0; } + return -1; #endif strcpy(returnPath, path); return 0; -- 2.11.4.GIT