Module Name: src Committed By: kre Date: Thu Oct 5 20:33:31 UTC 2023
Modified Files: src/bin/sh: miscbltin.c Log Message: If the read builtin is told to read into IFS, we must avoid doing that until all current uses of IFS are complete (as we have IFS's value cached in ifs - if IFS alters, ifs might point anywhere). Handle this by deferring assignments to IFS until everything is done. This makes us appear to comply with the (currently) proposed requirement for read by POSIX that field splitting complete before vars are assigned. (Other shells, like dash, ksh93, yash, bosh behave like this) That might end up being unspecified though, as other shells (bosh, mksh) assign each field to its var as it is delimited (though bosh appears to have bugs). If we wanted to go that route, the issue here could have been handled by re-doing the init of ifs after every setvar() that is performed here (except the last, after which it is no longer needed). XXX pullup -10 To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/bin/sh/miscbltin.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.