Fix off by one in `y' (transliterate) command which caused the last character

of the pattern space not to be examined.

Noticed by:	Motoyuki Konno <motoyuki@bsdclub.org>
This commit is contained in:
Tim J. Robbins 2002-06-24 11:24:02 +00:00
parent 742e9f76c3
commit d1a1392d8f

View File

@ -244,7 +244,7 @@ redirect:
case 'y':
if (pd || psl == 0)
break;
for (p = ps, len = psl; --len; ++p)
for (p = ps, len = psl; len--; ++p)
*p = cp->u.y[(unsigned char)*p];
break;
case ':':