aboutsummaryrefslogtreecommitdiffstats
path: root/src/ckutil.c
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-09-18 19:18:01 +0300
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-09-18 19:18:01 +0300
commit8702ce8bbd4d1435cc81fa8fcd7f5309d3c7b003 (patch)
tree8ce1b6f62ee2cd7d527f23928b20e7b2a1853388 /src/ckutil.c
parentaf17ead850f90cf6e4476aa74975e68d7293fb27 (diff)
downloadck-8702ce8bbd4d1435cc81fa8fcd7f5309d3c7b003.tar.gz
ck-8702ce8bbd4d1435cc81fa8fcd7f5309d3c7b003.tar.bz2
ck-8702ce8bbd4d1435cc81fa8fcd7f5309d3c7b003.zip
VC and secret dir are now stored with absolute path
Diffstat (limited to 'src/ckutil.c')
-rw-r--r--src/ckutil.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ckutil.c b/src/ckutil.c
index 74a6b00..880696b 100644
--- a/src/ckutil.c
+++ b/src/ckutil.c
@@ -10,6 +10,7 @@
* -------------------------------------------------------------------------- */
#include <ctype.h>
#include <dirent.h>
+#include <limits.h>
#include <fcntl.h>
#include <libgen.h>
#include <sys/sendfile.h>
@@ -39,11 +40,14 @@ void util_replace_slash_with_uscore(char *s) {
}
}
-int util_file_exists(const char* path) {
+int util_file_exists(const char* path, char *absPath) {
struct stat st = {0};
if (stat(path, &st) == -1) {
return 0;
}
+ if (absPath != NULL) {
+ realpath(path, absPath);
+ }
return 1;
}