summaryrefslogtreecommitdiff
path: root/src/tool_operhlp.c
Commit message (Collapse)AuthorAgeFilesLines
* snprintf: renamed and we now only use msnprintf()Daniel Stenberg2018-11-231-2/+2
| | | | | | | | | | | The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-1/+1
| | | | | We had some confusions on when each function was used. We should not act differently on different locales anyway.
* strcasecompare: is the new name for strequal()Daniel Stenberg2016-10-311-3/+3
| | | | | | | ... to make it less likely that we forget that the function actually does case insentive compares. Also replaced several invokes of the function with a plain strcmp when case sensitivity is not an issue (like comparing with "-").
* tool_operhlp: Check for backslashes in get_url_file_nameJay Satiro2016-02-081-1/+5
| | | | | | | | | | Extract the filename from the last slash or backslash. Prior to this change backslashes could be part of the filename. This change needed for the curl tool built for Cygwin. Refer to the CYGWIN addendum in advisory 20160127B. Bug: https://curl.haxx.se/docs/adv_20160127B.html
* tool_doswin: Improve sanitization processingJay Satiro2016-02-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add unit test 1604 to test the sanitize_file_name function. - Use -DCURL_STATICLIB when building libcurltool for unit testing. - Better detection of reserved DOS device names. - New flags to modify sanitize behavior: SANITIZE_ALLOW_COLONS: Allow colons SANITIZE_ALLOW_PATH: Allow path separators and colons SANITIZE_ALLOW_RESERVED: Allow reserved device names SANITIZE_ALLOW_TRUNCATE: Allow truncating a long filename - Restore sanitization of banned characters from user-specified outfile. Prior to this commit sanitization of a user-specified outfile was temporarily disabled in 2b6dadc because there was no way to allow path separators and colons through while replacing other banned characters. Now in such a case we call the sanitize function with SANITIZE_ALLOW_PATH which allows path separators and colons to pass through. Closes https://github.com/curl/curl/issues/624 Reported-by: Octavio Schroeder
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* get_url_file_name: Fixed crash on OOM on debug buildDan Fandrich2014-12-071-0/+2
| | | | | This caused a null-pointer dereference which caused a few dozen torture tests to fail.
* get_url_file_name: make no slash equal empty stringDaniel Stenberg2014-10-091-5/+8
|
* get_url_file_name: never return a NULL string *and* OKDaniel Stenberg2014-10-091-5/+3
| | | | | | | Change 987a4a73 assumes that as it simplifies life in the calling function. Reported-by: Fabian Keil
* tool_cfgable: Renamed Configurable structure to OperationConfigSteve Holme2014-02-231-1/+1
| | | | | To allow for the addition of a global config structure and prevent confusion between the two.
* tool_operhlp: Consolidated engine output code into tool_helpSteve Holme2014-02-221-14/+0
|
* tool_operate: Moved required argument getting into separate functionSteve Holme2014-02-151-10/+0
|
* tool_operate: Moved main initialisation and cleanup code into tool_mainSteve Holme2014-02-031-26/+0
|
* tool_operate: Moved memory tracking initialisation into tool_mainSteve Holme2014-02-021-31/+1
|
* tool_operhlp.c: fix add_file_name_to_url() OOM handlingYang Tse2013-07-291-0/+2
|
* checksrc: ban unsafe functionsDaniel Stenberg2013-03-071-8/+6
| | | | | | | | The list of unsafe functions currently consists of sprintf, vsprintf, strcat, strncat and gets. Subsequently, some existing code needed updating to avoid warnings on this.
* remove ifdefsDaniel Stenberg2013-02-141-8/+2
| | | | Clarify the code by reducing ifdefs
* Revert changes relative to lib/*.[ch] recent renamingYang Tse2013-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts renaming and usage of lib/*.h header files done 28-12-2012, reverting 2 commits: f871de0... build: make use of 76 lib/*.h renamed files ffd8e12... build: rename 76 lib/*.h files This also reverts removal of redundant include guard (redundant thanks to changes in above commits) done 2-12-2013, reverting 1 commit: c087374... curl_setup.h: remove redundant include guard This also reverts renaming and usage of lib/*.c source files done 3-12-2013, reverting 3 commits: 13606bb... build: make use of 93 lib/*.c renamed files 5b6e792... build: rename 93 lib/*.c files 7d83dff... build: commit 13606bbfde follow-up 1 Start of related discussion thread: http://curl.haxx.se/mail/lib-2013-01/0012.html Asking for confirmation on pushing this revertion commit: http://curl.haxx.se/mail/lib-2013-01/0048.html Confirmation summary: http://curl.haxx.se/mail/lib-2013-01/0079.html NOTICE: The list of 2 files that have been modified by other intermixed commits, while renamed, and also by at least one of the 6 commits this one reverts follows below. These 2 files will exhibit a hole in history unless git's '--follow' option is used when viewing logs. lib/curl_imap.h lib/curl_smtp.h
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-2/+2
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* tool_metalink: introduce metalink_cleanup() in the internal APIKamil Dudka2012-11-091-0/+8
| | | | ... to release resources allocated at global scope
* my_useragent: shorten user-agentDaniel Stenberg2012-05-121-6/+1
| | | | | The built-in user-agent will now only say curl/[version] and nothing else in an attempt to decrease overhead in HTTP requests.
* curl tool: make curl.h first header included in tool_setup.hYang Tse2012-04-081-2/+0
|
* curl tool: use configuration files from lib directoryYang Tse2012-04-061-2/+2
| | | | | | | | | | | Configuration files such as curl_config.h and all config-*.h no longer exist nor are generated/copied into 'src' directory, now these only exist in 'lib' directory from where curl tool sources uses them. Additionally old src/setup.h has been refactored into src/tool_setup.h which now pulls lib/setup.h The possibility of a makefile needing an include path adjustment exists.
* -J -O: use -O name if no Content-Disposition header comes!Daniel Stenberg2011-11-201-0/+18
| | | | | | | | | | | A regression between 7.22.0 and 7.23.0 -- downloading a file with the flags -O and -J results in the content being written to stdout if and only if there was no Content-Disposition header in the http response. If there is a C-D header with a filename attribute, the output is correctly written. Reported by: Dave Reisner Bug: http://curl.haxx.se/mail/archive-2011-11/0030.html
* curl tool: reviewed code moved to tool_*.[ch] filesYang Tse2011-10-061-2/+1
|
* curl tool: OOM handling fixesYang Tse2011-10-051-1/+2
|
* curl tool: OOM handling fixesYang Tse2011-10-051-6/+13
|
* curl tool: code moved to tool_*.[ch] filesYang Tse2011-10-051-0/+231