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