diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:35:31 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:35:31 +0300 |
commit | 8ceb5f934787eb7be5fb452fb39179df66119954 (patch) | |
tree | 56a80fc5c118f7c2ebad7ab44bd8be048b2f7ec2 /field.c | |
parent | 2f83a4e72166e811a9f0b4726c19a3d5a0b17dcb (diff) | |
download | egawk-8ceb5f934787eb7be5fb452fb39179df66119954.tar.gz egawk-8ceb5f934787eb7be5fb452fb39179df66119954.tar.bz2 egawk-8ceb5f934787eb7be5fb452fb39179df66119954.zip |
Move to gawk-2.15.6.
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(); +} |