Blame util-linux-2.12p-col-EILSEQ.patch
|
|
bfef844 |
--- util-linux-2.13-pre6/text-utils/col.c.kzak 2002-03-09 00:05:12.000000000 +0100
|
|
|
bfef844 |
+++ util-linux-2.13-pre6/text-utils/col.c 2006-02-21 22:25:48.000000000 +0100
|
|
|
632f494 |
@@ -128,6 +128,7 @@
|
|
|
632f494 |
int this_line; /* line l points to */
|
|
|
632f494 |
int nflushd_lines; /* number of lines that were flushed */
|
|
|
632f494 |
int adjust, opt, warned;
|
|
|
632f494 |
+ int ret = 0;
|
|
|
632f494 |
|
|
|
632f494 |
setlocale(LC_ALL, "");
|
|
|
632f494 |
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
|
bfef844 |
@@ -175,8 +176,16 @@
|
|
|
632f494 |
cur_line = max_line = nflushd_lines = this_line = 0;
|
|
|
632f494 |
cur_set = last_set = CS_NORMAL;
|
|
|
632f494 |
lines = l = alloc_line();
|
|
|
632f494 |
-
|
|
|
632f494 |
- while ((ch = getwchar()) != WEOF) {
|
|
|
632f494 |
+
|
|
|
632f494 |
+ while (feof(stdin)==0) {
|
|
|
632f494 |
+ errno = 0;
|
|
|
632f494 |
+ if ((ch = getwchar()) == WEOF) {
|
|
|
bfef844 |
+ if (errno==EILSEQ) {
|
|
|
632f494 |
+ perror("col");
|
|
|
bfef844 |
+ ret = 1;
|
|
|
bfef844 |
+ }
|
|
|
632f494 |
+ break;
|
|
|
632f494 |
+ }
|
|
|
632f494 |
if (!iswgraph(ch)) {
|
|
|
632f494 |
switch (ch) {
|
|
|
632f494 |
case BS: /* can't go back further */
|
|
|
bfef844 |
@@ -332,7 +341,7 @@
|
|
|
632f494 |
flush_blanks();
|
|
|
632f494 |
if (ferror(stdout) || fclose(stdout))
|
|
|
632f494 |
return 1;
|
|
|
632f494 |
- return 0;
|
|
|
632f494 |
+ return ret;
|
|
|
632f494 |
}
|
|
|
632f494 |
|
|
|
632f494 |
void flush_lines(int nflush)
|