diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:57:07 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:57:07 +0300 |
commit | 3ca7f0b16d0a5c105380b284a81c6a1b2c210908 (patch) | |
tree | c2153d226b9cba3ebca0c3556b19bf3e52cd20dd /io.c | |
parent | f20ab7c3039a4023f41372bfe4bde3b16d481df7 (diff) | |
download | egawk-3ca7f0b16d0a5c105380b284a81c6a1b2c210908.tar.gz egawk-3ca7f0b16d0a5c105380b284a81c6a1b2c210908.tar.bz2 egawk-3ca7f0b16d0a5c105380b284a81c6a1b2c210908.zip |
Move to gawk-3.0.5.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 30 |
1 files changed, 24 insertions, 6 deletions
@@ -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(); } |