diff options
author | sheldonh <sheldonh@FreeBSD.org> | 2000-08-15 10:20:01 +0000 |
---|---|---|
committer | sheldonh <sheldonh@FreeBSD.org> | 2000-08-15 10:20:01 +0000 |
commit | ead30e83239251cba3bf2fd08387ab9e4963dbe7 (patch) | |
tree | 5c1a0591b207b79e7c7e516579c1b388ec83dda5 /contrib/awk/io.c | |
parent | 792b8cf13bc2b5ee80901c58a42b4389c12a4af6 (diff) | |
download | FreeBSD-src-ead30e83239251cba3bf2fd08387ab9e4963dbe7.zip FreeBSD-src-ead30e83239251cba3bf2fd08387ab9e4963dbe7.tar.gz |
Merge the vendor release of gawk-3.0.6 onto HEAD.
This addresses one known problem in the PR database.
PR: 13921
Reported by: Jin Guojun <j_guojun@lbl.gov>
Diffstat (limited to 'contrib/awk/io.c')
-rw-r--r-- | contrib/awk/io.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/contrib/awk/io.c b/contrib/awk/io.c index 0a24f8a..a83fc9d 100644 --- a/contrib/awk/io.c +++ b/contrib/awk/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. @@ -479,6 +479,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) { @@ -491,6 +500,13 @@ int *errflg; else if (errno == 0) /* HACK! */ close_one(); #endif +#ifdef VMS + /* Alpha/VMS V7.1's C RTL is returning this instead + of EMFILE (haven't tried other post-V6.2 systems) */ +#define SS$_EXQUOTA 0x001C + else if (errno == EIO && vaxc$errno == SS$_EXQUOTA) + close_one(); +#endif else { /* * Some other reason for failure. @@ -628,10 +644,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); @@ -650,6 +662,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) @@ -1953,8 +1970,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(); } |