mirror of https://github.com/aria2/aria2
mingw32: Fix bug that aria2 does not read piped stdin
parent
c659fe939d
commit
bd0a3960df
|
@ -46,7 +46,9 @@ namespace aria2 {
|
|||
BufferedFile::BufferedFile(const char* filename, const char* mode)
|
||||
:
|
||||
#ifdef __MINGW32__
|
||||
fp_(a2fopen(utf8ToWChar(filename).c_str(), utf8ToWChar(mode).c_str())),
|
||||
fp_(strcmp(DEV_STDIN, filename) == 0 ?
|
||||
stdin : a2fopen(utf8ToWChar(filename).c_str(),
|
||||
utf8ToWChar(mode).c_str())),
|
||||
#else // !__MINGW32__
|
||||
fp_(a2fopen(filename, mode)),
|
||||
#endif // !__MINGW32__
|
||||
|
|
|
@ -49,9 +49,10 @@ GZipFile::GZipFile(const char* filename, const char* mode)
|
|||
{
|
||||
FILE* fp =
|
||||
#ifdef __MINGW32__
|
||||
a2fopen(utf8ToWChar(filename).c_str(), utf8ToWChar(mode).c_str());
|
||||
strcmp(DEV_STDIN, filename) == 0 ?
|
||||
stdin : a2fopen(utf8ToWChar(filename).c_str(), utf8ToWChar(mode).c_str());
|
||||
#else // !__MINGW32__
|
||||
a2fopen(filename, mode);
|
||||
a2fopen(filename, mode);
|
||||
#endif // !__MINGW32__
|
||||
|
||||
if (fp) {
|
||||
|
|
Loading…
Reference in New Issue