use `realpath call` instead of `realpath program`

This commit is contained in:
JaySon-Huang 2017-05-20 15:56:12 +08:00
parent 56976b7cbd
commit 20795b7256
1 changed files with 4 additions and 4 deletions

View File

@ -9,6 +9,7 @@
=============================================================================*/
#include "Util.h"
#include "limits.h"
using namespace std;
@ -887,10 +888,9 @@ Util::getSystemOutput(string cmd)
string
Util::getExactPath(const char *str)
{
string cmd = "realpath ";
cmd += string(str);
return getSystemOutput(cmd);
char resolved_path[PATH_MAX];
realpath(str, resolved_path);
return resolved_path;
}
void