summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:57:07 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:57:07 +0300
commit3ca7f0b16d0a5c105380b284a81c6a1b2c210908 (patch)
treec2153d226b9cba3ebca0c3556b19bf3e52cd20dd /io.c
parentf20ab7c3039a4023f41372bfe4bde3b16d481df7 (diff)
downloadgawk-3ca7f0b16d0a5c105380b284a81c6a1b2c210908.tar.gz
Move to gawk-3.0.5.gawk-3.0.5
Diffstat (limited to 'io.c')
-rw-r--r--io.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/io.c b/io.c
index 5000aa94..69c87840 100644
--- a/io.c
+++ b/io.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1976, 1988, 1989, 1991-1999 the Free Software Foundation, Inc.
+ * Copyright (C) 1976, 1988, 1989, 1991-2000 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -477,6 +477,15 @@ int *errflg;
}
if (rp->fp != NULL && isatty(fd))
rp->flag |= RED_NOBUF;
+ /* Move rp to the head of the list. */
+ if (red_head != rp) {
+ if ((rp->prev->next = rp->next) != NULL)
+ rp->next->prev = rp->prev;
+ red_head->prev = rp;
+ rp->prev = NULL;
+ rp->next = red_head;
+ red_head = rp;
+ }
}
}
if (rp->fp == NULL && rp->iop == NULL) {
@@ -626,10 +635,6 @@ int exitwarn;
what = ((rp->flag & RED_PIPE) != 0) ? "pipe" : "file";
- if (exitwarn)
- warning("no explicit close of %s `%s' provided",
- what, rp->value);
-
/* SVR4 awk checks and warns about status of close */
if (status != 0) {
char *s = strerror(errno);
@@ -648,6 +653,11 @@ int exitwarn;
ERRNO_node->var_value = make_string(s, strlen(s));
}
}
+
+ if (exitwarn)
+ warning("no explicit close of %s `%s' provided",
+ what, rp->value);
+
if (rp->next != NULL)
rp->next->prev = rp->prev;
if (rp->prev != NULL)
@@ -1951,8 +1961,16 @@ set_RS()
}
if (RS->stlen == 0)
RS_is_null = TRUE;
- else if (RS->stlen > 1)
+ else if (RS->stlen > 1) {
+ static int warned = FALSE;
+
RS_regexp = make_regexp(RS->stptr, RS->stlen, IGNORECASE, TRUE);
+ if (do_lint && ! warned) {
+ warning("multicharacter value of `RS' is not portable");
+ warned = TRUE;
+ }
+ }
+
set_FS_if_not_FIELDWIDTHS();
}