https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212033
--- Comment #4 from Ingo Schwarze <[email protected]> --- (In reply to Andrey Chernov from comment #2) > Moreover, the whole code is broken for empty input, > it returns NULL instead of pointer to L'\0' No, the code is correct in *that* respect. Empty input means we are at EOF right away. At EOF, the function is documented to return NULL without setting errno or the stdio error indicator. Returning L"" means there is an empty line, and an empty line is not the same as empty input. For example: Empty line: Reading from the pipe 'printf "\n" |' returns L"" to the first call of fgetwln(3) and NULL to the second. Empty input: Reading from the pipe 'printf "" |' returns NULL to the first call of fgetwln(3). -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "[email protected]"
