diff options
| author | christos <christos@NetBSD.org> | 2013-02-13 13:58:44 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2013-02-13 13:58:44 +0000 |
| commit | eec036a0c89490f366fd593d8e7f0cc73a45c5e8 (patch) | |
| tree | 049352408963ce7dd5d172d23e41bba25fd63089 /usr.bin/vis | |
| parent | 2fe620abc1321fb1c60b9e4be8e1a2b5fe12cc8c (diff) | |
handle EILSEQ.
Diffstat (limited to 'usr.bin/vis')
| -rw-r--r-- | usr.bin/vis/vis.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c index e2677493e14..003cbdc29a8 100644 --- a/usr.bin/vis/vis.c +++ b/usr.bin/vis/vis.c @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.16 2013/02/13 04:52:31 christos Exp $ */ +/* $NetBSD: vis.c,v 1.17 2013/02/13 13:58:44 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -39,12 +39,13 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\ #if 0 static char sccsid[] = "@(#)vis.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: vis.c,v 1.16 2013/02/13 04:52:31 christos Exp $"); +__RCSID("$NetBSD: vis.c,v 1.17 2013/02/13 13:58:44 christos Exp $"); #endif /* not lint */ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <errno.h> #include <wchar.h> #include <unistd.h> #include <err.h> @@ -162,8 +163,12 @@ process(FILE *fp) char buff[5]; c = getwc(fp); - while (c != EOF) { + if (c == WEOF && errno == EILSEQ) + c = (wint_t)getc(fp); + while (c != WEOF) { rachar = getwc(fp); + if (rachar == WEOF && errno == EILSEQ) + rachar = (wint_t)getc(fp); if (none) { cp = buff; *cp++ = c; |
