From 726f69e29ca9d4842f3acb20fffd2466fda62c09 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:33 +0100 Subject: Imported from util-linux-2.5 tarball. --- misc-utils/write.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'misc-utils/write.c') diff --git a/misc-utils/write.c b/misc-utils/write.c index f2fe4a086..a1865bd71 100644 --- a/misc-utils/write.c +++ b/misc-utils/write.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Jef Poskanzer and Craig Leres of the Lawrence Berkeley Laboratory. @@ -40,13 +40,13 @@ */ #ifndef lint -char copyright[] = -"@(#) Copyright (c) 1989 The Regents of the University of California.\n\ - All rights reserved.\n"; +static char copyright[] = +"@(#) Copyright (c) 1989, 1993\n\ + The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)write.c 4.22 (Berkeley) 6/1/90"; +static char sccsid[] = "@(#)write.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #include @@ -61,6 +61,8 @@ static char sccsid[] = "@(#)write.c 4.22 (Berkeley) 6/1/90"; #include #ifdef __linux__ #include +#include "pathnames.h" +#include #endif extern int errno; @@ -76,6 +78,10 @@ main(argc, argv) char tty[MAXPATHLEN], *mytty, *ttyname(); void done(); +#ifdef __linux__ + setlocale(LC_CTYPE,""); +#endif + /* check that sender has write enabled */ if (isatty(fileno(stdin))) myttyfd = fileno(stdin); @@ -329,7 +335,7 @@ wr_fputs(s) #define PUTC(c) if (putchar(c) == EOF) goto err; for (; *s != '\0'; ++s) { - c = toascii(*s); + c = *s; if (c == '\n') { PUTC('\r'); PUTC('\n'); -- cgit v1.2.3-55-g7522