Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
child_process: remove extra newline in errors
checkExecSyncError() creates error objects for execSync() and execFileSync(). If the child process created stderr output, then it is attached to the end of the error message. However, stderr can be an empty Buffer object, which always passes the truthy check, leading to an extra newline in the error message. This commit adds a length check, which will work with both strings and Buffers. PR-URL: nodejs#9343 Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
- Loading branch information