diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-11-20 13:49:36 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-11-20 13:49:36 +0200 |
commit | da31bfd28301d63571eccb4abdd6b0a65b05c621 (patch) | |
tree | 33e0054d00927bd9dcfaabad41fdea53624c7b8e /src/ckutil.c | |
parent | 78ee1c72c670a71bfd165448676fc65bff802916 (diff) | |
download | ck-da31bfd28301d63571eccb4abdd6b0a65b05c621.tar.gz ck-da31bfd28301d63571eccb4abdd6b0a65b05c621.tar.bz2 ck-da31bfd28301d63571eccb4abdd6b0a65b05c621.zip |
Add export action, fix util_is_link bug
Diffstat (limited to 'src/ckutil.c')
-rw-r--r-- | src/ckutil.c | 10 |
1 files changed, 5 insertions, 5 deletions
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) { |