mirror of
https://github.com/curl/curl.git
synced 2026-08-26 06:03:32 +03:00
src: avoid strdup on platforms not doing UTF8 conversions
... and use more const strings. Closes #16560
This commit is contained in:
parent
7298c4320b
commit
ed15fce1fd
6 changed files with 73 additions and 41 deletions
|
|
@ -361,7 +361,7 @@ struct OperationConfig;
|
|||
const struct LongShort *findlongopt(const char *opt);
|
||||
const struct LongShort *findshortopt(char letter);
|
||||
|
||||
ParameterError getparameter(const char *flag, char *nextarg,
|
||||
ParameterError getparameter(const char *flag, const char *nextarg,
|
||||
argv_item_t cleararg1,
|
||||
argv_item_t cleararg2,
|
||||
bool *usedarg,
|
||||
|
|
@ -377,4 +377,18 @@ void parse_cert_parameter(const char *cert_parameter,
|
|||
ParameterError parse_args(struct GlobalConfig *config, int argc,
|
||||
argv_item_t argv[]);
|
||||
|
||||
#if defined(UNICODE) && defined(_WIN32) && !defined(UNDER_CE)
|
||||
|
||||
#define convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr))
|
||||
#define convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr))
|
||||
#define unicodefree(ptr) curlx_unicodefree(ptr)
|
||||
|
||||
#else
|
||||
|
||||
#define convert_UTF8_to_tchar(ptr) (const char *)(ptr)
|
||||
#define convert_tchar_to_UTF8(ptr) (const char *)(ptr)
|
||||
#define unicodefree(ptr) do {} while(0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_TOOL_GETPARAM_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue