From: David Bremner <[email protected]>
According to the docs for realpath, it will allocate its own buffer
(of up to size PATH_MAX) using malloc. This may incur a small performance
penalty, but avoids a build problem on Debian GNU/Hurd, where PATH_MAX is not
available.
---
This patch should apply to syncevolution 1.1
src/syncevo/util.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/syncevo/util.cpp b/src/syncevo/util.cpp
index b4dfd18..e492941 100644
--- a/src/syncevo/util.cpp
+++ b/src/syncevo/util.cpp
@@ -117,9 +117,10 @@ void splitPath(const string &path, string &dir, string
&file)
bool relToAbs(string &path)
{
- char buffer[PATH_MAX+1];
- if (realpath(path.c_str(), buffer)) {
+ char *buffer=NULL;
+ if (buffer = realpath(path.c_str(), NULL)) {
path = buffer;
+ free(buffer);
return true;
} else {
return false;
--
1.7.2.3
_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution