summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNils Gillmann <ng0@n0.is>2018-11-10 16:48:24 +0000
committerNils Gillmann <ng0@n0.is>2018-11-10 16:48:24 +0000
commit92533ade41f9b4860248c92bbcb3ee5d2bac0d66 (patch)
tree56919dee5ad5455a75045e7e0ead8eabc7bd5886 /src
parent544c3c6aed15d4198ccc1d38cfaee6329faadaf0 (diff)
parent196677150f711a96c38ed123e621f1d4e995b2e5 (diff)
downloadgnurl-92533ade41f9b4860248c92bbcb3ee5d2bac0d66.tar.gz
gnurl-92533ade41f9b4860248c92bbcb3ee5d2bac0d66.tar.bz2
gnurl-92533ade41f9b4860248c92bbcb3ee5d2bac0d66.zip
Merge tag 'curl-7_62_0'
7.62.0 Signed-off-by: Nils Gillmann <ng0@n0.is>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt9
-rw-r--r--src/Makefile.am14
-rw-r--r--src/Makefile.inc180
-rw-r--r--src/Makefile.m3262
-rw-r--r--src/Makefile.netware278
-rw-r--r--src/makefile.amiga17
-rw-r--r--src/makefile.dj1
-rw-r--r--src/slist_wc.h1
-rw-r--r--src/tool_binmode.c1
-rw-r--r--src/tool_binmode.h1
-rw-r--r--src/tool_bname.c1
-rw-r--r--src/tool_bname.h1
-rw-r--r--src/tool_cb_dbg.c1
-rw-r--r--src/tool_cb_dbg.h1
-rw-r--r--src/tool_cb_hdr.c20
-rw-r--r--src/tool_cb_hdr.h1
-rw-r--r--src/tool_cb_prg.h1
-rw-r--r--src/tool_cb_rea.c1
-rw-r--r--src/tool_cb_rea.h1
-rw-r--r--src/tool_cb_see.c1
-rw-r--r--src/tool_cb_see.h1
-rw-r--r--src/tool_cb_wrt.h1
-rw-r--r--src/tool_cfgable.c1
-rw-r--r--src/tool_cfgable.h1
-rw-r--r--src/tool_convert.c1
-rw-r--r--src/tool_convert.h1
-rw-r--r--src/tool_dirhie.c1
-rw-r--r--src/tool_dirhie.h1
-rw-r--r--src/tool_doswin.h1
-rw-r--r--src/tool_filetime.h1
-rw-r--r--src/tool_formparse.h1
-rw-r--r--src/tool_getparam.c4
-rw-r--r--src/tool_getparam.h1
-rw-r--r--src/tool_help.c10
-rw-r--r--src/tool_help.h1
-rw-r--r--src/tool_helpers.h1
-rw-r--r--src/tool_libinfo.c1
-rw-r--r--src/tool_libinfo.h1
-rw-r--r--src/tool_main.c56
-rw-r--r--src/tool_main.h1
-rw-r--r--src/tool_msgs.c3
-rw-r--r--src/tool_msgs.h1
-rw-r--r--src/tool_operate.c3
-rw-r--r--src/tool_operate.h1
-rw-r--r--src/tool_operhlp.h1
-rw-r--r--src/tool_panykey.c1
-rw-r--r--src/tool_panykey.h1
-rw-r--r--src/tool_parsecfg.c1
-rw-r--r--src/tool_parsecfg.h1
-rw-r--r--src/tool_sdecls.h1
-rw-r--r--src/tool_setup.h1
-rw-r--r--src/tool_sleep.c1
-rw-r--r--src/tool_sleep.h1
-rw-r--r--src/tool_urlglob.c13
-rw-r--r--src/tool_urlglob.h1
-rw-r--r--src/tool_util.c3
-rw-r--r--src/tool_util.h1
-rw-r--r--src/tool_vms.c1
-rw-r--r--src/tool_vms.h1
59 files changed, 375 insertions, 342 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a289886bd..c259473e4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -72,15 +72,8 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS})
#INCLUDE(ModuleInstall OPTIONAL)
-install(TARGETS ${EXE_NAME} EXPORT curl-target DESTINATION bin)
+install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
export(TARGETS ${EXE_NAME}
APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake
NAMESPACE CURL::
)
-
-install(EXPORT curl-target
- FILE curl-target.cmake
- NAMESPACE CURL::
- DESTINATION ${CURL_INSTALL_CMAKE_DIR}
-)
-
diff --git a/src/Makefile.am b/src/Makefile.am
index 7d50c679a..ae169f990 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -88,9 +88,9 @@ CLEANFILES = tool_hugehelp.c
# embedded text.
NROFF=env LC_ALL=C @NROFF@ @MANOPT@ # figured out by the configure script
-EXTRA_DIST = mkhelp.pl makefile.dj \
- Makefile.m32 macos/curl.mcp.xml.sit.hqx macos/MACINSTALL.TXT \
- macos/src/curl_GUSIConfig.cpp macos/src/macos_main.cpp makefile.amiga \
+EXTRA_DIST = mkhelp.pl makefile.dj \
+ Makefile.m32 macos/curl.mcp.xml.sit.hqx macos/MACINSTALL.TXT \
+ macos/src/curl_GUSIConfig.cpp macos/src/macos_main.cpp makefile.amiga \
curl.rc Makefile.netware Makefile.inc Makefile.Watcom CMakeLists.txt
# Use absolute directory to disable VPATH
@@ -140,3 +140,11 @@ if CURLDEBUG
# for debug builds, we scan the sources on all regular make invokes
all-local: checksrc
endif
+
+# disable the tests that are mostly causing false positives
+TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-valist.Uninitialized,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.NullDereference
+
+TIDY:=clang-tidy
+
+tidy:
+ $(TIDY) $(CURL_CFILES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
diff --git a/src/Makefile.inc b/src/Makefile.inc
index e0506c7f5..e1e8306bd 100644
--- a/src/Makefile.inc
+++ b/src/Makefile.inc
@@ -10,102 +10,102 @@
# libcurl has sources that provide functions named curlx_* that aren't part of
# the official API, but we re-use the code here to avoid duplication.
CURLX_CFILES = \
- ../lib/strtoofft.c \
- ../lib/nonblock.c \
- ../lib/warnless.c \
- ../lib/curl_ctype.c
+ ../lib/strtoofft.c \
+ ../lib/nonblock.c \
+ ../lib/warnless.c \
+ ../lib/curl_ctype.c
CURLX_HFILES = \
- ../lib/curl_setup.h \
- ../lib/strtoofft.h \
- ../lib/nonblock.h \
- ../lib/warnless.h \
- ../lib/curl_ctype.h
+ ../lib/curl_setup.h \
+ ../lib/strtoofft.h \
+ ../lib/nonblock.h \
+ ../lib/warnless.h \
+ ../lib/curl_ctype.h
CURL_CFILES = \
- slist_wc.c \
- tool_binmode.c \
- tool_bname.c \
- tool_cb_dbg.c \
- tool_cb_hdr.c \
- tool_cb_prg.c \
- tool_cb_rea.c \
- tool_cb_see.c \
- tool_cb_wrt.c \
- tool_cfgable.c \
- tool_convert.c \
- tool_dirhie.c \
- tool_doswin.c \
- tool_easysrc.c \
- tool_filetime.c \
- tool_formparse.c \
- tool_getparam.c \
- tool_getpass.c \
- tool_help.c \
- tool_helpers.c \
- tool_homedir.c \
- tool_hugehelp.c \
- tool_libinfo.c \
- tool_main.c \
- tool_metalink.c \
- tool_msgs.c \
- tool_operate.c \
- tool_operhlp.c \
- tool_panykey.c \
- tool_paramhlp.c \
- tool_parsecfg.c \
- tool_strdup.c \
- tool_setopt.c \
- tool_sleep.c \
- tool_urlglob.c \
- tool_util.c \
- tool_vms.c \
- tool_writeout.c \
- tool_xattr.c
+ slist_wc.c \
+ tool_binmode.c \
+ tool_bname.c \
+ tool_cb_dbg.c \
+ tool_cb_hdr.c \
+ tool_cb_prg.c \
+ tool_cb_rea.c \
+ tool_cb_see.c \
+ tool_cb_wrt.c \
+ tool_cfgable.c \
+ tool_convert.c \
+ tool_dirhie.c \
+ tool_doswin.c \
+ tool_easysrc.c \
+ tool_filetime.c \
+ tool_formparse.c \
+ tool_getparam.c \
+ tool_getpass.c \
+ tool_help.c \
+ tool_helpers.c \
+ tool_homedir.c \
+ tool_hugehelp.c \
+ tool_libinfo.c \
+ tool_main.c \
+ tool_metalink.c \
+ tool_msgs.c \
+ tool_operate.c \
+ tool_operhlp.c \
+ tool_panykey.c \
+ tool_paramhlp.c \
+ tool_parsecfg.c \
+ tool_strdup.c \
+ tool_setopt.c \
+ tool_sleep.c \
+ tool_urlglob.c \
+ tool_util.c \
+ tool_vms.c \
+ tool_writeout.c \
+ tool_xattr.c
CURL_HFILES = \
- slist_wc.h \
- tool_binmode.h \
- tool_bname.h \
- tool_cb_dbg.h \
- tool_cb_hdr.h \
- tool_cb_prg.h \
- tool_cb_rea.h \
- tool_cb_see.h \
- tool_cb_wrt.h \
- tool_cfgable.h \
- tool_convert.h \
- tool_dirhie.h \
- tool_doswin.h \
- tool_easysrc.h \
- tool_filetime.h \
- tool_formparse.h \
- tool_getparam.h \
- tool_getpass.h \
- tool_help.h \
- tool_helpers.h \
- tool_homedir.h \
- tool_hugehelp.h \
- tool_libinfo.h \
- tool_main.h \
- tool_metalink.h \
- tool_msgs.h \
- tool_operate.h \
- tool_operhlp.h \
- tool_panykey.h \
- tool_paramhlp.h \
- tool_parsecfg.h \
- tool_sdecls.h \
- tool_setopt.h \
- tool_setup.h \
- tool_sleep.h \
- tool_strdup.h \
- tool_urlglob.h \
- tool_util.h \
- tool_version.h \
- tool_vms.h \
- tool_writeout.h \
- tool_xattr.h
+ slist_wc.h \
+ tool_binmode.h \
+ tool_bname.h \
+ tool_cb_dbg.h \
+ tool_cb_hdr.h \
+ tool_cb_prg.h \
+ tool_cb_rea.h \
+ tool_cb_see.h \
+ tool_cb_wrt.h \
+ tool_cfgable.h \
+ tool_convert.h \
+ tool_dirhie.h \
+ tool_doswin.h \
+ tool_easysrc.h \
+ tool_filetime.h \
+ tool_formparse.h \
+ tool_getparam.h \
+ tool_getpass.h \
+ tool_help.h \
+ tool_helpers.h \
+ tool_homedir.h \
+ tool_hugehelp.h \
+ tool_libinfo.h \
+ tool_main.h \
+ tool_metalink.h \
+ tool_msgs.h \
+ tool_operate.h \
+ tool_operhlp.h \
+ tool_panykey.h \
+ tool_paramhlp.h \
+ tool_parsecfg.h \
+ tool_sdecls.h \
+ tool_setopt.h \
+ tool_setup.h \
+ tool_sleep.h \
+ tool_strdup.h \
+ tool_urlglob.h \
+ tool_util.h \
+ tool_version.h \
+ tool_vms.h \
+ tool_writeout.h \
+ tool_xattr.h
CURL_RCFILES = curl.rc
diff --git a/src/Makefile.m32 b/src/Makefile.m32
index 9c2af8b35..853ab7bcd 100644
--- a/src/Makefile.m32
+++ b/src/Makefile.m32
@@ -100,15 +100,15 @@ ifeq ($(CURL_AR),)
CURL_AR := $(CROSSPREFIX)ar
endif
-CC = $(CURL_CC)
-CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O2 -Wall -W
-CFLAGS += -fno-strict-aliasing
+CC = $(CURL_CC)
+CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O2 -Wall -W
+CFLAGS += -fno-strict-aliasing
# comment LDFLAGS below to keep debug info
-LDFLAGS = $(CURL_LDFLAG_EXTRAS) $(CURL_LDFLAG_EXTRAS_EXE) -s
-AR = $(CURL_AR)
-RC = $(CROSSPREFIX)windres
-RCFLAGS = --include-dir=$(PROOT)/include -O COFF -DCURL_EMBED_MANIFEST
-STRIP = $(CROSSPREFIX)strip -g
+LDFLAGS = $(CURL_LDFLAG_EXTRAS) $(CURL_LDFLAG_EXTRAS_EXE) -s
+AR = $(CURL_AR)
+RC = $(CROSSPREFIX)windres
+RCFLAGS = --include-dir=$(PROOT)/include -O COFF -DCURL_EMBED_MANIFEST
+STRIP = $(CROSSPREFIX)strip -g
# We may need these someday
# PERL = perl
@@ -117,9 +117,9 @@ STRIP = $(CROSSPREFIX)strip -g
# Set environment var ARCH to your architecture to override autodetection.
ifndef ARCH
ifeq ($(findstring x86_64,$(shell $(CC) -dumpmachine)),x86_64)
-ARCH = w64
+ARCH = w64
else
-ARCH = w32
+ARCH = w32
endif
endif
@@ -135,30 +135,30 @@ endif
# Platform-dependent helper tool macros
ifeq ($(findstring /sh,$(SHELL)),/sh)
-DEL = rm -f $1
-RMDIR = rm -fr $1
-MKDIR = mkdir -p $1
-COPY = -cp -afv $1 $2
-#COPYR = -cp -afr $1/* $2
-COPYR = -rsync -aC $1/* $2
-TOUCH = touch $1
-CAT = cat
-ECHONL = echo ""
-DL = '
+DEL = rm -f $1
+RMDIR = rm -fr $1
+MKDIR = mkdir -p $1
+COPY = -cp -afv $1 $2
+#COPYR = -cp -afr $1/* $2
+COPYR = -rsync -aC $1/* $2
+TOUCH = touch $1
+CAT = cat
+ECHONL = echo ""
+DL = '
else
ifeq "$(OS)" "Windows_NT"
-DEL = -del 2>NUL /q /f $(subst /,\,$1)
-RMDIR = -rd 2>NUL /q /s $(subst /,\,$1)
+DEL = -del 2>NUL /q /f $(subst /,\,$1)
+RMDIR = -rd 2>NUL /q /s $(subst /,\,$1)
else
-DEL = -del 2>NUL $(subst /,\,$1)
-RMDIR = -deltree 2>NUL /y $(subst /,\,$1)
-endif
-MKDIR = -md 2>NUL $(subst /,\,$1)
-COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2)
-COPYR = -xcopy 2>NUL /q /y /e $(subst /,\,$1) $(subst /,\,$2)
-TOUCH = copy 2>&1>NUL /b $(subst /,\,$1) +,,
-CAT = type
-ECHONL = $(ComSpec) /c echo.
+DEL = -del 2>NUL $(subst /,\,$1)
+RMDIR = -deltree 2>NUL /y $(subst /,\,$1)
+endif
+MKDIR = -md 2>NUL $(subst /,\,$1)
+COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2)
+COPYR = -xcopy 2>NUL /q /y /e $(subst /,\,$1) $(subst /,\,$2)
+TOUCH = copy 2>&1>NUL /b $(subst /,\,$1) +,,
+CAT = type
+ECHONL = $(ComSpec) /c echo.
endif
########################################################
diff --git a/src/Makefile.netware b/src/Makefile.netware
index 87a3da03c..d8265dba3 100644
--- a/src/Makefile.netware
+++ b/src/Makefile.netware
@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 2004 - 2014, Guenter Knauf, <http://www.gknw.net/phpbb>.
+# Copyright (C) 2004 - 2014, Guenter Knauf
# Copyright (C) 2001 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
@@ -31,7 +31,7 @@
# Edit the path below to point to the base of your Novell NDK.
ifndef NDKBASE
-NDKBASE = c:/novell
+NDKBASE = c:/novell
endif
# Edit the path below to point to the base of your Zlib sources.
@@ -95,17 +95,17 @@ LIBCARES_PATH = ../ares
endif
ifndef INSTDIR
-INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
+INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
endif
# Edit the vars below to change NLM target settings.
TARGET = curl
-VERSION = $(LIBCURL_VERSION)
-COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
-DESCR = curl $(LIBCURL_VERSION_STR) ($(LIBARCH)) - https://curl.haxx.se
-MTSAFE = YES
-STACK = 64000
-SCREEN = $(TARGET) commandline utility
+VERSION = $(LIBCURL_VERSION)
+COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
+DESCR = curl $(LIBCURL_VERSION_STR) ($(LIBARCH)) - https://curl.haxx.se
+MTSAFE = YES
+STACK = 64000
+SCREEN = $(TARGET) commandline utility
# Comment the line below if you don't want to load protected automatically.
# LDRING = 3
@@ -119,39 +119,39 @@ endif
# must be equal to NDEBUG or DEBUG, CURLDEBUG
ifndef DB
-DB = NDEBUG
+DB = NDEBUG
endif
# Optimization: -O<n> or debugging: -g
ifeq ($(DB),NDEBUG)
- OPT = -O2
- OBJDIR = release
+ OPT = -O2
+ OBJDIR = release
else
- OPT = -g
- OBJDIR = debug
+ OPT = -g
+ OBJDIR = debug
endif
# The following lines defines your compiler.
ifdef CWFolder
- METROWERKS = $(CWFolder)
+ METROWERKS = $(CWFolder)
endif
ifdef METROWERKS
- # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
- MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
- CC = mwccnlm
+ # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
+ MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
+ CC = mwccnlm
else
- CC = gcc
+ CC = gcc
endif
-PERL = perl
+PERL = perl
# Here you can find a native Win32 binary of the original awk:
# http://www.gknw.net/development/prgtools/awk-20100523.zip
-AWK = awk
-CP = cp -afv
-MKDIR = mkdir
-# RM = rm -f
+AWK = awk
+CP = cp -afv
+MKDIR = mkdir
+# RM = rm -f
# If you want to mark the target as MTSAFE you will need a tool for
# generating the xdc data for the linker; here's a minimal tool:
# http://www.gknw.net/development/prgtools/mkxdc.zip
-MPKXDC = mkxdc
+MPKXDC = mkxdc
# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
@@ -160,52 +160,52 @@ LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
-include $(OBJDIR)/version.inc
# Global flags for all compilers
-CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
+CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
ifeq ($(CC),mwccnlm)
-LD = mwldnlm
-LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
-LIBEXT = lib
-CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
-CFLAGS += -relax_pointers
-#CFLAGS += -w on
-ifeq ($(LIBARCH),LIBC)
-ifeq ($(POSIXFL),1)
- PRELUDE = $(NDK_LIBC)/imports/posixpre.o
-else
- PRELUDE = $(NDK_LIBC)/imports/libcpre.o
-endif
- CFLAGS += -align 4
+ LD = mwldnlm
+ LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
+ LIBEXT = lib
+ CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
+ CFLAGS += -relax_pointers
+ #CFLAGS += -w on
+ ifeq ($(LIBARCH),LIBC)
+ ifeq ($(POSIXFL),1)
+ PRELUDE = $(NDK_LIBC)/imports/posixpre.o
+ else
+ PRELUDE = $(NDK_LIBC)/imports/libcpre.o
+ endif
+ CFLAGS += -align 4
+ else
+ # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
+ # to avoid the __init_* / __deinit_* woes don't use prelude from NDK
+ PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
+ # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
+ CFLAGS += -align 1
+ endif
else
- # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
- # to avoid the __init_* / __deinit_* woes don't use prelude from NDK
- PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
- # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
- CFLAGS += -align 1
-endif
-else
-LD = nlmconv
-LDFLAGS = -T
-LIBEXT = a
-CFLAGS += -m32
-CFLAGS += -fno-builtin -fno-strict-aliasing
-ifeq ($(findstring gcc,$(CC)),gcc)
-CFLAGS += -fpcc-struct-return
-endif
-CFLAGS += -Wall # -pedantic
-ifeq ($(LIBARCH),LIBC)
-ifeq ($(POSIXFL),1)
- PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
-else
- PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
-endif
-else
- # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
- # to avoid the __init_* / __deinit_* woes don't use prelude from NDK
- # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
- PRELUDE = $(NDK_ROOT)/pre/prelude.o
- CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
-endif
+ LD = nlmconv
+ LDFLAGS = -T
+ LIBEXT = a
+ CFLAGS += -m32
+ CFLAGS += -fno-builtin -fno-strict-aliasing
+ ifeq ($(findstring gcc,$(CC)),gcc)
+ CFLAGS += -fpcc-struct-return
+ endif
+ CFLAGS += -Wall # -pedantic
+ ifeq ($(LIBARCH),LIBC)
+ ifeq ($(POSIXFL),1)
+ PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
+ else
+ PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
+ endif
+ else
+ # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
+ # to avoid the __init_* / __deinit_* woes don't use prelude from NDK
+ # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
+ PRELUDE = $(NDK_ROOT)/pre/prelude.o
+ CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
+ endif
endif
NDK_ROOT = $(NDKBASE)/ndk
@@ -265,124 +265,124 @@ ENABLE_IPV6 = 1
endif
ifdef LINK_STATIC
- LDLIBS = $(CURL_LIB)/libgnurl.$(LIBEXT)
+ LDLIBS = $(CURL_LIB)/libgnurl.$(LIBEXT)
ifdef WITH_ARES
- LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
+ LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
endif
else
- MODULES = libgnurl.nlm
- IMPORTS = @$(CURL_LIB)/libgnurl.imp
+ MODULES = libgnurl.nlm
+ IMPORTS = @$(CURL_LIB)/libgnurl.imp
endif
ifdef WITH_SSH2
- # INCLUDES += -I$(LIBSSH2_PATH)/include
-ifdef LINK_STATIC
- LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
-else
- MODULES += libssh2.nlm
- IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
-endif
+ # INCLUDES += -I$(LIBSSH2_PATH)/include
+ ifdef LINK_STATIC
+ LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
+ else
+ MODULES += libssh2.nlm
+ IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
+ endif
endif
ifdef WITH_RTMP
- # INCLUDES += -I$(LIBRTMP_PATH)
-ifdef LINK_STATIC
- LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
-endif
+ # INCLUDES += -I$(LIBRTMP_PATH)
+ ifdef LINK_STATIC
+ LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
+ endif
endif
ifdef WITH_SSL
- # INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
- LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
- LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
- IMPORTS += GetProcessSwitchCount RunningProcess
+ # INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
+ LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
+ LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
+ IMPORTS += GetProcessSwitchCount RunningProcess
else
ifdef WITH_AXTLS
- # INCLUDES += -I$(AXTLS_PATH)/inc
-ifdef LINK_STATIC
- LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
-else
- MODULES += libaxtls.nlm
- IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
-endif
+ # INCLUDES += -I$(AXTLS_PATH)/inc
+ ifdef LINK_STATIC
+ LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
+ else
+ MODULES += libaxtls.nlm
+ IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
+ endif
endif
endif
ifdef WITH_ZLIB
- INCLUDES += -I$(ZLIB_PATH)
-ifdef LINK_STATIC
- LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
-else
- MODULES += libz.nlm
- IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
-endif
+ INCLUDES += -I$(ZLIB_PATH)
+ ifdef LINK_STATIC
+ LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
+ else
+ MODULES += libz.nlm
+ IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
+ endif
endif
ifdef WITH_IDN
- # INCLUDES += -I$(LIBIDN_PATH)/include
- LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
+ # INCLUDES += -I$(LIBIDN_PATH)/include
+ LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
endif
ifdef WITH_NGHTTP2
- INCLUDES += -I$(NGHTTP2_PATH)/include
- LDLIBS += $(NGHTTP2_PATH)/lib/libnghttp2.$(LIBEXT)
+ INCLUDES += -I$(NGHTTP2_PATH)/include
+ LDLIBS += $(NGHTTP2_PATH)/lib/libnghttp2.$(LIBEXT)
endif
ifdef WITH_METALINK
- CFLAGS += -DUSE_METALINK
- INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
- INCLUDES += -I$(LIBMETALINK_PATH)/include
- LDLIBS += $(LIBMETALINK_PATH)/lib/libmetalink.$(LIBEXT)
-ifdef WITH_LIBEXPAT
- ifeq ($(LIBARCH),LIBC)
- IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlbc.imp
- MODULES += expatlbc
- else
- IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlib.imp
- MODULES += expatlib
- endif
+ CFLAGS += -DUSE_METALINK
+ INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
+ INCLUDES += -I$(LIBMETALINK_PATH)/include
+ LDLIBS += $(LIBMETALINK_PATH)/lib/libmetalink.$(LIBEXT)
+ ifdef WITH_LIBEXPAT
+ ifeq ($(LIBARCH),LIBC)
+ IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlbc.imp
+ MODULES += expatlbc
+ else
+ IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlib.imp
+ MODULES += expatlib
+ endif
else
ifdef WITH_LIBXML2
- IMPORTS += @$(LIBXML2_PATH)/lib/libxml2.imp
- MODULES += libxml2
+ IMPORTS += @$(LIBXML2_PATH)/lib/libxml2.imp
+ MODULES += libxml2
endif
endif
endif
ifeq ($(LIBARCH),LIBC)
- INCLUDES += -I$(NDK_LIBC)/include
- # INCLUDES += -I$(NDK_LIBC)/include/nks
- # INCLUDES += -I$(NDK_LIBC)/include/winsock
- CFLAGS += -D_POSIX_SOURCE
+ INCLUDES += -I$(NDK_LIBC)/include
+ # INCLUDES += -I$(NDK_LIBC)/include/nks
+ # INCLUDES += -I$(NDK_LIBC)/include/winsock
+ CFLAGS += -D_POSIX_SOURCE
else
- INCLUDES += -I$(NDK_CLIB)/include/nlm
- # INCLUDES += -I$(NDK_CLIB)/include
+ INCLUDES += -I$(NDK_CLIB)/include/nlm
+ # INCLUDES += -I$(NDK_CLIB)/include
endif
ifndef DISABLE_LDAP
- # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
+ # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
endif
-CFLAGS += $(INCLUDES)
+CFLAGS += $(INCLUDES)
ifeq ($(MTSAFE),YES)
- XDCOPT = -n
+ XDCOPT = -n
endif
ifeq ($(MTSAFE),NO)
- XDCOPT = -u
+ XDCOPT = -u
endif
ifdef XDCOPT
- XDCDATA = $(OBJDIR)/$(TARGET).xdc
+ XDCDATA = $(OBJDIR)/$(TARGET).xdc
endif
ifeq ($(findstring /sh,$(SHELL)),/sh)
-DL = '
-DS = /
-PCT = %
+DL = '
+DS = /
+PCT = %
#-include $(NDKBASE)/nlmconv/ncpfs.inc
else
-DS = \\
-PCT = %%
+DS = \\
+PCT = %%
endif
# Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc
-OBJX := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_CFILES))))
-OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_CFILES)))
+OBJX := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_CFILES))))
+OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_CFILES)))
ifndef LINK_STATIC
-OBJS += $(OBJX)
+OBJS += $(OBJX)
endif
vpath %.c $(CURL_LIB)
@@ -520,5 +520,3 @@ tool_hugehelp.c:
$(LIBCARES_PATH)/libcares.$(LIBEXT):
$(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib
-
-
diff --git a/src/makefile.amiga b/src/makefile.amiga
index 9f3748b1a..3bc0080f8 100644
--- a/src/makefile.amiga
+++ b/src/makefile.amiga
@@ -4,21 +4,21 @@
# change the follow to where you have the AmiTCP SDK v4.3 includes:
-ATCPSDKI= /GG/netinclude
+ATCPSDKI= /GG/netinclude
-CC = m68k-amigaos-gcc
-CFLAGS = -I$(ATCPSDKI) -m68020-60 -O2 -msoft-float -noixemul -g -I. -I../include -W -Wall
-LIBS = ../lib/libcurl.a -lssl -lcrypto -lz
-MANPAGE = ../docs/curl.1
-README = ../docs/MANUAL
-MKHELP = ../src/mkhelp.pl
+CC = m68k-amigaos-gcc
+CFLAGS = -I$(ATCPSDKI) -m68020-60 -O2 -msoft-float -noixemul -g -I. -I../include -W -Wall
+LIBS = ../lib/libcurl.a -lssl -lcrypto -lz
+MANPAGE = ../docs/curl.1
+README = ../docs/MANUAL
+MKHELP = ../src/mkhelp.pl
include Makefile.inc
OBJS = $(CURL_CFILES:.c=.o) $(CURLX_CFILES:.c=.o)
-all: tool_hugehelp.c $(OBJS)
+all: tool_hugehelp.c $(OBJS)
$(CC) $(CFLAGS) -o curl $(OBJS) $(LIBS) -Wl,-Map,curl.map,--cref
tool_hugehelp.c: $(README) $(MANPAGE) mkhelp.pl
@@ -27,4 +27,3 @@ tool_hugehelp.c: $(README) $(MANPAGE) mkhelp.pl
install:
$(INSTALL) -c curl /c/curl
-
diff --git a/src/makefile.dj b/src/makefile.dj
index fbd2d3738..a9f5d3a5e 100644
--- a/src/makefile.dj
+++ b/src/makefile.dj
@@ -91,4 +91,3 @@ realclean vclean: clean
- $(DELETE) $(PROGRAM)
-include depend.dj
-
diff --git a/src/slist_wc.h b/src/slist_wc.h
index d8943122c..9bd6993db 100644
--- a/src/slist_wc.h
+++ b/src/slist_wc.h
@@ -53,4 +53,3 @@ void slist_wc_free_all(struct slist_wc *);
#endif /* CURL_DISABLE_LIBCURL_OPTION */
#endif /* HEADER_CURL_SLIST_WC_H */
-
diff --git a/src/tool_binmode.c b/src/tool_binmode.c
index 5ca64cd58..f70015641 100644
--- a/src/tool_binmode.c
+++ b/src/tool_binmode.c
@@ -49,4 +49,3 @@ void set_binmode(FILE *stream)
}
#endif /* HAVE_SETMODE */
-
diff --git a/src/tool_binmode.h b/src/tool_binmode.h
index 8b445ae66..07b7ffedf 100644
--- a/src/tool_binmode.h
+++ b/src/tool_binmode.h
@@ -34,4 +34,3 @@ void set_binmode(FILE *stream);
#endif /* HAVE_SETMODE */
#endif /* HEADER_CURL_TOOL_BINMODE_H */
-
diff --git a/src/tool_bname.c b/src/tool_bname.c
index 5cc5c15df..761192fe9 100644
--- a/src/tool_bname.c
+++ b/src/tool_bname.c
@@ -47,4 +47,3 @@ char *tool_basename(char *path)
}
#endif /* HAVE_BASENAME */
-
diff --git a/src/tool_bname.h b/src/tool_bname.h
index 61b97b492..66e7c1733 100644
--- a/src/tool_bname.h
+++ b/src/tool_bname.h
@@ -32,4 +32,3 @@ char *tool_basename(char *path);
#endif /* HAVE_BASENAME */
#endif /* HEADER_CURL_TOOL_BNAME_H */
-
diff --git a/src/tool_cb_dbg.c b/src/tool_cb_dbg.c
index c2dd51b7c..a3e033977 100644
--- a/src/tool_cb_dbg.c
+++ b/src/tool_cb_dbg.c
@@ -279,4 +279,3 @@ static void dump(const char *timebuf, const char *text,
}
fflush(stream);
}
-
diff --git a/src/tool_cb_dbg.h b/src/tool_cb_dbg.h
index c1cbc8073..433e74616 100644
--- a/src/tool_cb_dbg.h
+++ b/src/tool_cb_dbg.h
@@ -32,4 +32,3 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
void *userdata);
#endif /* HEADER_CURL_TOOL_CB_DBG_H */
-
diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c
index 04bc7e17b..7a7a836c4 100644
--- a/src/tool_cb_hdr.c
+++ b/src/tool_cb_hdr.c
@@ -42,7 +42,7 @@ static char *parse_filename(const char *ptr, size_t len);
#define BOLDOFF
#else
#define BOLD "\x1b[1m"
-/* Switch off bold by settting "all attributes off" since the explicit
+/* Switch off bold by setting "all attributes off" since the explicit
bold-off code (21) isn't supported everywhere - like in the mac
Terminal. */
#define BOLDOFF "\x1b[0m"
@@ -132,15 +132,24 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
filename = parse_filename(p, len);
if(filename) {
if(outs->stream) {
+ int rc;
/* already opened and possibly written to */
if(outs->fopened)
fclose(outs->stream);
outs->stream = NULL;
/* rename the initial file name to the new file name */
- rename(outs->filename, filename);
+ rc = rename(outs->filename, filename);
+ if(rc != 0) {
+ warnf(outs->config->global, "Failed to rename %s -> %s: %s\n",
+ outs->filename, filename, strerror(errno));
+ }
if(outs->alloc_filename)
- free(outs->filename);
+ Curl_safefree(outs->filename);
+ if(rc != 0) {
+ free(filename);
+ return failure;
+ }
}
outs->is_cd_filename = TRUE;
outs->s_isreg = TRUE;
@@ -158,8 +167,9 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
}
if(hdrcbdata->config->show_headers &&
- (protocol & (CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_RTSP))) {
- /* bold headers only happen for HTTP(S) and RTSP */
+ (protocol &
+ (CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_RTSP|CURLPROTO_FILE))) {
+ /* bold headers only for selected protocols */
char *value = NULL;
if(!outs->stream && !tool_create_output_file(outs, FALSE))
diff --git a/src/tool_cb_hdr.h b/src/tool_cb_hdr.h
index e1b9a920e..cf544dfcb 100644
--- a/src/tool_cb_hdr.h
+++ b/src/tool_cb_hdr.h
@@ -53,4 +53,3 @@ struct HdrCbData {
size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata);
#endif /* HEADER_CURL_TOOL_CB_HDR_H */
-
diff --git a/src/tool_cb_prg.h b/src/tool_cb_prg.h
index f8d6deaba..cc8876849 100644
--- a/src/tool_cb_prg.h
+++ b/src/tool_cb_prg.h
@@ -50,4 +50,3 @@ int tool_progress_cb(void *clientp,
curl_off_t ultotal, curl_off_t ulnow);
#endif /* HEADER_CURL_TOOL_CB_PRG_H */
-
diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c
index 88137ae74..8a33c847b 100644
--- a/src/tool_cb_rea.c
+++ b/src/tool_cb_rea.c
@@ -52,4 +52,3 @@ size_t tool_read_cb(void *buffer, size_t sz, size_t nmemb, void *userdata)
in->config->readbusy = FALSE;
return (size_t)rc;
}
-
diff --git a/src/tool_cb_rea.h b/src/tool_cb_rea.h
index 5fbc793f6..475f0b1c3 100644
--- a/src/tool_cb_rea.h
+++ b/src/tool_cb_rea.h
@@ -30,4 +30,3 @@
size_t tool_read_cb(void *buffer, size_t sz, size_t nmemb, void *userdata);
#endif /* HEADER_CURL_TOOL_CB_REA_H */
-
diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c
index 061b2bb3d..891dc458a 100644
--- a/src/tool_cb_see.c
+++ b/src/tool_cb_see.c
@@ -130,4 +130,3 @@ int tool_ftruncate64(int fd, curl_off_t where)
}
#endif /* WIN32 && ! __MINGW64__ */
-
diff --git a/src/tool_cb_see.h b/src/tool_cb_see.h
index b07741da6..ff8de0e9a 100644
--- a/src/tool_cb_see.h
+++ b/src/tool_cb_see.h
@@ -43,4 +43,3 @@ int tool_ftruncate64(int fd, curl_off_t where);
int tool_seek_cb(void *userdata, curl_off_t offset, int whence);
#endif /* HEADER_CURL_TOOL_CB_SEE_H */
-
diff --git a/src/tool_cb_wrt.h b/src/tool_cb_wrt.h
index 2b6e98ae4..51e002bea 100644
--- a/src/tool_cb_wrt.h
+++ b/src/tool_cb_wrt.h
@@ -33,4 +33,3 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata);
bool tool_create_output_file(struct OutStruct *outs, bool append);
#endif /* HEADER_CURL_TOOL_CB_WRT_H */
-
diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c
index 81e16c1c8..7d088ae0f 100644
--- a/src/tool_cfgable.c
+++ b/src/tool_cfgable.c
@@ -102,6 +102,7 @@ static void free_config_fields(struct OperationConfig *config)
config->url_get = NULL;
config->url_out = NULL;
+ Curl_safefree(config->doh_url);
Curl_safefree(config->cipher_list);
Curl_safefree(config->proxy_cipher_list);
Curl_safefree(config->cert);
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index a0363e9a7..b719fa219 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -115,6 +115,7 @@ struct OperationConfig {
struct getout *url_get; /* point to the node to fill in URL */
struct getout *url_out; /* point to the node to fill in outfile */
struct getout *url_ul; /* point to the node to fill in upload */
+ char *doh_url;
char *cipher_list;
char *proxy_cipher_list;
char *cipher13_list;
diff --git a/src/tool_convert.c b/src/tool_convert.c
index d0f5dcb00..ec9d7ac7c 100644
--- a/src/tool_convert.c
+++ b/src/tool_convert.c
@@ -147,4 +147,3 @@ char convert_char(curl_infotype infotype, char this_char)
}
#endif /* CURL_DOES_CONVERSIONS */
-
diff --git a/src/tool_convert.h b/src/tool_convert.h
index d1b1d2327..27b4ce90f 100644
--- a/src/tool_convert.h
+++ b/src/tool_convert.h
@@ -42,4 +42,3 @@ char convert_char(curl_infotype infotype, char this_char);
#endif
#endif /* HEADER_CURL_TOOL_CONVERT_H */
-
diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c
index 36c06941c..24bbc4906 100644
--- a/src/tool_dirhie.c
+++ b/src/tool_dirhie.c
@@ -153,4 +153,3 @@ CURLcode create_dir_hierarchy(const char *outfile, FILE *errors)
return result;
}
-
diff --git a/src/tool_dirhie.h b/src/tool_dirhie.h
index cc67687de..011a5774f 100644
--- a/src/tool_dirhie.h
+++ b/src/tool_dirhie.h
@@ -26,4 +26,3 @@
CURLcode create_dir_hierarchy(const char *outfile, FILE *errors);
#endif /* HEADER_CURL_TOOL_DIRHIE_H */
-
diff --git a/src/tool_doswin.h b/src/tool_doswin.h
index 289281f4f..6398390f1 100644
--- a/src/tool_doswin.h
+++ b/src/tool_doswin.h
@@ -66,4 +66,3 @@ CURLcode FindWin32CACert(struct OperationConfig *config,
#endif /* MSDOS || WIN32 */
#endif /* HEADER_CURL_TOOL_DOSWIN_H */
-
diff --git a/src/tool_filetime.h b/src/tool_filetime.h
index 966a70b46..f23afcf30 100644
--- a/src/tool_filetime.h
+++ b/src/tool_filetime.h
@@ -35,4 +35,3 @@ void setfiletime(curl_off_t filetime, const char *filename,
(defined(WIN32) && (SIZEOF_CURL_OFF_T >= 8)) */
#endif /* HEADER_CURL_TOOL_FILETIME_H */
-
diff --git a/src/tool_formparse.h b/src/tool_formparse.h
index a52b98d39..cdf02d028 100644
--- a/src/tool_formparse.h
+++ b/src/tool_formparse.h
@@ -30,4 +30,3 @@ int formparse(struct OperationConfig *config,
bool literal_value);
#endif /* HEADER_CURL_TOOL_FORMPARSE_H */
-
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index aad147148..58f3f5827 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -80,6 +80,7 @@ static const struct LongShort aliases[]= {
{"*b", "egd-file", ARG_STRING},
{"*B", "oauth2-bearer", ARG_STRING},
{"*c", "connect-timeout", ARG_STRING},
+ {"*C", "doh-url" , ARG_STRING},
{"*d", "ciphers", ARG_STRING},
{"*D", "dns-interface", ARG_STRING},
{"*e", "disable-epsv", ARG_BOOL},
@@ -619,6 +620,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
if(err)
return err;
break;
+ case 'C': /* doh-url */
+ GetStr(&config->doh_url, nextarg);
+ break;
case 'd': /* ciphers */
GetStr(&config->cipher_list, nextarg);
break;
diff --git a/src/tool_getparam.h b/src/tool_getparam.h
index 2148e4091..daf83b884 100644
--- a/src/tool_getparam.h
+++ b/src/tool_getparam.h
@@ -62,4 +62,3 @@ ParameterError parse_args(struct GlobalConfig *config, int argc,
argv_item_t argv[]);
#endif /* HEADER_CURL_TOOL_GETPARAM_H */
-
diff --git a/src/tool_help.c b/src/tool_help.c
index b829e76ef..d2deed3cf 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -118,6 +118,8 @@ static const struct helptxt helptext[] = {
"IPv6 address to use for DNS requests"},
{" --dns-servers <addresses>",
"DNS server addrs to use"},
+ {" --doh-url <URL>",
+ "Resolve host names over DOH"},
{"-D, --dump-header <filename>",
"Write the received headers to <filename>"},
{" --egd-file <file>",
@@ -447,13 +449,13 @@ static const struct helptxt helptext[] = {
{"-1, --tlsv1",
"Use TLSv1.0 or greater"},
{" --tlsv1.0",
- "Use TLSv1.0"},
+ "Use TLSv1.0 or greater"},
{" --tlsv1.1",
- "Use TLSv1.1"},
+ "Use TLSv1.1 or greater"},
{" --tlsv1.2",
- "Use TLSv1.2"},
+ "Use TLSv1.2 or greater"},
{" --tlsv1.3",
- "Use TLSv1.3"},
+ "Use TLSv1.3 or greater"},
{" --tr-encoding",
"Request compressed transfer encoding"},
{" --trace <file>",
diff --git a/src/tool_help.h b/src/tool_help.h
index 43432d714..0289f3015 100644
--- a/src/tool_help.h
+++ b/src/tool_help.h
@@ -28,4 +28,3 @@ void tool_list_engines(CURL *curl);
void tool_version_info(void);
#endif /* HEADER_CURL_TOOL_HELP_H */
-
diff --git a/src/tool_helpers.h b/src/tool_helpers.h
index 9ede16e64..33483ebc3 100644
--- a/src/tool_helpers.h
+++ b/src/tool_helpers.h
@@ -32,4 +32,3 @@ void customrequest_helper(struct OperationConfig *config, HttpReq req,
char *method);
#endif /* HEADER_CURL_TOOL_HELPERS_H */
-
diff --git a/src/tool_libinfo.c b/src/tool_libinfo.c
index 583570988..19ec65ac6 100644
--- a/src/tool_libinfo.c
+++ b/src/tool_libinfo.c
@@ -99,4 +99,3 @@ CURLcode get_libcurl_info(void)
return CURLE_OK;
}
-
diff --git a/src/tool_libinfo.h b/src/tool_libinfo.h
index 298df8013..b3a9b9cdd 100644
--- a/src/tool_libinfo.h
+++ b/src/tool_libinfo.h
@@ -31,4 +31,3 @@ extern long built_in_protos;
CURLcode get_libcurl_info(void);
#endif /* HEADER_CURL_TOOL_LIBINFO_H */
-
diff --git a/src/tool_main.c b/src/tool_main.c
index b9f7eae2c..612bfcb6a 100644
--- a/src/tool_main.c
+++ b/src/tool_main.c
@@ -236,6 +236,56 @@ static void main_free(struct GlobalConfig *config)
config->last = NULL;
}
+#ifdef _WIN32
+/* TerminalSettings for Windows */
+static struct TerminalSettings {
+ HANDLE hStdOut;
+ DWORD dwOutputMode;
+ UINT nCodepage;
+} TerminalSettings;
+
+static void configure_terminal(void)
+{
+ /*
+ * If we're running Windows, enable VT output & set codepage to UTF-8.
+ * Note: VT mode flag can be set on any version of Windows, but VT
+ * processing only performed on Win10 >= Creators Update)
+ */
+
+ /* Define the VT flags in case we're building with an older SDK */
+#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
+ #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
+#endif
+
+ /* Cache current codepage (will restore on exit) & set codepage to UTF-8 */
+ memset(&TerminalSettings, 0, sizeof(TerminalSettings));
+ TerminalSettings.nCodepage = GetConsoleOutputCP();
+ SetConsoleOutputCP(65001);
+
+ /* Enable VT output */
+ TerminalSettings.hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+ if((TerminalSettings.hStdOut != INVALID_HANDLE_VALUE)
+ && (GetConsoleMode(TerminalSettings.hStdOut,
+ &TerminalSettings.dwOutputMode))) {
+ SetConsoleMode(TerminalSettings.hStdOut,
+ TerminalSettings.dwOutputMode
+ | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
+ }
+}
+#else
+#define configure_terminal()
+#endif
+
+static void restore_terminal(void)
+{
+#ifdef _WIN32
+ /* Restore Console output mode and codepage to whatever they were
+ * when Curl started */
+ SetConsoleMode(TerminalSettings.hStdOut, TerminalSettings.dwOutputMode);
+ SetConsoleOutputCP(TerminalSettings.nCodepage);
+#endif
+}
+
/*
** curl tool main function.
*/
@@ -245,6 +295,9 @@ int main(int argc, char *argv[])
struct GlobalConfig global;
memset(&global, 0, sizeof(global));
+ /* Perform any platform-specific terminal configuration */
+ configure_terminal();
+
main_checkfds();
#if defined(HAVE_SIGNAL) && defined(SIGPIPE)
@@ -270,6 +323,9 @@ int main(int argc, char *argv[])
main_free(&global);
}
+ /* Return the terminal to its original state */
+ restore_terminal();
+
#ifdef __NOVELL_LIBC__
if(getenv("_IN_NETWARE_BASH_") == NULL)
tool_pressanykey();
diff --git a/src/tool_main.h b/src/tool_main.h
index c97c3607f..868818816 100644
--- a/src/tool_main.h
+++ b/src/tool_main.h
@@ -41,4 +41,3 @@
#endif
#endif /* HEADER_CURL_TOOL_MAIN_H */
-
diff --git a/src/tool_msgs.c b/src/tool_msgs.c
index 9cce8063e..f5e1df25f 100644
--- a/src/tool_msgs.c
+++ b/src/tool_msgs.c
@@ -67,7 +67,7 @@ static void voutf(struct GlobalConfig *config,
(void)fwrite(ptr, cut + 1, 1, config->errors);
fputs("\n", config->errors);
ptr += cut + 1; /* skip the space too */
- len -= cut;
+ len -= cut + 1;
}
else {
fputs(ptr, config->errors);
@@ -122,4 +122,3 @@ void helpf(FILE *errors, const char *fmt, ...)
#endif
"for more information\n");
}
-
diff --git a/src/tool_msgs.h b/src/tool_msgs.h
index e84c1b247..d1cc7f8d5 100644
--- a/src/tool_msgs.h
+++ b/src/tool_msgs.h
@@ -29,4 +29,3 @@ void notef(struct GlobalConfig *config, const char *fmt, ...);
void helpf(FILE *errors, const char *fmt, ...);
#endif /* HEADER_CURL_TOOL_MSGS_H */
-
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 2c3f6dd4c..5a72b6a8c 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1262,6 +1262,9 @@ static CURLcode operate_do(struct GlobalConfig *global,
my_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS,
(long)(config->connecttimeout * 1000));
+ if(config->doh_url)
+ my_setopt_str(curl, CURLOPT_DOH_URL, config->doh_url);
+
if(config->cipher_list)
my_setopt_str(curl, CURLOPT_SSL_CIPHER_LIST, config->cipher_list);
diff --git a/src/tool_operate.h b/src/tool_operate.h
index c54fe3fca..b84388bc5 100644
--- a/src/tool_operate.h
+++ b/src/tool_operate.h
@@ -26,4 +26,3 @@
CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[]);
#endif /* HEADER_CURL_TOOL_OPERATE_H */
-
diff --git a/src/tool_operhlp.h b/src/tool_operhlp.h
index 446c56067..90c854929 100644
--- a/src/tool_operhlp.h
+++ b/src/tool_operhlp.h
@@ -36,4 +36,3 @@ char *add_file_name_to_url(CURL *curl, char *url, const char *filename);
CURLcode get_url_file_name(char **filename, const char *url);
#endif /* HEADER_CURL_TOOL_OPERHLP_H */
-
diff --git a/src/tool_panykey.c b/src/tool_panykey.c
index 14e1e05c5..b0e556307 100644
--- a/src/tool_panykey.c
+++ b/src/tool_panykey.c
@@ -45,4 +45,3 @@ void tool_pressanykey(void)
}
#endif /* __SYMBIAN32__ || NETWARE */
-
diff --git a/src/tool_panykey.h b/src/tool_panykey.h
index 9d64418e2..6371a88a7 100644
--- a/src/tool_panykey.h
+++ b/src/tool_panykey.h
@@ -34,4 +34,3 @@ void tool_pressanykey(void);
#endif
#endif /* HEADER_CURL_TOOL_PANYKEY_H */
-
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c
index 34b5d8b25..e57d76026 100644
--- a/src/tool_parsecfg.c
+++ b/src/tool_parsecfg.c
@@ -356,4 +356,3 @@ static char *my_get_line(FILE *fp)
return line;
}
-
diff --git a/src/tool_parsecfg.h b/src/tool_parsecfg.h
index b676ec3c6..340626190 100644
--- a/src/tool_parsecfg.h
+++ b/src/tool_parsecfg.h
@@ -26,4 +26,3 @@
int parseconfig(const char *filename, struct GlobalConfig *config);
#endif /* HEADER_CURL_TOOL_PARSECFG_H */
-
diff --git a/src/tool_sdecls.h b/src/tool_sdecls.h
index 48dd4aed9..ebec9eebb 100644
--- a/src/tool_sdecls.h
+++ b/src/tool_sdecls.h
@@ -148,4 +148,3 @@ typedef enum {
#include "tool_cfgable.h"
#endif /* HEADER_CURL_TOOL_SDECLS_H */
-
diff --git a/src/tool_setup.h b/src/tool_setup.h
index 2b2b9527b..d3abd5611 100644
--- a/src/tool_setup.h
+++ b/src/tool_setup.h
@@ -71,4 +71,3 @@
#endif
#endif /* HEADER_CURL_TOOL_SETUP_H */
-
diff --git a/src/tool_sleep.c b/src/tool_sleep.c
index a63d85ffb..edb5aedc0 100644
--- a/src/tool_sleep.c
+++ b/src/tool_sleep.c
@@ -55,4 +55,3 @@ void tool_go_sleep(long ms)
select(0, NULL, NULL, NULL, &timeout);
#endif
}
-
diff --git a/src/tool_sleep.h b/src/tool_sleep.h
index 6c51a9307..3aaab52d7 100644
--- a/src/tool_sleep.h
+++ b/src/tool_sleep.h
@@ -26,4 +26,3 @@
void tool_go_sleep(long ms);
#endif /* HEADER_CURL_TOOL_SLEEP_H */
-
diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
index e1b994108..e4a5c33db 100644
--- a/src/tool_urlglob.c
+++ b/src/tool_urlglob.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -459,18 +459,19 @@ CURLcode glob_url(URLGlob **glob, char *url, unsigned long *urlnum,
*urlnum = amount;
else {
if(error && glob_expand->error) {
- char text[128];
+ char text[512];
const char *t;
if(glob_expand->pos) {
- snprintf(text, sizeof(text), "%s in column %zu", glob_expand->error,
- glob_expand->pos);
+ snprintf(text, sizeof(text), "%s in URL position %zu:\n%s\n%*s^",
+ glob_expand->error,
+ glob_expand->pos, url, glob_expand->pos - 1, " ");
t = text;
}
else
t = glob_expand->error;
/* send error description to the error-stream */
- fprintf(error, "curl: (%d) [globbing] %s\n", res, t);
+ fprintf(error, "curl: (%d) %s\n", res, t);
}
/* it failed, we cleanup */
glob_cleanup(glob_expand);
@@ -552,7 +553,7 @@ CURLcode glob_next_url(char **globbed, URLGlob *glob)
}
}
if(carry) { /* first pattern ptr has run into overflow, done! */
- /* TODO: verify if this should actally return CURLE_OK. */
+ /* TODO: verify if this should actually return CURLE_OK. */
return CURLE_OK; /* CURLE_OK to match previous behavior */
}
}
diff --git a/src/tool_urlglob.h b/src/tool_urlglob.h
index 82d9d46d6..55ac34611 100644
--- a/src/tool_urlglob.h
+++ b/src/tool_urlglob.h
@@ -74,4 +74,3 @@ CURLcode glob_match_url(char **, char *, URLGlob *);
void glob_cleanup(URLGlob* glob);
#endif /* HEADER_CURL_TOOL_URLGLOB_H */
-
diff --git a/src/tool_util.c b/src/tool_util.c
index 875411e3b..1a5b773e2 100644
--- a/src/tool_util.c
+++ b/src/tool_util.c
@@ -40,7 +40,8 @@ struct timeval tvnow(void)
** is typically in the range of 10 milliseconds to 16 milliseconds.
*/
struct timeval now;
-#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
+#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600) && \
+ (!defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR))
ULONGLONG milliseconds = GetTickCount64();
#else
DWORD milliseconds = GetTickCount();
diff --git a/src/tool_util.h b/src/tool_util.h
index fda1e61bf..5339c1167 100644
--- a/src/tool_util.h
+++ b/src/tool_util.h
@@ -34,4 +34,3 @@ struct timeval tvnow(void);
long tvdiff(struct timeval t1, struct timeval t2);
#endif /* HEADER_CURL_TOOL_UTIL_H */
-
diff --git a/src/tool_vms.c b/src/tool_vms.c
index cc30fe0f4..54871a65e 100644
--- a/src/tool_vms.c
+++ b/src/tool_vms.c
@@ -216,4 +216,3 @@ int dmy_lib$initialize = (int) LIB$INITIALIZE;
#endif /* __DECC && !__VAX && __CRTL_VER && __CRTL_VER >= 70301000 */
#endif /* __VMS */
-
diff --git a/src/tool_vms.h b/src/tool_vms.h
index 6656a5996..96c86f1ce 100644
--- a/src/tool_vms.h
+++ b/src/tool_vms.h
@@ -44,4 +44,3 @@ void vms_special_exit(int code, int vms_show);
#endif /* __VMS */
#endif /* HEADER_CURL_TOOL_VMS_H */
-