From c2cfc65cf219498848ac6a6303ecf7823fbb8270 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Tue, 17 Apr 2018 21:20:57 -0500 Subject: [PATCH] Correct read behavior for unset values and update tests accordingly `read` with IFS empty was expected to set all parameters after the first n filled variables to an empty string, but that was inconsistent with the behavior of `read` everywhere else. I'm not sure why fish differed from the spec with regards to the behavior in the event of an empty IFS: we eschew IFS where possible, yet here we adopt non-standard behavior splitting on every (unicode) character instead of not splitting at all with IFS empty. We still do that, but now the unset variables are treated as they normally would be, i.e. cleared and not set to an empty string (which is what an empty value between two IFS separators would contain). --- tests/read.out | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/read.out b/tests/read.out index d486f4af9..f29e2e1b9 100644 --- a/tests/read.out +++ b/tests/read.out @@ -35,9 +35,9 @@ two 1 'hello' 1 'h' 1 'ello' 1 'h' 1 'e' 1 'llo' -1 '' -1 't' 1 '' -1 't' 1 '' 1 '' +0 +1 't' 0 +1 't' 0 0 1 ' ' 1 't' 2 'hello' 'there'