summaryrefslogtreecommitdiffstats
path: root/misc-utils/write.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:33 +0100
committerKarel Zak2006-12-07 00:25:33 +0100
commit726f69e29ca9d4842f3acb20fffd2466fda62c09 (patch)
treeabbc1b6e9bfb0dfe32e81a83648e261ccb2d5a5f /misc-utils/write.c
parentImported from util-linux-2.2 tarball. (diff)
downloadkernel-qcow2-util-linux-726f69e29ca9d4842f3acb20fffd2466fda62c09.tar.gz
kernel-qcow2-util-linux-726f69e29ca9d4842f3acb20fffd2466fda62c09.tar.xz
kernel-qcow2-util-linux-726f69e29ca9d4842f3acb20fffd2466fda62c09.zip
Imported from util-linux-2.5 tarball.
Diffstat (limited to 'misc-utils/write.c')
-rw-r--r--misc-utils/write.c20
1 files changed, 13 insertions, 7 deletions
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 <sys/param.h>
@@ -61,6 +61,8 @@ static char sccsid[] = "@(#)write.c 4.22 (Berkeley) 6/1/90";
#include <string.h>
#ifdef __linux__
#include <paths.h>
+#include "pathnames.h"
+#include <locale.h>
#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');