mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-08-05 21:06:19 -04:00
string comparison issue on win32 #55
This commit is contained in:
parent
9c624ce4e3
commit
dafa7dd36b
@ -236,10 +236,14 @@ namespace util
|
|||||||
FILE *file_from_handle(HANDLE h, const char *mode)
|
FILE *file_from_handle(HANDLE h, const char *mode)
|
||||||
{
|
{
|
||||||
int md;
|
int md;
|
||||||
if (mode == "w") {
|
if (!mode) {
|
||||||
|
throw OSError("invalid_mode", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode[0] == 'w') {
|
||||||
md = _O_WRONLY;
|
md = _O_WRONLY;
|
||||||
}
|
}
|
||||||
else if (mode == "r") {
|
else if (mode[0] == 'r') {
|
||||||
md = _O_RDONLY;
|
md = _O_RDONLY;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
BIN
test/test_split
BIN
test/test_split
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user