diff options
Diffstat (limited to 'field.c')
-rw-r--r-- | field.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. @@ -298,6 +298,16 @@ NODE *n; if (len == 0) return nf; + /* + * Nasty special case. If FS set to "", return whole record + * as first field. This is not worth a separate function. + */ + if (fs->stlen == 0) { + (*set)(++nf, *buf, len, n); + *buf += len; + return nf; + } + /* before doing anything save the char at *end */ sav = *end; /* because it will be destroyed now: */ @@ -676,3 +686,10 @@ set_FIELDWIDTHS() } FIELDWIDTHS[i] = -1; } + +void +set_FS_if_not_FIELDWIDTHS() +{ + if (parse_field != fw_parse_field) + set_FS(); +} |