Mihail Konev
2016-11-12 02:21:07 UTC
A function for mingw-w64 is being proposed,
that would distinguish between an ordinary named pipe,
and a mintty-like stdin.
(Needed for mingw-w64 packages that rely on isatty()/fstat(stdin)
to work correctly if they are launched not from cmd.exe console).
Currently, it checks the ObjectNameInformation for
- possible "\\?\" in front of string
- "\Device\NamedPipe\"
- any characters afterwards
- "-pty[0-9]+-"
- allowing anything afterwards
Is the check correct?
In particular, should it put any restrictions
on what is before and after the -pty%d- (slashes, non-[-a-z0-9] ?)
that would distinguish between an ordinary named pipe,
and a mintty-like stdin.
(Needed for mingw-w64 packages that rely on isatty()/fstat(stdin)
to work correctly if they are launched not from cmd.exe console).
Currently, it checks the ObjectNameInformation for
- possible "\\?\" in front of string
- "\Device\NamedPipe\"
- any characters afterwards
- "-pty[0-9]+-"
- allowing anything afterwards
Is the check correct?
In particular, should it put any restrictions
on what is before and after the -pty%d- (slashes, non-[-a-z0-9] ?)