]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: support simplified color sequences in \e{name}
authorKarel Zak <kzak@redhat.com>
Mon, 27 Feb 2023 16:52:45 +0000 (17:52 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 27 Feb 2023 16:52:45 +0000 (17:52 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.c

index d8d4f4259fa6d1ea85eafb2bf919a240f98444be..cf8725537b98a8e2824828b6c49d76bbaabb32e5 100644 (file)
@@ -2736,9 +2736,12 @@ static void output_special_char(struct issue *ie,
                char escname[UL_COLORNAME_MAXSZ];
 
                if (get_escape_argument(fp, escname, sizeof(escname))) {
-                       const char *esc = color_sequence_from_colorname(escname);
-                       if (esc)
+                       char *esc = color_get_sequence(escname);
+
+                       if (esc) {
                                fputs(esc, ie->output);
+                               free(esc);
+                       }
                } else
                        fputs("\033", ie->output);
                break;