diff --git a/coreutils/tr.c b/coreutils/tr.c
index 752b13b..594962f 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -2,75 +2,59 @@
 /*
  * Mini tr implementation for busybox
  *
+ ** Copyright (c) 1987,1997, Prentice Hall   All rights reserved.
+ *
+ * The name of Prentice Hall may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
  * Copyright (c) Michiel Huisjes
  *
  * This version of tr is adapted from Minix tr and was modified
  * by Erik Andersen <andersen@codepoet.org> to be used in busybox.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Original copyright notice is retained at the end of this file.
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <sys/types.h>
 #include "busybox.h"
 
 #define ASCII 0377
 
 /* some "globals" shared across this file */
 static char com_fl, del_fl, sq_fl;
-static short in_index, out_index;
 /* these last are pointers to static buffers declared in tr_main */
 static unsigned char *poutput;
 static unsigned char *pvector;
 static unsigned char *pinvec, *poutvec;
 
-#define input bb_common_bufsiz1
-
 static void convert(void)
 {
-	short read_chars = 0;
-	short c, coded;
-	short last = -1;
+	int read_chars = 0, in_index = 0, out_index = 0, c, coded, last = -1;
 
 	for (;;) {
+		// If we're out of input, flush output and read more input.
+
 		if (in_index == read_chars) {
-			if ((read_chars = read(0, input, BUFSIZ)) <= 0) {
+			if (out_index) {
+				if (write(1, (char *) poutput, out_index) != out_index)
+					bb_error_msg_and_die(bb_msg_write_error);
+				out_index = 0;
+			}
+
+			if ((read_chars = read(0, bb_common_bufsiz1, BUFSIZ)) <= 0) {
 				if (write(1, (char *) poutput, out_index) != out_index)
 					bb_error_msg(bb_msg_write_error);
 				exit(0);
 			}
 			in_index = 0;
 		}
-		c = input[in_index++];
+		c = bb_common_bufsiz1[in_index++];
 		coded = pvector[c];
 		if (del_fl && pinvec[c])
 			continue;
 		if (sq_fl && last == coded && (pinvec[c] || poutvec[coded]))
 			continue;
 		poutput[out_index++] = last = coded;
-		if (out_index == BUFSIZ) {
-			if (write(1, (char *) poutput, out_index) != out_index)
-				bb_error_msg_and_die(bb_msg_write_error);
-			out_index = 0;
-		}
 	}
 
 	/* NOTREACHED */
@@ -248,57 +232,20 @@
 	}
 
 	if (argv[idx] != NULL) {
-		input_length = expand(argv[idx++], (unsigned char*)input);
+		input_length = expand(argv[idx++], bb_common_bufsiz1);
 		if (com_fl)
-			input_length = complement((unsigned char*)input, input_length);
+			input_length = complement(bb_common_bufsiz1, input_length);
 		if (argv[idx] != NULL) {
 			if (*argv[idx] == '\0')
 				bb_error_msg_and_die("STRING2 cannot be empty");
 			output_length = expand(argv[idx], (unsigned char*)output);
-			map((unsigned char*)input, input_length, (unsigned char*)output, output_length);
+			map(bb_common_bufsiz1, input_length, (unsigned char*)output, output_length);
 		}
 		for (i = 0; i < input_length; i++)
-			invec[(unsigned char)input[i]] = TRUE;
+			invec[bb_common_bufsiz1[i]] = TRUE;
 		for (i = 0; i < output_length; i++)
 			outvec[(unsigned char)output[i]] = TRUE;
 	}
 	convert();
 	return (0);
 }
-
-/*
- * Copyright (c) 1987,1997, Prentice Hall
- * All rights reserved.
- *
- * Redistribution and use of the MINIX operating system in source and
- * binary forms, with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * Neither the name of Prentice Hall nor the names of the software
- * authors or contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
- * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
