mirror of
https://github.com/curl/curl.git
synced 2026-07-28 16:53:11 +03:00
lib: make CURLX_SET_BINMODE() and use it
Use it from libtests' `first.c` and thus also from units, and tunits. Also: - cmake: drop stray `curltool` lib dependency for units. - units: stop depending on `src` headers. - tests/server: drop depending on `src` headers. (the remaining one listed in the comments, `tool_xattr.h`, was not actually used from servers.) - tests/server: drop duplicate curlx headers. (Except `warnless.h`, which is tricky on Windows.) Closes #17672
This commit is contained in:
parent
35d0c047ce
commit
916f241f2f
18 changed files with 29 additions and 44 deletions
|
|
@ -24,7 +24,6 @@
|
|||
#include "tool_setup.h"
|
||||
|
||||
#include <curlx.h>
|
||||
#include "tool_binmode.h"
|
||||
#include "tool_cfgable.h"
|
||||
#include "tool_cb_prg.h"
|
||||
#include "tool_filetime.h"
|
||||
|
|
@ -625,7 +624,7 @@ static ParameterError data_urlencode(struct GlobalConfig *global,
|
|||
/* a '@' letter, it means that a filename or - (stdin) follows */
|
||||
if(!strcmp("-", p)) {
|
||||
file = stdin;
|
||||
CURL_SET_BINMODE(stdin);
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
}
|
||||
else {
|
||||
file = fopen(p, "rb");
|
||||
|
|
@ -901,7 +900,7 @@ static ParameterError set_data(cmdline_t cmd,
|
|||
if(!strcmp("-", nextarg)) {
|
||||
file = stdin;
|
||||
if(cmd == C_DATA_BINARY) /* forced data-binary */
|
||||
CURL_SET_BINMODE(stdin);
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
}
|
||||
else {
|
||||
file = fopen(nextarg, "rb");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue