Merge pull request #21 from JaySon-Huang/master
use `realpath call` instead of `realpath program`
This commit is contained in:
commit
9874d12c35
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue