From 8d95d2f924b79c7d8070a58fbf3cc604c8a0f75b Mon Sep 17 00:00:00 2001 From: David McKinney Date: Sat, 24 Mar 2018 12:49:15 -0400 Subject: Fixed missing icons bug in index.theme parsing and a path concatenation bug in find_inherits() --- swaybar/tray/icon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'swaybar/tray') 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 @@ /* 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; } -- cgit v1.2.3-70-g09d2