Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/tr Restore preexisting wrong behavior of tr -c (tran...



details:   https://anonhg.NetBSD.org/src/rev/b89915b73e7e
branches:  trunk
changeset: 789192:b89915b73e7e
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Aug 11 00:11:46 2013 +0000

description:
Restore preexisting wrong behavior of tr -c (translates all characters
to the last letter in string2) instead of a different wrong behavior
(translates all characters to 0xff) accidentally just introduced.

diffstat:

 usr.bin/tr/tr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r efe8052f0221 -r b89915b73e7e usr.bin/tr/tr.c
--- a/usr.bin/tr/tr.c   Sun Aug 11 00:05:49 2013 +0000
+++ b/usr.bin/tr/tr.c   Sun Aug 11 00:11:46 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tr.c,v 1.12 2013/08/11 00:05:49 dholland Exp $ */
+/*     $NetBSD: tr.c,v 1.13 2013/08/11 00:11:46 dholland Exp $ */
 
 /*
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)tr.c       8.2 (Berkeley) 5/4/95";
 #endif
-__RCSID("$NetBSD: tr.c,v 1.12 2013/08/11 00:05:49 dholland Exp $");
+__RCSID("$NetBSD: tr.c,v 1.13 2013/08/11 00:11:46 dholland Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -223,7 +223,7 @@
 
        if (cflag)
                for (cnt = 0, p = string1; cnt < NCHARS; ++p, ++cnt)
-                       *p = *p == OOBCH ? ch : cnt;
+                       *p = *p == OOBCH ? ch2 : cnt;
 
        if (sflag)
                for (lastch = OOBCH; (ch = getchar()) != EOF;) {



Home | Main Index | Thread Index | Old Index