Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure we use value of FS at the time the record was read #194

Open
benhoyt opened this issue Jun 20, 2023 · 0 comments
Open

Ensure we use value of FS at the time the record was read #194

benhoyt opened this issue Jun 20, 2023 · 0 comments

Comments

@benhoyt
Copy link
Owner

benhoyt commented Jun 20, 2023

I just read this comment in onetrueawk's lib.c, and GoAWK (I think) doesn't do this and probably has this issue.

/*
 * POSIX specifies that fields are supposed to be evaluated as if they were
 * split using the value of FS at the time that the record's value ($0) was
 * read.
 *
 * Since field-splitting is done lazily, we save the current value of FS
 * whenever a new record is read in (implicitly or via getline), or when
 * a new value is assigned to $0.
 */
void savefs(void)
benhoyt added a commit that referenced this issue Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant