about summary refs log tree commit diff
path: root/compiler/rustc_plugin_impl/src/errors.rs
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-10-22 16:28:09 +0530
committerGitHub <noreply@github.com>2022-10-22 16:28:09 +0530
commitb4536943e391cf175c149ffb72af3a8cce14e803 (patch)
tree16056d36753d8ccb18d62ffa6dfdd29f4b0660a4 /compiler/rustc_plugin_impl/src/errors.rs
parentb22559f547f963df83987dfcf2aeb070a84d42bf (diff)
parentd7b0bcb20f2f7d5f3ea3489d56ece630147e98f5 (diff)
downloadrust-b4536943e391cf175c149ffb72af3a8cce14e803.tar.gz
rust-b4536943e391cf175c149ffb72af3a8cce14e803.zip
Rollup merge of #103360 - ChrisDenton:isterm-filetype, r=thomcc
Reduce false positives in msys2 detection

Currently msys2 will be detected by getting the file path and looking to see if it contains the substrings "msys-" and "-ptr" (or "cygwin-" and "-pty"). This risks false positives, especially with filesystem files and if `GetFileInformationByHandleEx` returns a [full path](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntqueryinformationfile#remarks).

This PR adds a check to see if the handle is a pipe before doing the substring search. Additionally, for "msys2-" or "cygwin-" it only checks if the file name starts with the substring rather than looking at the whole path.
Diffstat (limited to 'compiler/rustc_plugin_impl/src/errors.rs')
0 files changed, 0 insertions, 0 deletions