all repos — tint2 @ 3811929a6e076c65c9156dabe04b82a642b8821b

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Fix desktop entry parsing (issue #570)
o9000 mrovi9000@gmail.com
commit

3811929a6e076c65c9156dabe04b82a642b8821b

parent

85a97a9cabd4b519c645f226b247d4bf541916f2

1 files changed, 4 insertions(+), 3 deletions(-)

jump to
M src/launcher/apps-common.csrc/launcher/apps-common.c

@@ -136,14 +136,15 @@ printf("\n");

// we currently do not know about any Name key at all, so use an invalid index int lang_index = lang_index_default + 1; - int inside_desktop_entry = 0; + gboolean inside_desktop_entry = 0; char *line = NULL; size_t line_size; while (getline(&line, &line_size, fp) >= 0) { int len = strlen(line); if (len == 0) continue; - line[len - 1] = '\0'; + if (line[len - 1] == '\n') + line[len - 1] = '\0'; if (line[0] == '[') { inside_desktop_entry = (strcmp(line, "[Desktop Entry]") == 0); }

@@ -169,7 +170,7 @@ } else if (!entry->exec && strcmp(key, "Exec") == 0) {

entry->exec = strdup(value); } else if (!entry->icon && strcmp(key, "Icon") == 0) { entry->icon = strdup(value); - } else if (!entry->icon && strcmp(key, "NoDisplay") == 0) { + } else if (strcmp(key, "NoDisplay") == 0) { entry->hidden_from_menus = strcasecmp(value, "true") == 0; } }