summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar David McKinney <mckinney@subgraph.com>2018-03-24 12:49:15 -0400
committerLibravatar David McKinney <mckinney@subgraph.com>2018-03-24 12:49:15 -0400
commit8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b (patch)
tree5225daac5656458ef06a4ccb0f833f7421d5a880
parentRemove hackathon notice from README (diff)
downloadsway-8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b.tar.gz
sway-8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b.tar.zst
sway-8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b.zip
Fixed missing icons bug in index.theme parsing and a path concatenation bug in find_inherits()
-rw-r--r--swaybar/tray/icon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/swaybar/tray/icon.c b/swaybar/tray/icon.c
index c146bf32..ac1f9cf9 100644
--- a/swaybar/tray/icon.c
+++ b/swaybar/tray/icon.c
@@ -28,7 +28,7 @@
28/* Finds all themes that the given theme inherits */ 28/* Finds all themes that the given theme inherits */
29static list_t *find_inherits(const char *theme_dir) { 29static list_t *find_inherits(const char *theme_dir) {
30 const char inherits[] = "Inherits"; 30 const char inherits[] = "Inherits";
31 const char index_name[] = "index.theme"; 31 const char index_name[] = "/index.theme";
32 list_t *themes = create_list(); 32 list_t *themes = create_list();
33 FILE *index = NULL; 33 FILE *index = NULL;
34 char *path = malloc(strlen(theme_dir) + sizeof(index_name)); 34 char *path = malloc(strlen(theme_dir) + sizeof(index_name));
@@ -253,6 +253,10 @@ static list_t* find_theme_subdirs(const char *theme_dir) {
253 } 253 }
254 if (strncmp(directories, buf, sizeof(directories) - 1) == 0) { 254 if (strncmp(directories, buf, sizeof(directories) - 1) == 0) {
255 char *dirstr = buf + sizeof(directories); 255 char *dirstr = buf + sizeof(directories);
256 int len = strlen(dirstr);
257 if (dirstr[len-1] == '\n') {
258 dirstr[len-1] = '\0';
259 }
256 dirs = split_subdirs(dirstr); 260 dirs = split_subdirs(dirstr);
257 break; 261 break;
258 } 262 }