aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index cd42b0d06..33200cea0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1797,8 +1797,13 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
nextarg++; /* pass the @ */
- if(curlx_strequal("-", nextarg))
+ if(curlx_strequal("-", nextarg)) {
file = stdin;
+#ifdef O_BINARY
+ if(subletter == 'b') /* forced binary */
+ setmode(fileno(stdin), O_BINARY);
+#endif
+ }
else {
file = fopen(nextarg, "rb");
if(!file)
@@ -3620,6 +3625,9 @@ operate(struct Configurable *config, int argc, char *argv[])
}
else if(uploadfile && curlx_strequal(uploadfile, "-")) {
+#ifdef O_BINARY
+ setmode(fileno(stdin), O_BINARY);
+#endif
infd = stdin;
}