Path: utzoo!telly!philmtl!uunet!tut.cis.ohio-state.edu!kailand.kai.com!pwolfe From: pwolfe@kailand.kai.com (Patrick Wolfe) Newsgroups: gnu.bash.bug Subject: fixed bug with IC and im in termcap Message-ID: <8912040001.AA04781@kailand.kai.com> Date: 4 Dec 89 00:01:36 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: Kuck and Associates, 1906 Fox Drive, Champaign IL USA 61820, voice 217-356-2288, fax 217-356-5199 Lines: 94 I fixed the bug in readline that I reported yesterday that caused command line editing problems on terminals with both IC (or ic) and im defined in the termcap entry. Enclosed you will find a context diff of readline.c that fixes this problem. The first difference is where one duplicate command is deleted. The second is in the "start_insert" subroutine. If both "im" (enter insert mode) and "IC" or "ic" (insert blank characters) were defined, insert mode was entered AND some blank characters were inserted. My fix adds an "else", so if you have insert mode, use it, otherwise use insert blank characters. Patrick Wolfe System Manager, Kuck & Associates work: pwolfe@kailand.kai.com or uunet!kailand!pwolfe home: pat@pawnix.kai.com or uunet!kailand!pawnix!pat =================================================================== RCS file: readline.c,v retrieving revision 1.1 diff -c -r1.1 readline.c *** /tmp/,RCSt1004592 Sun Dec 3 16:47:03 1989 --- readline.c Sun Dec 3 11:11:54 1989 *************** *** 1833,1839 **** term_IC = tgetstr ("IC", &buffer); term_ic = tgetstr ("ic", &buffer); term_ip = tgetstr ("ip", &buffer); - term_IC = tgetstr ("IC", &buffer); /* "An application program can assume that the terminal can do character insertion if *any one of* the capabilities `IC', --- 1833,1838 ---- *************** *** 1890,1910 **** start_insert (count) int count; { ! if (term_im && *term_im) tputs (term_im, 1, output_character_function); ! ! if (term_IC && *term_IC && ! (count > 1 || !term_ic || !*term_ic)) ! { ! char *tgoto (), *buffer; ! buffer = tgoto (term_IC, 0, count); ! tputs (buffer, 1, output_character_function); ! } ! else ! { ! if (term_ic && *term_ic) ! while (count--) ! tputs (term_ic, 1, output_character_function); } } --- 1889,1915 ---- start_insert (count) int count; { ! if (term_im && *term_im) /* if we have an insert mode, use it */ tputs (term_im, 1, output_character_function); ! else { ! /* ! * else if we have a function to insert multiple characters at once, ! * or there is no single character insert function ! * use it to insert blanks (which will be overwritten later) ! */ ! if (term_IC && *term_IC && ! (count > 1 || !term_ic || !*term_ic)) ! { ! char *tgoto (), *buffer; ! buffer = tgoto (term_IC, 0, count); ! tputs (buffer, 1, output_character_function); ! } ! else ! { /* call single character insert function multiple times */ ! if (term_ic && *term_ic) ! while (count--) ! tputs (term_ic, 1, output_character_function); ! } } } -- Patrick Wolfe System Manager, Kuck & Associates work: pwolfe@kailand.kai.com or uunet!kailand!pwolfe home: pat@pawnix.kai.com or uunet!kailand!pawnix!pat