aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-19 20:07:47 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-19 20:09:59 +0200
commitaf354e92111769d57e43eb4f1825c0d99c894ddb (patch)
treef48b14461064fd77218bb9c1790d7257b41a90fb
parenta6d12b403eec9f3fddc0fa82325dac04826c4b48 (diff)
downloadutil-linux-af354e92111769d57e43eb4f1825c0d99c894ddb.tar.gz
agetty: Don't override TERM passed by the user
Before 4869b259d68f65ea88df625ce8df9c0177d55a01, any TERM passed on the agetty command line would be used instead of the default TERM. After 4869b259d68f65ea88df625ce8df9c0177d55a01, the default TERM is used unconditionally. Fix the regression by checking if the user passed a custom TERM. Fixes: 4869b259d68f65ea88df625ce8df9c0177d55a01
-rw-r--r--term-utils/agetty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index ff5123dbf6..6d461b6f1f 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -1196,7 +1196,8 @@ static void open_tty(const char *tty, struct termios *tp, struct options *op)
#endif
}
- op->term = get_terminal_default_type(op->tty, !(op->flags & F_VCONSOLE));
+ if (!op->term)
+ op->term = get_terminal_default_type(op->tty, !(op->flags & F_VCONSOLE));
if (!op->term)
log_err(_("failed to allocate memory: %m"));