diff options
Diffstat (limited to 'src/ckutil.c')
-rw-r--r-- | src/ckutil.c | 6 |
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; } |