char *icon_theme_name;
XSettingsClient *xsettings_client;
-#define ICON_FALLBACK "exec"
+#define ICON_FALLBACK "application-x-executable"
char *icon_path(Launcher *launcher, const char *icon_name, int size);
void launcher_load_themes(Launcher *launcher);
int launcher_read_desktop_file(const char *path, DesktopEntry *entry)
{
FILE *fp;
- char line[4096];
+ char *line = NULL;
+ size_t line_size;
char *key, *value;
entry->name = entry->icon = entry->exec = NULL;
return 0;
}
- while (fgets(line, sizeof(line), fp) != NULL) {
+ while (getline(&line, &line_size, fp) >= 0) {
int len = strlen(line);
if (len == 0)
continue;
expand_exec(entry, path);
+ free(line);
return 1;
}
IconTheme *theme;
char *file_name;
FILE *f;
- char line[2048];
+ char *line = NULL;
+ size_t line_size;
if (name == NULL)
return NULL;
IconThemeDir *current_dir = NULL;
int inside_header = 1;
- while (fgets(line, sizeof(line), f) != NULL) {
+ while (getline(&line, &line_size, f) >= 0) {
char *key, *value;
int line_len = strlen(line);
}
fclose(f);
+ free(line);
+
return theme;
}