*BSD News Article 12940


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!usc!cs.utexas.edu!uunet!not-for-mail
From: sef@Kithrup.COM (Sean Eric Fagan)
Newsgroups: comp.os.386bsd.bugs
Subject: bug in kern/tty.c
Date: 17 Mar 1993 17:05:08 -0800
Organization: Kithrup Enterprises, Ltd.
Lines: 27
Sender: sef@ftp.UU.NET
Message-ID: <1o8hs4INNfas@ftp.UU.NET>
NNTP-Posting-Host: ftp.uu.net

Type:

	a a a a a<control-w>

(or whatever your word-erase character is).  It will remove two
a's, not just one.  Not exactly correct.  This patch fixes it,
and has even been tested :).

*** tty.c.~1~	Wed Mar 17 10:46:14 1993
--- tty.c	Wed Mar 17 10:46:30 1993
***************
*** 993,998 ****
--- 993,1005 ----
  			c = unputc(&tp->t_raw);
  			if (c == -1)
  				goto endcase;
+ 			/*
+ 			 * Handle one-letter word cases.
+ 			 */
+ 			if (c == ' ' || c == '\t') {
+ 				putc(c, &tp->t_raw);
+ 				goto endcase;
+ 			}
  			ctype = ISALPHA(c);
  			/*
  			 * erase rest of word