all repos — tint2 @ 639ccbf16cadb327de67e6e4c2295802e83cc27b

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

Allow long lines in tint2conf
o9000 mrovi9000@gmail.com
commit

639ccbf16cadb327de67e6e4c2295802e83cc27b

parent

4d12abdb4263d6875b069e7b2c214e65a7c1edac

3 files changed, 21 insertions(+), 19 deletions(-)

jump to
M src/config.csrc/config.c

@@ -1178,20 +1178,21 @@ }

gboolean config_read_file(const char *path) { - FILE *fp; - char line[512]; - char *key, *value; - - if ((fp = fopen(path, "r")) == NULL) + FILE *fp = fopen(path, "r"); + if (!fp) return FALSE; - while (fgets(line, sizeof(line), fp) != NULL) { + char* line = NULL; + size_t line_size = 0; + while (getline(&line, &line_size, fp) >= 0) { + char *key, *value; if (parse_line(line, &key, &value)) { add_entry(key, value); free(key); free(value); } } + free(line); fclose(fp); if (!read_panel_position) {
M src/execplugin/execplugin.csrc/execplugin/execplugin.c

@@ -643,6 +643,7 @@ close(pipe_fd[1]);

close(pipe_fd[0]); return; } else if (child == 0) { + fprintf(stderr, "Executing: %s\n", execp->backend->command); // We are in the child close(pipe_fd[0]); dup2(pipe_fd[1], 1); // 1 is stdout
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -38,13 +38,6 @@ num_bg = 0;

background_create_new(); gradient_create_new(GRADIENT_CONFIG_VERTICAL); - FILE *fp; - char line[512]; - char *key, *value; - - if ((fp = fopen(path, "r")) == NULL) - return; - config_has_panel_items = 0; config_has_battery = 0; config_battery_enabled = 0;

@@ -54,14 +47,21 @@ no_items_clock_enabled = 0;

no_items_systray_enabled = 0; no_items_battery_enabled = 0; - while (fgets(line, sizeof(line), fp) != NULL) { - if (parse_line(line, &key, &value)) { - add_entry(key, value); - free(key); - free(value); + FILE *fp = fopen(path, "r"); + if (fp) { + char* line = NULL; + size_t line_size = 0; + while (getline(&line, &line_size, fp) >= 0) { + char *key, *value; + if (parse_line(line, &key, &value)) { + add_entry(key, value); + free(key); + free(value); + } } + free(line); + fclose(fp); } - fclose(fp); finalize_gradient(); finalize_bg();