From a4c7cc9f12b90dea84713345e26ee2811431e46d Mon Sep 17 00:00:00 2001 From: Garance A Drosehn Date: Mon, 17 Sep 2001 02:35:34 +0000 Subject: [PATCH] Fix so that lpc's interactive-mode will not be confused by EditLine processing into thinking that there is a print-queue called 'xterm'... Reviewed by: short discussion on freebsd-stable MFC after: 1 week --- usr.sbin/lpr/lpc/lpc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c index d5a1160fc94c..5c890f42f096 100644 --- a/usr.sbin/lpr/lpc/lpc.c +++ b/usr.sbin/lpr/lpc/lpc.c @@ -169,6 +169,15 @@ cmdscanner(void) el_set(el, EL_PROMPT, lpc_prompt); el_set(el, EL_SIGNAL, 1); el_source(el, NULL); + /* + * EditLine init may call 'cgetset()' to set a + * capability-db meant for termcap (eg: to set + * terminal type 'xterm'). Reset that now, or + * that same db-information will be used for + * printcap (giving us an "xterm" printer, with + * all kinds of invalid capabilities...). + */ + cgetset(NULL); } if ((bp = el_gets(el, &num)) == NULL || num == 0) quit(0, NULL);