Merge pull request #4051 from orestisfl/format-placeholders

placeholder_t: Make char*s const
next
Ingo Bürk 2020-05-01 09:43:43 +02:00 committed by GitHub
commit e58f104f1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -543,9 +543,9 @@ int mkdirp(const char *path, mode_t mode);
/** Helper structure for usage in format_placeholders(). */
typedef struct placeholder_t {
/* The placeholder to be replaced, e.g., "%title". */
char *name;
const char *name;
/* The value this placeholder should be replaced with. */
char *value;
const char *value;
} placeholder_t;
/**

View File

@ -2318,11 +2318,11 @@ i3String *con_parse_title_format(Con *con) {
char *formatted_str = format_placeholders(con->title_format, &placeholders[0], num);
i3String *formatted = i3string_from_utf8(formatted_str);
i3string_set_markup(formatted, pango_markup);
FREE(formatted_str);
for (size_t i = 0; i < num; i++) {
FREE(placeholders[i].value);
}
free(formatted_str);
free(title);
free(class);
free(instance);
return formatted;
}