From da31bfd28301d63571eccb4abdd6b0a65b05c621 Mon Sep 17 00:00:00 2001 From: gramanas Date: Tue, 20 Nov 2018 13:49:36 +0200 Subject: Add export action, fix util_is_link bug --- src/ckutil.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ckutil.c') diff --git a/src/ckutil.c b/src/ckutil.c index bc86c02..9eed9a5 100644 --- a/src/ckutil.c +++ b/src/ckutil.c @@ -34,7 +34,7 @@ int util_is_dir(const char *path) { } int util_file_exists(const char* path, char *absPath) { - if (!path || !absPath) { + if (!path) { return 0; } struct stat st = {0}; @@ -61,12 +61,12 @@ int util_is_file_link(const char *path) { if (!path) { return 0; } + if (!util_file_exists(path, NULL)) { + return 0; + } struct stat buf; lstat(path, &buf); - if (S_ISLNK(buf.st_mode)) { - return 0; - } - return 1; + return S_ISLNK(buf.st_mode); } void util_mkdir(const char *name) { -- cgit v1.2.3