Merge pull request #21 from JaySon-Huang/master

use `realpath call` instead of `realpath program`
This commit is contained in:
Li, Zeng 2017-05-23 13:15:10 +08:00 committed by GitHub
commit 9874d12c35
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