mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-18 03:40:37 +01:00
cli: honor and prefer color schemes with ".scheme" extension
According to `man terminal-colors.d`, the extension should be ".scheme"
and not ".schem". Prefer that, but keep honoring ".schem" file, if it
exists.
https://bugzilla.redhat.com/show_bug.cgi?id=1886336
(cherry picked from commit f1830ab0de)
This commit is contained in:
parent
dfd54b7f2e
commit
aab2775acf
1 changed files with 14 additions and 4 deletions
|
|
@ -344,11 +344,21 @@ check_colors_check_enabled_one_file(const char *base_dir, const char *name, cons
|
|||
static char *
|
||||
check_colors_check_palette_one_file(const char *base_dir, const char *name, const char *term)
|
||||
{
|
||||
gs_free char *filename = check_colors_construct_filename(base_dir, name, term, "schem");
|
||||
char * contents;
|
||||
static const char *const extensions[] = {
|
||||
"scheme",
|
||||
"schem",
|
||||
};
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS(extensions); i++) {
|
||||
gs_free char *filename = NULL;
|
||||
char * contents;
|
||||
|
||||
filename = check_colors_construct_filename(base_dir, name, term, extensions[i]);
|
||||
if (g_file_get_contents(filename, &contents, NULL, NULL))
|
||||
return contents;
|
||||
}
|
||||
|
||||
if (g_file_get_contents(filename, &contents, NULL, NULL))
|
||||
return contents;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue