]> git.ipfire.org Git - thirdparty/make.git/commit
[WINDOWS32] Remove CRNL from FormatMessage() result string
authorPaul Smith <psmith@gnu.org>
Mon, 19 Dec 2022 05:20:06 +0000 (00:20 -0500)
committerPaul Smith <psmith@gnu.org>
Mon, 19 Dec 2022 05:20:06 +0000 (00:20 -0500)
commit89427039c3b8204e7e86a5caa1522a2756872d4f
tree8c51b11c8a96e203ea588f4201cca6be5a6e34d5
parent7d8756a4a369fcc389ada4d916d6b687b8391eee
[WINDOWS32] Remove CRNL from FormatMessage() result string

Sometimes the error message is expected to contain a newline, other
times it is not.  Also the result of FormatMessage() sometimes ends
in CRNL already: when printed via fprintf() the final newline is
converted to CRNL, giving an output of CRCRNL which causes tests
to fail to match.  Remove any CR/NL chars from the result string.

* src/job.c (reap_children): Add \n to the error message fprintf.
(exec_command): Ditto.
* src/w32/subproc/w32err.c (map_windows32_error_to_string): Remove
any trailing CR or NL from the string before returning.
src/job.c
src/w32/subproc/sub_proc.c
src/w32/subproc/w32err.c