aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid McKinney <mckinney@subgraph.com>2018-03-24 12:49:15 -0400
committerDavid McKinney <mckinney@subgraph.com>2018-03-24 12:49:15 -0400
commit8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b (patch)
tree5225daac5656458ef06a4ccb0f833f7421d5a880
parent6726f2402dd151d8c2a3ecf808ede89b725f2e24 (diff)
downloadsway-8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b.zip
sway-8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b.tar.gz
sway-8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b.tar.bz2
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 c146bf3..ac1f9cf 100644
--- a/swaybar/tray/icon.c
+++ b/swaybar/tray/icon.c
@@ -28,7 +28,7 @@
/* Finds all themes that the given theme inherits */
static list_t *find_inherits(const char *theme_dir) {
const char inherits[] = "Inherits";
- const char index_name[] = "index.theme";
+ const char index_name[] = "/index.theme";
list_t *themes = create_list();
FILE *index = NULL;
char *path = malloc(strlen(theme_dir) + sizeof(index_name));
@@ -253,6 +253,10 @@ static list_t* find_theme_subdirs(const char *theme_dir) {
}
if (strncmp(directories, buf, sizeof(directories) - 1) == 0) {
char *dirstr = buf + sizeof(directories);
+ int len = strlen(dirstr);
+ if (dirstr[len-1] == '\n') {
+ dirstr[len-1] = '\0';
+ }
dirs = split_subdirs(dirstr);
break;
}