i3lock-color

The world's most popular non-default computer lockscreen.
Index Commits Files Refs README LICENSE
commit 684db97e83a2e7f57721854c8ce03421240c2075
parent 966b2b1b503ad41818e72990235323649fd7da99
Author: Cassandra Fox <cass@fox.mom>
Date:   Thu, 30 May 2019 07:13:02 -0700

Merge pull request #121 from mortie/i3lock-color-feature/directory-fix

Treat anything that's not a directory as a file
Diffstat:
Mi3lock.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/i3lock.c b/i3lock.c
@@ -262,10 +262,10 @@ bool bar_reversed = false;
 /*
  * Checks if the given path leads to an actual file or something else, e.g. a directory
  */
-int is_regular_file(const char *path) {
+int is_directory(const char *path) {
     struct stat path_stat;
     stat(path, &path_stat);
-    return S_ISREG(path_stat.st_mode);
+    return !S_ISDIR(path_stat.st_mode);
 }
 
 /*
@@ -1956,7 +1956,7 @@ int main(int argc, char *argv[]) {
 
     init_colors_once();
     if (image_path != NULL) {
-        if (is_regular_file(image_path)) {
+        if (!is_directory(image_path)) {
             img = load_image(image_path);
         } else {
             /* Path to a directory is provided -> use slideshow mode */