mirror of
https://github.com/curl/curl.git
synced 2026-07-25 06:48:07 +03:00
code: language cleanup in comments
Based on the standards and guidelines we use for our documentation. - expand contractions (they're => they are etc) - host name = > hostname - file name => filename - user name = username - man page => manpage - run-time => runtime - set-up => setup - back-end => backend - a HTTP => an HTTP - Two spaces after a period => one space after period Closes #14073
This commit is contained in:
parent
9b683577e1
commit
c074ba64a8
213 changed files with 1719 additions and 1715 deletions
|
|
@ -34,7 +34,7 @@ CURLTOOL_LIBCURL_CFILES = \
|
|||
../lib/base64.c \
|
||||
../lib/dynbuf.c
|
||||
|
||||
# libcurl has sources that provide functions named curlx_* that aren't part of
|
||||
# libcurl has sources that provide functions named curlx_* that are not part of
|
||||
# the official API, but we reuse the code here to avoid duplication.
|
||||
CURLX_CFILES = \
|
||||
../lib/base64.c \
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static const char *hms_for_sec(time_t tv_sec)
|
|||
}
|
||||
secs = epoch_offset + tv_sec;
|
||||
/* !checksrc! disable BANNEDFUNC 1 */
|
||||
now = localtime(&secs); /* not thread safe but we don't care */
|
||||
now = localtime(&secs); /* not thread safe but we do not care */
|
||||
msnprintf(hms_buf, sizeof(hms_buf), "%02d:%02d:%02d",
|
||||
now->tm_hour, now->tm_min, now->tm_sec);
|
||||
cached_tv_sec = tv_sec;
|
||||
|
|
@ -99,7 +99,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
|
|||
const char *text;
|
||||
struct timeval tv;
|
||||
char timebuf[20];
|
||||
/* largest signed 64bit is: 9,223,372,036,854,775,807
|
||||
/* largest signed 64-bit is: 9,223,372,036,854,775,807
|
||||
* max length in decimal: 1 + (6*3) = 19
|
||||
* formatted via TRC_IDS_FORMAT_IDS_2 this becomes 2 + 19 + 1 + 19 + 2 = 43
|
||||
* negative xfer-id are not printed, negative conn-ids use TRC_IDS_FORMAT_1
|
||||
|
|
@ -191,8 +191,8 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
|
|||
case CURLINFO_SSL_DATA_IN:
|
||||
case CURLINFO_SSL_DATA_OUT:
|
||||
if(!traced_data) {
|
||||
/* if the data is output to a tty and we're sending this debug trace
|
||||
to stderr or stdout, we don't display the alert about the data not
|
||||
/* if the data is output to a tty and we are sending this debug trace
|
||||
to stderr or stdout, we do not display the alert about the data not
|
||||
being shown as the data _is_ shown then just not via this
|
||||
function */
|
||||
if(!config->isatty ||
|
||||
|
|
@ -286,7 +286,7 @@ static void dump(const char *timebuf, const char *idsbuf, const char *text,
|
|||
(void)infotype;
|
||||
fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x7F)) ?
|
||||
ptr[i + c] : UNPRINTABLE_CHAR);
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
/* check again for 0D0A, to avoid an extra \n if it is at width */
|
||||
if((tracetype == TRACE_ASCII) &&
|
||||
(i + c + 2 < size) && (ptr[i + c + 1] == 0x0D) &&
|
||||
(ptr[i + c + 2] == 0x0A)) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static char *parse_filename(const char *ptr, size_t len);
|
|||
#else
|
||||
#define BOLD "\x1b[1m"
|
||||
/* Switch off bold by setting "all attributes off" since the explicit
|
||||
bold-off code (21) isn't supported everywhere - like in the mac
|
||||
bold-off code (21) is not supported everywhere - like in the mac
|
||||
Terminal. */
|
||||
#define BOLDOFF "\x1b[0m"
|
||||
/* OSC 8 hyperlink escape sequence */
|
||||
|
|
@ -273,7 +273,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
|||
}
|
||||
|
||||
/*
|
||||
* Copies a file name part and returns an ALLOCATED data buffer.
|
||||
* Copies a filename part and returns an ALLOCATED data buffer.
|
||||
*/
|
||||
static char *parse_filename(const char *ptr, size_t len)
|
||||
{
|
||||
|
|
@ -314,7 +314,7 @@ static char *parse_filename(const char *ptr, size_t len)
|
|||
}
|
||||
|
||||
/* If the filename contains a backslash, only use filename portion. The idea
|
||||
is that even systems that don't handle backslashes as path separators
|
||||
is that even systems that do not handle backslashes as path separators
|
||||
probably want the path removed for convenience. */
|
||||
q = strrchr(p, '\\');
|
||||
if(q) {
|
||||
|
|
@ -325,7 +325,7 @@ static char *parse_filename(const char *ptr, size_t len)
|
|||
}
|
||||
}
|
||||
|
||||
/* make sure the file name doesn't end in \r or \n */
|
||||
/* make sure the filename does not end in \r or \n */
|
||||
q = strchr(p, '\r');
|
||||
if(q)
|
||||
*q = '\0';
|
||||
|
|
@ -349,7 +349,7 @@ static char *parse_filename(const char *ptr, size_t len)
|
|||
#endif /* _WIN32 || MSDOS */
|
||||
|
||||
/* in case we built debug enabled, we allow an environment variable
|
||||
* named CURL_TESTDIR to prefix the given file name to put it into a
|
||||
* named CURL_TESTDIR to prefix the given filename to put it into a
|
||||
* specific directory
|
||||
*/
|
||||
#ifdef DEBUGBUILD
|
||||
|
|
@ -359,7 +359,7 @@ static char *parse_filename(const char *ptr, size_t len)
|
|||
char buffer[512]; /* suitably large */
|
||||
msnprintf(buffer, sizeof(buffer), "%s/%s", tdir, copy);
|
||||
Curl_safefree(copy);
|
||||
copy = strdup(buffer); /* clone the buffer, we don't use the libcurl
|
||||
copy = strdup(buffer); /* clone the buffer, we do not use the libcurl
|
||||
aprintf() or similar since we want to use the
|
||||
same memory code as the "real" parse_filename
|
||||
function */
|
||||
|
|
@ -376,9 +376,9 @@ static char *parse_filename(const char *ptr, size_t len)
|
|||
* Treat the Location: header specially, by writing a special escape
|
||||
* sequence that adds a hyperlink to the displayed text. This makes
|
||||
* the absolute URL of the redirect clickable in supported terminals,
|
||||
* which couldn't happen otherwise for relative URLs. The Location:
|
||||
* which could not happen otherwise for relative URLs. The Location:
|
||||
* header is supposed to always be absolute so this theoretically
|
||||
* shouldn't be needed but the real world returns plenty of relative
|
||||
* should not be needed but the real world returns plenty of relative
|
||||
* URLs here.
|
||||
*/
|
||||
static
|
||||
|
|
@ -450,7 +450,7 @@ void write_linked_location(CURL *curl, const char *location, size_t loclen,
|
|||
goto locdone;
|
||||
}
|
||||
|
||||
/* Not a "safe" URL: don't linkify it */
|
||||
/* Not a "safe" URL: do not linkify it */
|
||||
|
||||
locout:
|
||||
/* Write the normal output in case of error or unsafe */
|
||||
|
|
|
|||
|
|
@ -161,10 +161,10 @@ int tool_progress_cb(void *clientp,
|
|||
if(total) {
|
||||
/* we know the total data to get... */
|
||||
if(bar->prev == point)
|
||||
/* progress didn't change since last invoke */
|
||||
/* progress did not change since last invoke */
|
||||
return 0;
|
||||
else if((tvdiff(now, bar->prevtime) < 100L) && point < total)
|
||||
/* limit progress-bar updating to 10 Hz except when we're at 100% */
|
||||
/* limit progress-bar updating to 10 Hz except when we are at 100% */
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
|
|
@ -227,7 +227,7 @@ void progressbarinit(struct ProgressData *bar,
|
|||
memset(bar, 0, sizeof(struct ProgressData));
|
||||
|
||||
/* pass the resume from value through to the progress function so it can
|
||||
* display progress towards total file not just the part that's left. */
|
||||
* display progress towards total file not just the part that is left. */
|
||||
if(config->use_resume)
|
||||
bar->initial_size = config->resume_from;
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
|
|||
config->readbusy = TRUE;
|
||||
return CURL_READFUNC_PAUSE;
|
||||
}
|
||||
/* since size_t is unsigned we can't return negative values fine */
|
||||
/* since size_t is unsigned we cannot return negative values fine */
|
||||
rc = 0;
|
||||
}
|
||||
if((per->uploadfilesize != -1) &&
|
||||
|
|
|
|||
|
|
@ -64,17 +64,17 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence)
|
|||
curl_off_t left = offset;
|
||||
|
||||
if(whence != SEEK_SET)
|
||||
/* this code path doesn't support other types */
|
||||
/* this code path does not support other types */
|
||||
return CURL_SEEKFUNC_FAIL;
|
||||
|
||||
if(LSEEK_ERROR == lseek(per->infd, 0, SEEK_SET))
|
||||
/* couldn't rewind to beginning */
|
||||
/* could not rewind to beginning */
|
||||
return CURL_SEEKFUNC_FAIL;
|
||||
|
||||
while(left) {
|
||||
long step = (left > OUR_MAX_SEEK_O) ? OUR_MAX_SEEK_L : (long)left;
|
||||
if(LSEEK_ERROR == lseek(per->infd, step, SEEK_CUR))
|
||||
/* couldn't seek forwards the desired amount */
|
||||
/* could not seek forwards the desired amount */
|
||||
return CURL_SEEKFUNC_FAIL;
|
||||
left -= step;
|
||||
}
|
||||
|
|
@ -83,8 +83,8 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence)
|
|||
#endif
|
||||
|
||||
if(LSEEK_ERROR == lseek(per->infd, offset, whence))
|
||||
/* couldn't rewind, the reason is in errno but errno is just not portable
|
||||
enough and we don't actually care that much why we failed. We'll let
|
||||
/* could not rewind, the reason is in errno but errno is just not portable
|
||||
enough and we do not actually care that much why we failed. We will let
|
||||
libcurl know that it may try other means if it wants to. */
|
||||
return CURL_SEEKFUNC_CANTSEEK;
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ bool tool_create_output_file(struct OutStruct *outs,
|
|||
int fd;
|
||||
do {
|
||||
fd = open(fname, O_CREAT | O_WRONLY | O_EXCL | O_BINARY, OPENMODE);
|
||||
/* Keep retrying in the hope that it isn't interrupted sometime */
|
||||
/* Keep retrying in the hope that it is not interrupted sometime */
|
||||
} while(fd == -1 && errno == EINTR);
|
||||
if(config->file_clobber_mode == CLOBBER_NEVER && fd == -1) {
|
||||
int next_num = 1;
|
||||
|
|
@ -94,15 +94,15 @@ bool tool_create_output_file(struct OutStruct *outs,
|
|||
}
|
||||
memcpy(newname, fname, len);
|
||||
newname[len] = '.';
|
||||
while(fd == -1 && /* haven't successfully opened a file */
|
||||
while(fd == -1 && /* have not successfully opened a file */
|
||||
(errno == EEXIST || errno == EISDIR) &&
|
||||
/* because we keep having files that already exist */
|
||||
next_num < 100 /* and we haven't reached the retry limit */ ) {
|
||||
next_num < 100 /* and we have not reached the retry limit */ ) {
|
||||
curlx_msnprintf(newname + len + 1, 12, "%d", next_num);
|
||||
next_num++;
|
||||
do {
|
||||
fd = open(newname, O_CREAT | O_WRONLY | O_EXCL | O_BINARY, OPENMODE);
|
||||
/* Keep retrying in the hope that it isn't interrupted sometime */
|
||||
/* Keep retrying in the hope that it is not interrupted sometime */
|
||||
} while(fd == -1 && errno == EINTR);
|
||||
}
|
||||
outs->filename = newname; /* remember the new one */
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ struct OperationConfig {
|
|||
struct curl_slist *cookies; /* cookies to serialize into a single line */
|
||||
char *cookiejar; /* write to this file */
|
||||
struct curl_slist *cookiefiles; /* file(s) to load cookies from */
|
||||
char *altsvc; /* alt-svc cache file name */
|
||||
char *hsts; /* HSTS cache file name */
|
||||
char *altsvc; /* alt-svc cache filename */
|
||||
char *hsts; /* HSTS cache filename */
|
||||
bool cookiesession; /* new session? */
|
||||
bool encoding; /* Accept-Encoding please */
|
||||
bool tr_encoding; /* Transfer-Encoding please */
|
||||
|
|
@ -116,7 +116,7 @@ struct OperationConfig {
|
|||
bool failonerror; /* fail on (HTTP) errors */
|
||||
bool failwithbody; /* fail on (HTTP) errors but still store body */
|
||||
bool show_headers; /* show headers to data output */
|
||||
bool no_body; /* don't get the body */
|
||||
bool no_body; /* do not get the body */
|
||||
bool dirlistonly; /* only get the FTP dir list */
|
||||
bool followlocation; /* follow http redirects */
|
||||
bool unrestricted_auth; /* Continue to send authentication (user+password)
|
||||
|
|
@ -312,8 +312,8 @@ struct OperationConfig {
|
|||
|
||||
struct GlobalConfig {
|
||||
bool showerror; /* show errors when silent */
|
||||
bool silent; /* don't show messages, --silent given */
|
||||
bool noprogress; /* don't show progress bar */
|
||||
bool silent; /* do not show messages, --silent given */
|
||||
bool noprogress; /* do not show progress bar */
|
||||
bool isatty; /* Updated internally if output is a tty */
|
||||
char *trace_dump; /* file to dump the network trace to */
|
||||
FILE *trace_stream;
|
||||
|
|
@ -322,7 +322,7 @@ struct GlobalConfig {
|
|||
bool tracetime; /* include timestamp? */
|
||||
bool traceids; /* include xfer-/conn-id? */
|
||||
int progressmode; /* CURL_PROGRESS_BAR / CURL_PROGRESS_STATS */
|
||||
char *libcurl; /* Output libcurl code to this file name */
|
||||
char *libcurl; /* Output libcurl code to this filename */
|
||||
bool fail_early; /* exit on first transfer error */
|
||||
bool styled_output; /* enable fancy output style detection */
|
||||
long ms_per_transfer; /* start next transfer after (at least) this
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static void show_dir_errno(struct GlobalConfig *global, const char *name)
|
|||
switch(errno) {
|
||||
#ifdef EACCES
|
||||
case EACCES:
|
||||
errorf(global, "You don't have permission to create %s", name);
|
||||
errorf(global, "You do not have permission to create %s", name);
|
||||
break;
|
||||
#endif
|
||||
#ifdef ENAMETOOLONG
|
||||
|
|
@ -117,7 +117,7 @@ CURLcode create_dir_hierarchy(const char *outfile, struct GlobalConfig *global)
|
|||
}
|
||||
dirbuildup[0] = '\0';
|
||||
|
||||
/* Allow strtok() here since this isn't used threaded */
|
||||
/* Allow strtok() here since this is not used threaded */
|
||||
/* !checksrc! disable BANNEDFUNC 2 */
|
||||
tempdir = strtok(outdup, PATH_DELIMITERS);
|
||||
|
||||
|
|
@ -137,13 +137,13 @@ CURLcode create_dir_hierarchy(const char *outfile, struct GlobalConfig *global)
|
|||
It may seem as though that would harmlessly fail but it could be
|
||||
a corner case if X: did not exist, since we would be creating it
|
||||
erroneously.
|
||||
eg if outfile is X:\foo\bar\filename then don't mkdir X:
|
||||
eg if outfile is X:\foo\bar\filename then do not mkdir X:
|
||||
This logic takes into account unsupported drives !:, 1:, etc. */
|
||||
char *p = strchr(tempdir, ':');
|
||||
if(p && !p[1])
|
||||
skip = true;
|
||||
#endif
|
||||
/* the output string doesn't start with a separator */
|
||||
/* the output string does not start with a separator */
|
||||
strcpy(dirbuildup, tempdir);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# define _use_lfn(f) (1) /* long file names always available */
|
||||
# define _use_lfn(f) (1) /* long filenames always available */
|
||||
#elif !defined(__DJGPP__) || (__DJGPP__ < 2) /* DJGPP 2.0 has _use_lfn() */
|
||||
# define _use_lfn(f) (0) /* long file names never available */
|
||||
# define _use_lfn(f) (0) /* long filenames never available */
|
||||
#elif defined(__DJGPP__)
|
||||
# include <fcntl.h> /* _use_lfn(f) prototype */
|
||||
#endif
|
||||
|
|
@ -98,8 +98,8 @@ SANITIZE_ALLOW_PATH: Allow path separators and colons.
|
|||
Without this flag path separators and colons are sanitized.
|
||||
|
||||
SANITIZE_ALLOW_RESERVED: Allow reserved device names.
|
||||
Without this flag a reserved device name is renamed (COM1 => _COM1) unless it's
|
||||
in a UNC prefixed path.
|
||||
Without this flag a reserved device name is renamed (COM1 => _COM1) unless it
|
||||
is in a UNC prefixed path.
|
||||
|
||||
SANITIZE_ALLOW_TRUNCATE: Allow truncating a long filename.
|
||||
Without this flag if the sanitized filename or path will be too long an error
|
||||
|
|
@ -136,9 +136,9 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name,
|
|||
max_sanitized_len = PATH_MAX-1;
|
||||
}
|
||||
else
|
||||
/* The maximum length of a filename.
|
||||
FILENAME_MAX is often the same as PATH_MAX, in other words it is 260 and
|
||||
does not discount the path information therefore we shouldn't use it. */
|
||||
/* The maximum length of a filename. FILENAME_MAX is often the same as
|
||||
PATH_MAX, in other words it is 260 and does not discount the path
|
||||
information therefore we should not use it. */
|
||||
max_sanitized_len = (PATH_MAX-1 > 255) ? 255 : PATH_MAX-1;
|
||||
|
||||
len = strlen(file_name);
|
||||
|
|
@ -237,7 +237,7 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name,
|
|||
|
||||
/*
|
||||
Test if truncating a path to a file will leave at least a single character in
|
||||
the filename. Filenames suffixed by an alternate data stream can't be
|
||||
the filename. Filenames suffixed by an alternate data stream cannot be
|
||||
truncated. This performs a dry run, nothing is modified.
|
||||
|
||||
Good truncate_pos 9: C:\foo\bar => C:\foo\ba
|
||||
|
|
@ -253,7 +253,7 @@ Error truncate_pos 7: C:\foo => (pos out of range)
|
|||
Bad truncate_pos 1: C:\foo\ => C
|
||||
|
||||
* C:foo is ambiguous, C could end up being a drive or file therefore something
|
||||
like C:superlongfilename can't be truncated.
|
||||
like C:superlongfilename cannot be truncated.
|
||||
|
||||
Returns
|
||||
SANITIZE_ERR_OK: Good -- 'path' can be truncated
|
||||
|
|
@ -278,7 +278,7 @@ SANITIZEcode truncate_dryrun(const char *path, const size_t truncate_pos)
|
|||
if(strpbrk(&path[truncate_pos - 1], "\\/:"))
|
||||
return SANITIZE_ERR_INVALID_PATH;
|
||||
|
||||
/* C:\foo can be truncated but C:\foo:ads can't */
|
||||
/* C:\foo can be truncated but C:\foo:ads cannot */
|
||||
if(truncate_pos > 1) {
|
||||
const char *p = &path[truncate_pos - 1];
|
||||
do {
|
||||
|
|
@ -357,8 +357,8 @@ SANITIZEcode msdosify(char **const sanitized, const char *file_name,
|
|||
*d = ':';
|
||||
else if((flags & SANITIZE_ALLOW_PATH) && (*s == '/' || *s == '\\'))
|
||||
*d = *s;
|
||||
/* Dots are special: DOS doesn't allow them as the leading character,
|
||||
and a file name cannot have more than a single dot. We leave the
|
||||
/* Dots are special: DOS does not allow them as the leading character,
|
||||
and a filename cannot have more than a single dot. We leave the
|
||||
first non-leading dot alone, unless it comes too close to the
|
||||
beginning of the name: we want sh.lex.c to become sh_lex.c, not
|
||||
sh.lex-c. */
|
||||
|
|
@ -445,7 +445,7 @@ SANITIZEcode msdosify(char **const sanitized, const char *file_name,
|
|||
#endif /* MSDOS || UNITTESTS */
|
||||
|
||||
/*
|
||||
Rename file_name if it's a reserved dos device name.
|
||||
Rename file_name if it is a reserved dos device name.
|
||||
|
||||
This is a supporting function for sanitize_file_name.
|
||||
|
||||
|
|
@ -461,8 +461,8 @@ SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized,
|
|||
const char *file_name,
|
||||
int flags)
|
||||
{
|
||||
/* We could have a file whose name is a device on MS-DOS. Trying to
|
||||
* retrieve such a file would fail at best and wedge us at worst. We need
|
||||
/* We could have a file whose name is a device on MS-DOS. Trying to
|
||||
* retrieve such a file would fail at best and wedge us at worst. We need
|
||||
* to rename such files. */
|
||||
char *p, *base;
|
||||
char fname[PATH_MAX];
|
||||
|
|
@ -560,9 +560,10 @@ SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized,
|
|||
/* This is the legacy portion from rename_if_dos_device_name that checks for
|
||||
reserved device names. It only works on MSDOS. On Windows XP the stat
|
||||
check errors with EINVAL if the device name is reserved. On Windows
|
||||
Vista/7/8 it sets mode S_IFREG (regular file or device). According to MSDN
|
||||
stat doc the latter behavior is correct, but that doesn't help us identify
|
||||
whether it's a reserved device name and not a regular file name. */
|
||||
Vista/7/8 it sets mode S_IFREG (regular file or device). According to
|
||||
MSDN stat doc the latter behavior is correct, but that does not help us
|
||||
identify whether it is a reserved device name and not a regular
|
||||
filename. */
|
||||
#ifdef MSDOS
|
||||
if(base && ((stat(base, &st_buf)) == 0) && (S_ISCHR(st_buf.st_mode))) {
|
||||
/* Prepend a '_' */
|
||||
|
|
@ -683,7 +684,7 @@ struct curl_slist *GetLoadedModulePaths(void)
|
|||
|
||||
#ifdef UNICODE
|
||||
/* sizeof(mod.szExePath) is the max total bytes of wchars. the max total
|
||||
bytes of multibyte chars won't be more than twice that. */
|
||||
bytes of multibyte chars will not be more than twice that. */
|
||||
char buffer[sizeof(mod.szExePath) * 2];
|
||||
if(!WideCharToMultiByte(CP_ACP, 0, mod.szExePath, -1,
|
||||
buffer, sizeof(buffer), NULL, NULL))
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ int getfiletime(const char *filename, struct GlobalConfig *global,
|
|||
int rc = 1;
|
||||
|
||||
/* Windows stat() may attempt to adjust the unix GMT file time by a daylight
|
||||
saving time offset and since it's GMT that is bad behavior. When we have
|
||||
saving time offset and since it is GMT that is bad behavior. When we have
|
||||
access to a 64-bit type we can bypass stat and get the times directly. */
|
||||
#if defined(_WIN32) && !defined(CURL_WINDOWS_APP)
|
||||
HANDLE hfile;
|
||||
|
|
@ -93,7 +93,7 @@ void setfiletime(curl_off_t filetime, const char *filename,
|
|||
{
|
||||
if(filetime >= 0) {
|
||||
/* Windows utime() may attempt to adjust the unix GMT file time by a daylight
|
||||
saving time offset and since it's GMT that is bad behavior. When we have
|
||||
saving time offset and since it is GMT that is bad behavior. When we have
|
||||
access to a 64-bit type we can bypass utime and set the times directly. */
|
||||
#if defined(_WIN32) && !defined(CURL_WINDOWS_APP)
|
||||
HANDLE hfile;
|
||||
|
|
|
|||
|
|
@ -637,7 +637,7 @@ static int get_param_part(struct OperationConfig *config, char endchar,
|
|||
*pfilename = filename;
|
||||
else if(filename)
|
||||
warnf(config->global,
|
||||
"Field file name not allowed here: %s", filename);
|
||||
"Field filename not allowed here: %s", filename);
|
||||
|
||||
if(pencoder)
|
||||
*pencoder = encoder;
|
||||
|
|
@ -693,7 +693,7 @@ static int get_param_part(struct OperationConfig *config, char endchar,
|
|||
* 'name=foo;headers=@headerfile' or why not
|
||||
* 'name=@filemame;headers=@headerfile'
|
||||
*
|
||||
* To upload a file, but to fake the file name that will be included in the
|
||||
* To upload a file, but to fake the filename that will be included in the
|
||||
* formpost, do like this:
|
||||
*
|
||||
* 'name=@filename;filename=/dev/null' or quote the faked filename like:
|
||||
|
|
@ -720,7 +720,7 @@ int formparse(struct OperationConfig *config,
|
|||
struct tool_mime **mimecurrent,
|
||||
bool literal_value)
|
||||
{
|
||||
/* input MUST be a string in the format 'name=contents' and we'll
|
||||
/* input MUST be a string in the format 'name=contents' and we will
|
||||
build a linked list with the info */
|
||||
char *name = NULL;
|
||||
char *contents = NULL;
|
||||
|
|
@ -779,7 +779,7 @@ int formparse(struct OperationConfig *config,
|
|||
}
|
||||
else if('@' == contp[0] && !literal_value) {
|
||||
|
||||
/* we use the @-letter to indicate file name(s) */
|
||||
/* we use the @-letter to indicate filename(s) */
|
||||
|
||||
struct tool_mime *subparts = NULL;
|
||||
|
||||
|
|
@ -831,7 +831,7 @@ int formparse(struct OperationConfig *config,
|
|||
SET_TOOL_MIME_PTR(part, encoder);
|
||||
|
||||
/* *contp could be '\0', so we just check with the delimiter */
|
||||
} while(sep); /* loop if there's another file name */
|
||||
} while(sep); /* loop if there is another filename */
|
||||
part = (*mimecurrent)->subparts; /* Set name on group. */
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ struct LongShort {
|
|||
ARG_NONE, /* stand-alone but not a boolean */
|
||||
ARG_BOOL, /* accepts a --no-[name] prefix */
|
||||
ARG_STRG, /* requires an argument */
|
||||
ARG_FILE /* requires an argument, usually a file name */
|
||||
ARG_FILE /* requires an argument, usually a filename */
|
||||
} desc;
|
||||
char letter; /* short name option or ' ' */
|
||||
cmdline_t cmd;
|
||||
|
|
@ -637,7 +637,7 @@ static const struct LongShort aliases[]= {
|
|||
|
||||
/* Split the argument of -E to 'certname' and 'passphrase' separated by colon.
|
||||
* We allow ':' and '\' to be escaped by '\' so that we can use certificate
|
||||
* nicknames containing ':'. See <https://sourceforge.net/p/curl/bugs/1196/>
|
||||
* nicknames containing ':'. See <https://sourceforge.net/p/curl/bugs/1196/>
|
||||
* for details. */
|
||||
#ifndef UNITTESTS
|
||||
static
|
||||
|
|
@ -678,7 +678,7 @@ void parse_cert_parameter(const char *cert_parameter,
|
|||
strncpy(certname_place, param_place, span);
|
||||
param_place += span;
|
||||
certname_place += span;
|
||||
/* we just ate all the non-special chars. now we're on either a special
|
||||
/* we just ate all the non-special chars. now we are on either a special
|
||||
* char or the end of the string. */
|
||||
switch(*param_place) {
|
||||
case '\0':
|
||||
|
|
@ -708,7 +708,7 @@ void parse_cert_parameter(const char *cert_parameter,
|
|||
/* Since we live in a world of weirdness and confusion, the win32
|
||||
dudes can use : when using drive letters and thus c:\file:password
|
||||
needs to work. In order not to break compatibility, we still use : as
|
||||
separator, but we try to detect when it is used for a file name! On
|
||||
separator, but we try to detect when it is used for a filename! On
|
||||
windows. */
|
||||
#ifdef _WIN32
|
||||
if((param_place == &cert_parameter[1]) &&
|
||||
|
|
@ -724,7 +724,7 @@ void parse_cert_parameter(const char *cert_parameter,
|
|||
}
|
||||
#endif
|
||||
/* escaped colons and Windows drive letter colons were handled
|
||||
* above; if we're still here, this is a separating colon */
|
||||
* above; if we are still here, this is a separating colon */
|
||||
param_place++;
|
||||
if(*param_place) {
|
||||
*passphrase = strdup(param_place);
|
||||
|
|
@ -835,7 +835,7 @@ static ParameterError GetSizeParameter(struct GlobalConfig *global,
|
|||
static void cleanarg(argv_item_t str)
|
||||
{
|
||||
/* now that getstr has copied the contents of nextarg, wipe the next
|
||||
* argument out so that the username:password isn't displayed in the
|
||||
* argument out so that the username:password is not displayed in the
|
||||
* system process list */
|
||||
if(str) {
|
||||
size_t len = strlen(str);
|
||||
|
|
@ -853,7 +853,7 @@ static ParameterError data_urlencode(struct GlobalConfig *global,
|
|||
size_t *lenp)
|
||||
{
|
||||
/* [name]=[content], we encode the content part only
|
||||
* [name]@[file name]
|
||||
* [name]@[filename]
|
||||
*
|
||||
* Case 2: we first load the file using that name and then encode
|
||||
* the content.
|
||||
|
|
@ -872,14 +872,14 @@ static ParameterError data_urlencode(struct GlobalConfig *global,
|
|||
is_file = *p++; /* pass the separator */
|
||||
}
|
||||
else {
|
||||
/* neither @ nor =, so no name and it isn't a file */
|
||||
/* neither @ nor =, so no name and it is not a file */
|
||||
nlen = 0;
|
||||
is_file = 0;
|
||||
p = nextarg;
|
||||
}
|
||||
if('@' == is_file) {
|
||||
FILE *file;
|
||||
/* a '@' letter, it means that a file name or - (stdin) follows */
|
||||
/* a '@' letter, it means that a filename or - (stdin) follows */
|
||||
if(!strcmp("-", p)) {
|
||||
file = stdin;
|
||||
set_binmode(stdin);
|
||||
|
|
@ -964,7 +964,7 @@ static CURLcode set_trace_config(struct GlobalConfig *global,
|
|||
if(!tmp)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* Allow strtok() here since this isn't used threaded */
|
||||
/* Allow strtok() here since this is not used threaded */
|
||||
/* !checksrc! disable BANNEDFUNC 2 */
|
||||
token = strtok(tmp, ", ");
|
||||
while(token) {
|
||||
|
|
@ -1134,7 +1134,7 @@ static ParameterError set_data(cmdline_t cmd,
|
|||
return err;
|
||||
}
|
||||
else if('@' == *nextarg && (cmd != C_DATA_RAW)) {
|
||||
/* the data begins with a '@' letter, it means that a file name
|
||||
/* the data begins with a '@' letter, it means that a filename
|
||||
or - (stdin) follows */
|
||||
nextarg++; /* pass the @ */
|
||||
|
||||
|
|
@ -1293,7 +1293,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
(void)cleararg;
|
||||
#endif
|
||||
|
||||
*usedarg = FALSE; /* default is that we don't use the arg */
|
||||
*usedarg = FALSE; /* default is that we do not use the arg */
|
||||
|
||||
if(('-' != flag[0]) || ('-' == flag[1])) {
|
||||
/* this should be a long name */
|
||||
|
|
@ -1325,7 +1325,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
goto error;
|
||||
}
|
||||
if(noflagged && (a->desc != ARG_BOOL)) {
|
||||
/* --no- prefixed an option that isn't boolean! */
|
||||
/* --no- prefixed an option that is not boolean! */
|
||||
err = PARAM_NO_NOT_BOOLEAN;
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -1335,7 +1335,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
|
||||
if((a->desc != ARG_STRG) &&
|
||||
(a->desc != ARG_FILE)) {
|
||||
/* --expand on an option that isn't a string or a filename */
|
||||
/* --expand on an option that is not a string or a filename */
|
||||
err = PARAM_EXPAND_ERROR;
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -1373,7 +1373,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
/* this option requires an extra parameter */
|
||||
if(!longopt && parse[1]) {
|
||||
nextarg = (char *)&parse[1]; /* this is the actual extra parameter */
|
||||
singleopt = TRUE; /* don't loop anymore after this */
|
||||
singleopt = TRUE; /* do not loop anymore after this */
|
||||
}
|
||||
else if(!nextarg) {
|
||||
err = PARAM_REQUIRES_PARAMETER;
|
||||
|
|
@ -1388,8 +1388,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
|
||||
if((a->desc == ARG_FILE) &&
|
||||
(nextarg[0] == '-') && nextarg[1]) {
|
||||
/* if the file name looks like a command line option */
|
||||
warnf(global, "The file name argument '%s' looks like a flag.",
|
||||
/* if the filename looks like a command line option */
|
||||
warnf(global, "The filename argument '%s' looks like a flag.",
|
||||
nextarg);
|
||||
}
|
||||
else if(!strncmp("\xe2\x80\x9c", nextarg, 3)) {
|
||||
|
|
@ -1546,7 +1546,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
case C_ANYAUTH: /* --anyauth */
|
||||
if(toggle)
|
||||
config->authtype = CURLAUTH_ANY;
|
||||
/* --no-anyauth simply doesn't touch it */
|
||||
/* --no-anyauth simply does not touch it */
|
||||
break;
|
||||
#ifdef USE_WATT32
|
||||
case C_WDEBUG: /* --wdebug */
|
||||
|
|
@ -1625,7 +1625,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
config->url_get = config->url_list;
|
||||
|
||||
if(config->url_get) {
|
||||
/* there's a node here, if it already is filled-in continue to find
|
||||
/* there is a node here, if it already is filled-in continue to find
|
||||
an "empty" node */
|
||||
while(config->url_get && (config->url_get->flags & GETOUT_URL))
|
||||
config->url_get = config->url_get->next;
|
||||
|
|
@ -1758,7 +1758,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
while(ISDIGIT(*p))
|
||||
p++;
|
||||
if(*p) {
|
||||
/* if there's anything more than a plain decimal number */
|
||||
/* if there is anything more than a plain decimal number */
|
||||
rc = sscanf(p, " - %6s", lrange);
|
||||
*p = 0; /* null-terminate to make str2unum() work below */
|
||||
}
|
||||
|
|
@ -2451,7 +2451,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
else {
|
||||
err = file2memory(&string, &len, file);
|
||||
if(!err && string) {
|
||||
/* Allow strtok() here since this isn't used threaded */
|
||||
/* Allow strtok() here since this is not used threaded */
|
||||
/* !checksrc! disable BANNEDFUNC 2 */
|
||||
char *h = strtok(string, "\r\n");
|
||||
while(h) {
|
||||
|
|
@ -2561,7 +2561,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
if(!config->url_out)
|
||||
config->url_out = config->url_list;
|
||||
if(config->url_out) {
|
||||
/* there's a node here, if it already is filled-in continue to find
|
||||
/* there is a node here, if it already is filled-in continue to find
|
||||
an "empty" node */
|
||||
while(config->url_out && (config->url_out->flags & GETOUT_OUTFILE))
|
||||
config->url_out = config->url_out->next;
|
||||
|
|
@ -2612,7 +2612,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
break;
|
||||
|
||||
case C_DISABLE: /* --disable */
|
||||
/* if used first, already taken care of, we do it like this so we don't
|
||||
/* if used first, already taken care of, we do it like this so we do not
|
||||
cause an error! */
|
||||
break;
|
||||
case C_QUOTE: /* --quote */
|
||||
|
|
@ -2635,9 +2635,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
break;
|
||||
case C_RANGE: /* --range */
|
||||
/* Specifying a range WITHOUT A DASH will create an illegal HTTP range
|
||||
(and won't actually be range by definition). The man page previously
|
||||
claimed that to be a good way, why this code is added to work-around
|
||||
it. */
|
||||
(and will not actually be range by definition). The manpage
|
||||
previously claimed that to be a good way, why this code is added to
|
||||
work-around it. */
|
||||
if(ISDIGIT(*nextarg) && !strchr(nextarg, '-')) {
|
||||
char buffer[32];
|
||||
if(curlx_strtoofft(nextarg, NULL, 10, &value)) {
|
||||
|
|
@ -2691,7 +2691,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
if(!config->url_ul)
|
||||
config->url_ul = config->url_list;
|
||||
if(config->url_ul) {
|
||||
/* there's a node here, if it already is filled-in continue to find
|
||||
/* there is a node here, if it already is filled-in continue to find
|
||||
an "empty" node */
|
||||
while(config->url_ul && (config->url_ul->flags & GETOUT_UPLOAD))
|
||||
config->url_ul = config->url_ul->next;
|
||||
|
|
@ -2754,7 +2754,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
case C_WRITE_OUT: /* --write-out */
|
||||
/* get the output string */
|
||||
if('@' == *nextarg) {
|
||||
/* the data begins with a '@' letter, it means that a file name
|
||||
/* the data begins with a '@' letter, it means that a filename
|
||||
or - (stdin) follows */
|
||||
FILE *file;
|
||||
const char *fname;
|
||||
|
|
@ -2851,7 +2851,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
now = time(NULL);
|
||||
config->condtime = (curl_off_t)curl_getdate(nextarg, &now);
|
||||
if(-1 == config->condtime) {
|
||||
/* now let's see if it is a file name to get the time from instead! */
|
||||
/* now let's see if it is a filename to get the time from instead! */
|
||||
rc = getfiletime(nextarg, global, &value);
|
||||
if(!rc)
|
||||
/* pull the time out from the file */
|
||||
|
|
@ -2861,7 +2861,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
config->timecond = CURL_TIMECOND_NONE;
|
||||
warnf(global,
|
||||
"Illegal date format for -z, --time-cond (and not "
|
||||
"a file name). Disabling time condition. "
|
||||
"a filename). Disabling time condition. "
|
||||
"See curl_getdate(3) for valid date syntax.");
|
||||
}
|
||||
}
|
||||
|
|
@ -2950,7 +2950,7 @@ ParameterError parse_args(struct GlobalConfig *global, int argc,
|
|||
}
|
||||
}
|
||||
else if(!result && passarg)
|
||||
i++; /* we're supposed to skip this */
|
||||
i++; /* we are supposed to skip this */
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
|||
long sts;
|
||||
short chan;
|
||||
|
||||
/* MSK, 23-JAN-2004, iosbdef.h wasn't in VAX V7.2 or CC 6.4 */
|
||||
/* distribution so I created this. May revert back later to */
|
||||
/* MSK, 23-JAN-2004, iosbdef.h was not in VAX V7.2 or CC 6.4 */
|
||||
/* distribution so I created this. May revert back later to */
|
||||
/* struct _iosb iosb; */
|
||||
struct _iosb
|
||||
{
|
||||
|
|
@ -115,7 +115,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
|||
}
|
||||
/* since echo is disabled, print a newline */
|
||||
fputs("\n", tool_stderr);
|
||||
/* if user didn't hit ENTER, terminate buffer */
|
||||
/* if user did not hit ENTER, terminate buffer */
|
||||
if(i == buflen)
|
||||
buffer[buflen-1] = '\0';
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ static bool ttyecho(bool enable, int fd)
|
|||
noecho.c_lflag &= ~(tcflag_t)ECHO;
|
||||
ioctl(fd, TCSETA, &noecho);
|
||||
#else
|
||||
/* neither HAVE_TERMIO_H nor HAVE_TERMIOS_H, we can't disable echo! */
|
||||
/* neither HAVE_TERMIO_H nor HAVE_TERMIOS_H, we cannot disable echo! */
|
||||
(void)fd;
|
||||
return FALSE; /* not disabled */
|
||||
#endif
|
||||
|
|
@ -180,7 +180,7 @@ char *getpass_r(const char *prompt, /* prompt to display */
|
|||
bool disabled;
|
||||
int fd = open("/dev/tty", O_RDONLY);
|
||||
if(-1 == fd)
|
||||
fd = STDIN_FILENO; /* use stdin if the tty couldn't be used */
|
||||
fd = STDIN_FILENO; /* use stdin if the tty could not be used */
|
||||
|
||||
disabled = ttyecho(FALSE, fd); /* disable terminal echo */
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include "tool_setup.h"
|
||||
|
||||
#ifndef HAVE_GETPASS_R
|
||||
/* If there's a system-provided function named like this, we trust it is
|
||||
/* If there is a system-provided function named like this, we trust it is
|
||||
also found in one of the standard headers. */
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ static const struct category_descriptors categories[] = {
|
|||
{"http", "HTTP and HTTPS protocol options", CURLHELP_HTTP},
|
||||
{"imap", "IMAP protocol options", CURLHELP_IMAP},
|
||||
/* important is left out because it is the default help page */
|
||||
{"misc", "Options that don't fit into any other category", CURLHELP_MISC},
|
||||
{"misc", "Options that do not fit into any other category", CURLHELP_MISC},
|
||||
{"output", "Filesystem output", CURLHELP_OUTPUT},
|
||||
{"pop3", "POP3 protocol options", CURLHELP_POP3},
|
||||
{"post", "HTTP Post specific options", CURLHELP_POST},
|
||||
|
|
|
|||
|
|
@ -58,17 +58,17 @@ const char *param2text(ParameterError error)
|
|||
case PARAM_NEGATIVE_NUMERIC:
|
||||
return "expected a positive numerical parameter";
|
||||
case PARAM_LIBCURL_DOESNT_SUPPORT:
|
||||
return "the installed libcurl version doesn't support this";
|
||||
return "the installed libcurl version does not support this";
|
||||
case PARAM_LIBCURL_UNSUPPORTED_PROTOCOL:
|
||||
return "a specified protocol is unsupported by libcurl";
|
||||
case PARAM_NO_MEM:
|
||||
return "out of memory";
|
||||
case PARAM_NO_PREFIX:
|
||||
return "the given option can't be reversed with a --no- prefix";
|
||||
return "the given option cannot be reversed with a --no- prefix";
|
||||
case PARAM_NUMBER_TOO_LARGE:
|
||||
return "too large number";
|
||||
case PARAM_NO_NOT_BOOLEAN:
|
||||
return "used '--no-' for option that isn't a boolean";
|
||||
return "used '--no-' for option that is not a boolean";
|
||||
case PARAM_CONTDISP_SHOW_HEADER:
|
||||
return "showing headers and --remote-header-name cannot be combined";
|
||||
case PARAM_CONTDISP_RESUME_FROM:
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ static char *ipfs_gateway(void)
|
|||
char *home = getenv("HOME");
|
||||
if(home && *home)
|
||||
ipfs_path = aprintf("%s/.ipfs/", home);
|
||||
/* fallback to "~/.ipfs", as that's the default location. */
|
||||
/* fallback to "~/.ipfs", as that is the default location. */
|
||||
}
|
||||
|
||||
if(!ipfs_path || ensure_trailing_slash(&ipfs_path))
|
||||
|
|
@ -132,7 +132,7 @@ fail:
|
|||
}
|
||||
|
||||
/*
|
||||
* Rewrite ipfs://<cid> and ipns://<cid> to a HTTP(S)
|
||||
* Rewrite ipfs://<cid> and ipns://<cid> to an HTTP(S)
|
||||
* URL that can be handled by an IPFS gateway.
|
||||
*/
|
||||
CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
|
||||
|
|
@ -162,7 +162,7 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
|
|||
goto clean;
|
||||
|
||||
/* We might have a --ipfs-gateway argument. Check it first and use it. Error
|
||||
* if we do have something but if it's an invalid url.
|
||||
* if we do have something but if it is an invalid url.
|
||||
*/
|
||||
if(config->ipfs_gateway) {
|
||||
/* ensure the gateway ends in a trailing / */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include "memdebug.h" /* keep this as LAST include */
|
||||
|
||||
/* global variable definitions, for libcurl run-time info */
|
||||
/* global variable definitions, for libcurl runtime info */
|
||||
|
||||
static const char *no_protos = NULL;
|
||||
|
||||
|
|
@ -126,8 +126,8 @@ static const char *fnames[sizeof(maybe_feature) / sizeof(maybe_feature[0])];
|
|||
const char * const *feature_names = fnames;
|
||||
|
||||
/*
|
||||
* libcurl_info_init: retrieves run-time information about libcurl,
|
||||
* setting a global pointer 'curlinfo' to libcurl's run-time info
|
||||
* libcurl_info_init: retrieves runtime information about libcurl,
|
||||
* setting a global pointer 'curlinfo' to libcurl's runtime info
|
||||
* struct, count protocols and flag those we are interested in.
|
||||
* Global pointer feature_names is set to the feature names array. If
|
||||
* the latter is not returned by curl_version_info(), it is built from
|
||||
|
|
@ -139,7 +139,7 @@ CURLcode get_libcurl_info(void)
|
|||
CURLcode result = CURLE_OK;
|
||||
const char *const *builtin;
|
||||
|
||||
/* Pointer to libcurl's run-time version information */
|
||||
/* Pointer to libcurl's runtime version information */
|
||||
curlinfo = curl_version_info(CURLVERSION_NOW);
|
||||
if(!curlinfo)
|
||||
return CURLE_FAILED_INIT;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
***************************************************************************/
|
||||
#include "tool_setup.h"
|
||||
|
||||
/* global variable declarations, for libcurl run-time info */
|
||||
/* global variable declarations, for libcurl runtime info */
|
||||
|
||||
|
||||
extern curl_version_info_data *curlinfo;
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ const struct helptxt helptext[] = {
|
|||
"Maximum concurrency for parallel transfers",
|
||||
CURLHELP_CONNECTION | CURLHELP_CURL},
|
||||
{" --pass <phrase>",
|
||||
"Pass phrase for the private key",
|
||||
"Passphrase for the private key",
|
||||
CURLHELP_SSH | CURLHELP_TLS | CURLHELP_AUTH},
|
||||
{" --path-as-is",
|
||||
"Do not squash .. sequences in URL path",
|
||||
|
|
@ -541,7 +541,7 @@ const struct helptxt helptext[] = {
|
|||
"NTLM authentication with the proxy",
|
||||
CURLHELP_PROXY | CURLHELP_AUTH},
|
||||
{" --proxy-pass <phrase>",
|
||||
"Pass phrase for the private key for HTTPS proxy",
|
||||
"Passphrase for the private key for HTTPS proxy",
|
||||
CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH},
|
||||
{" --proxy-pinnedpubkey <hashes>",
|
||||
"FILE/HASHES public key to verify proxy with",
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ int _CRT_glob = 0;
|
|||
#if defined(HAVE_PIPE) && defined(HAVE_FCNTL)
|
||||
/*
|
||||
* Ensure that file descriptors 0, 1 and 2 (stdin, stdout, stderr) are
|
||||
* open before starting to run. Otherwise, the first three network
|
||||
* open before starting to run. Otherwise, the first three network
|
||||
* sockets opened by curl could be used for input sources, downloaded data
|
||||
* or error logs as they will effectively be stdin, stdout and/or stderr.
|
||||
*
|
||||
|
|
@ -110,7 +110,7 @@ static void memory_tracking_init(void)
|
|||
/* if CURL_MEMDEBUG is set, this starts memory tracking message logging */
|
||||
env = curl_getenv("CURL_MEMDEBUG");
|
||||
if(env) {
|
||||
/* use the value as file name */
|
||||
/* use the value as filename */
|
||||
char fname[CURL_MT_LOGFNAME_BUFSIZE];
|
||||
if(strlen(env) >= CURL_MT_LOGFNAME_BUFSIZE)
|
||||
env[CURL_MT_LOGFNAME_BUFSIZE-1] = '\0';
|
||||
|
|
@ -219,7 +219,7 @@ static void main_free(struct GlobalConfig *config)
|
|||
*/
|
||||
#ifdef _UNICODE
|
||||
#if defined(__GNUC__)
|
||||
/* GCC doesn't know about wmain() */
|
||||
/* GCC does not know about wmain() */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
|
||||
#ifndef O_BINARY
|
||||
/* since O_BINARY as used in bitmasks, setting it to zero makes it usable in
|
||||
source code but yet it doesn't ruin anything */
|
||||
source code but yet it does not ruin anything */
|
||||
# define O_BINARY 0
|
||||
#endif
|
||||
|
||||
|
|
@ -104,11 +104,11 @@
|
|||
# define SOL_IP IPPROTO_IP
|
||||
#endif
|
||||
|
||||
#define CURL_CA_CERT_ERRORMSG \
|
||||
"More details here: https://curl.se/docs/sslcerts.html\n\n" \
|
||||
"curl failed to verify the legitimacy of the server and therefore " \
|
||||
"could not\nestablish a secure connection to it. To learn more about " \
|
||||
"this situation and\nhow to fix it, please visit the web page mentioned " \
|
||||
#define CURL_CA_CERT_ERRORMSG \
|
||||
"More details here: https://curl.se/docs/sslcerts.html\n\n" \
|
||||
"curl failed to verify the legitimacy of the server and therefore " \
|
||||
"could not\nestablish a secure connection to it. To learn more about " \
|
||||
"this situation and\nhow to fix it, please visit the webpage mentioned " \
|
||||
"above.\n"
|
||||
|
||||
static CURLcode single_transfer(struct GlobalConfig *global,
|
||||
|
|
@ -339,7 +339,7 @@ static CURLcode pre_transfer(struct GlobalConfig *global,
|
|||
if(per->uploadfile && !stdin_upload(per->uploadfile)) {
|
||||
/* VMS Note:
|
||||
*
|
||||
* Reading binary from files can be a problem... Only FIXED, VAR
|
||||
* Reading binary from files can be a problem... Only FIXED, VAR
|
||||
* etc WITHOUT implied CC will work. Others need a \n appended to
|
||||
* a line
|
||||
*
|
||||
|
|
@ -373,7 +373,7 @@ static CURLcode pre_transfer(struct GlobalConfig *global,
|
|||
if((per->infd == -1) || fstat(per->infd, &fileinfo))
|
||||
#endif
|
||||
{
|
||||
helpf(tool_stderr, "Can't open '%s'", per->uploadfile);
|
||||
helpf(tool_stderr, "cannot open '%s'", per->uploadfile);
|
||||
if(per->infd != -1) {
|
||||
close(per->infd);
|
||||
per->infd = STDIN_FILENO;
|
||||
|
|
@ -520,7 +520,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
|
|||
memset(outs->utf8seq, 0, sizeof(outs->utf8seq));
|
||||
#endif
|
||||
|
||||
/* if retry-max-time is non-zero, make sure we haven't exceeded the
|
||||
/* if retry-max-time is non-zero, make sure we have not exceeded the
|
||||
time */
|
||||
if(per->retry_remaining &&
|
||||
(!config->retry_maxtime ||
|
||||
|
|
@ -594,7 +594,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
|
|||
if((scheme == proto_ftp || scheme == proto_ftps) && response / 100 == 4)
|
||||
/*
|
||||
* This is typically when the FTP server only allows a certain
|
||||
* amount of users and we are not one of them. All 4xx codes
|
||||
* amount of users and we are not one of them. All 4xx codes
|
||||
* are transient.
|
||||
*/
|
||||
retry = RETRY_FTP;
|
||||
|
|
@ -619,7 +619,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
|
|||
if(RETRY_HTTP == retry) {
|
||||
curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after);
|
||||
if(retry_after) {
|
||||
/* store in a 'long', make sure it doesn't overflow */
|
||||
/* store in a 'long', make sure it does not overflow */
|
||||
if(retry_after > LONG_MAX/1000)
|
||||
sleeptime = LONG_MAX;
|
||||
else if((retry_after * 1000) > sleeptime)
|
||||
|
|
@ -662,7 +662,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
|
|||
/* truncate file at the position where we started appending */
|
||||
#ifdef HAVE_FTRUNCATE
|
||||
if(ftruncate(fileno(outs->stream), outs->init)) {
|
||||
/* when truncate fails, we can't just append as then we'll
|
||||
/* when truncate fails, we cannot just append as then we will
|
||||
create something strange, bail out */
|
||||
errorf(config->global, "Failed to truncate file");
|
||||
return CURLE_WRITE_ERROR;
|
||||
|
|
@ -672,7 +672,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
|
|||
rc = fseek(outs->stream, 0, SEEK_END);
|
||||
#else
|
||||
/* ftruncate is not available, so just reposition the file
|
||||
to the location we would have truncated it. This won't
|
||||
to the location we would have truncated it. This will not
|
||||
work properly with large files on 32-bit systems, but
|
||||
most of those will have ftruncate. */
|
||||
rc = fseek(outs->stream, (long)outs->init, SEEK_SET);
|
||||
|
|
@ -780,7 +780,7 @@ static CURLcode url_proto(char **url,
|
|||
if(curl_strequal(schemep, proto_ipfs) ||
|
||||
curl_strequal(schemep, proto_ipns)) {
|
||||
result = ipfs_url_rewrite(uh, schemep, url, config);
|
||||
/* short-circuit proto_token, we know it's ipfs or ipns */
|
||||
/* short-circuit proto_token, we know it is ipfs or ipns */
|
||||
if(curl_strequal(schemep, proto_ipfs))
|
||||
proto = proto_ipfs;
|
||||
else if(curl_strequal(schemep, proto_ipns))
|
||||
|
|
@ -1130,20 +1130,20 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
(per->outfile && strcmp("-", per->outfile)))) {
|
||||
|
||||
/*
|
||||
* We have specified a file name to store the result in, or we have
|
||||
* decided we want to use the remote file name.
|
||||
* We have specified a filename to store the result in, or we have
|
||||
* decided we want to use the remote filename.
|
||||
*/
|
||||
|
||||
if(!per->outfile) {
|
||||
/* extract the file name from the URL */
|
||||
/* extract the filename from the URL */
|
||||
result = get_url_file_name(&per->outfile, per->this_url);
|
||||
if(result) {
|
||||
errorf(global, "Failed to extract a sensible file name"
|
||||
errorf(global, "Failed to extract a sensible filename"
|
||||
" from the URL to use for storage");
|
||||
break;
|
||||
}
|
||||
if(!*per->outfile && !config->content_disposition) {
|
||||
errorf(global, "Remote file name has no length");
|
||||
errorf(global, "Remote filename has no length");
|
||||
result = CURLE_WRITE_ERROR;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1191,7 +1191,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
}
|
||||
|
||||
if(config->resume_from_current) {
|
||||
/* We're told to continue from where we are now. Get the size
|
||||
/* We are told to continue from where we are now. Get the size
|
||||
of the file as it is now and open it for append instead */
|
||||
struct_stat fileinfo;
|
||||
/* VMS -- Danger, the filesize is only valid for stream files */
|
||||
|
|
@ -1214,7 +1214,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
FILE *file = fopen(per->outfile, "ab");
|
||||
#endif
|
||||
if(!file) {
|
||||
errorf(global, "Can't open '%s'", per->outfile);
|
||||
errorf(global, "cannot open '%s'", per->outfile);
|
||||
result = CURLE_WRITE_ERROR;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1231,7 +1231,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
|
||||
if(per->uploadfile && !stdin_upload(per->uploadfile)) {
|
||||
/*
|
||||
* We have specified a file to upload and it isn't "-".
|
||||
* We have specified a file to upload and it is not "-".
|
||||
*/
|
||||
result = add_file_name_to_url(per->curl, &per->this_url,
|
||||
per->uploadfile);
|
||||
|
|
@ -1247,7 +1247,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
if(config->authtype & (1UL << bitcheck++)) {
|
||||
authbits++;
|
||||
if(authbits > 1) {
|
||||
/* more than one, we're done! */
|
||||
/* more than one, we are done! */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1345,7 +1345,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
|
||||
#ifndef DEBUGBUILD
|
||||
/* On most modern OSes, exiting works thoroughly,
|
||||
we'll clean everything up via exit(), so don't bother with
|
||||
we will clean everything up via exit(), so do not bother with
|
||||
slow cleanups. Crappy ones might need to skip this.
|
||||
Note: avoid having this setopt added to the --libcurl source
|
||||
output. */
|
||||
|
|
@ -1748,7 +1748,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
structblob.len = (size_t)filesize;
|
||||
structblob.flags = CURL_BLOB_COPY;
|
||||
my_setopt_str(curl, CURLOPT_SSLCERT_BLOB, &structblob);
|
||||
/* if test run well, we are sure we don't reuse
|
||||
/* if test run well, we are sure we do not reuse
|
||||
* original mem pointer */
|
||||
memset(certdata, 0, (size_t)filesize);
|
||||
}
|
||||
|
|
@ -1791,7 +1791,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
structblob.len = (size_t)filesize;
|
||||
structblob.flags = CURL_BLOB_COPY;
|
||||
my_setopt_str(curl, CURLOPT_SSLKEY_BLOB, &structblob);
|
||||
/* if test run well, we are sure we don't reuse
|
||||
/* if test run well, we are sure we do not reuse
|
||||
* original mem pointer */
|
||||
memset(certdata, 0, (size_t)filesize);
|
||||
}
|
||||
|
|
@ -2382,7 +2382,7 @@ static CURLcode add_parallel_transfers(struct GlobalConfig *global,
|
|||
if(!errorbuf)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* parallel connect means that we don't set PIPEWAIT since pipewait
|
||||
/* parallel connect means that we do not set PIPEWAIT since pipewait
|
||||
will make libcurl prefer multiplexing */
|
||||
(void)curl_easy_setopt(per->curl, CURLOPT_PIPEWAIT,
|
||||
global->parallel_connect ? 0L : 1L);
|
||||
|
|
@ -2525,7 +2525,7 @@ static CURLcode parallel_transfers(struct GlobalConfig *global,
|
|||
if(tres)
|
||||
result = tres;
|
||||
if(added_transfers)
|
||||
/* we added new ones, make sure the loop doesn't exit yet */
|
||||
/* we added new ones, make sure the loop does not exit yet */
|
||||
still_running = 1;
|
||||
}
|
||||
if(is_fatal_error(result) || (result && global->fail_early))
|
||||
|
|
@ -2649,10 +2649,10 @@ static CURLcode transfer_per_config(struct GlobalConfig *global,
|
|||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
|
||||
/* On WIN32 we can't set the path to curl-ca-bundle.crt
|
||||
* at compile time. So we look here for the file in two ways:
|
||||
/* On WIN32 we cannot set the path to curl-ca-bundle.crt at compile time. We
|
||||
* look for the file in two ways:
|
||||
* 1: look at the environment variable CURL_CA_BUNDLE for a path
|
||||
* 2: if #1 isn't found, use the windows API function SearchPath()
|
||||
* 2: if #1 is not found, use the windows API function SearchPath()
|
||||
* to find it along the app's path (includes app's dir and CWD)
|
||||
*
|
||||
* We support the environment variable thing for non-Windows platforms
|
||||
|
|
@ -2782,7 +2782,7 @@ static CURLcode run_all_transfers(struct GlobalConfig *global,
|
|||
long delay;
|
||||
CURLcode result2 = post_per_transfer(global, per, result, &retry, &delay);
|
||||
if(!result)
|
||||
/* don't overwrite the original error */
|
||||
/* do not overwrite the original error */
|
||||
result = result2;
|
||||
|
||||
/* Free list of given URLs */
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ CURLcode urlerr_cvt(CURLUcode ucode)
|
|||
}
|
||||
|
||||
/*
|
||||
* Adds the file name to the URL if it doesn't already have one.
|
||||
* Adds the filename to the URL if it does not already have one.
|
||||
* url will be freed before return if the returned pointer is different
|
||||
*/
|
||||
CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename)
|
||||
|
|
@ -118,7 +118,7 @@ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename)
|
|||
}
|
||||
ptr = strrchr(path, '/');
|
||||
if(!ptr || !*++ptr) {
|
||||
/* The URL path has no file name part, add the local file name. In order
|
||||
/* The URL path has no filename part, add the local filename. In order
|
||||
to be able to do so, we have to create a new URL in another buffer.*/
|
||||
|
||||
/* We only want the part of the local path that is on the right
|
||||
|
|
@ -134,7 +134,7 @@ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename)
|
|||
else
|
||||
filep = filename;
|
||||
|
||||
/* URL encode the file name */
|
||||
/* URL encode the filename */
|
||||
encfile = curl_easy_escape(curl, filep, 0 /* use strlen */);
|
||||
if(encfile) {
|
||||
char *newpath;
|
||||
|
|
@ -230,7 +230,7 @@ CURLcode get_url_file_name(char **filename, const char *url)
|
|||
#endif /* _WIN32 || MSDOS */
|
||||
|
||||
/* in case we built debug enabled, we allow an environment variable
|
||||
* named CURL_TESTDIR to prefix the given file name to put it into a
|
||||
* named CURL_TESTDIR to prefix the given filename to put it into a
|
||||
* specific directory
|
||||
*/
|
||||
#ifdef DEBUGBUILD
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ ParameterError proto2num(struct OperationConfig *config,
|
|||
protoset_set(protoset, p);
|
||||
}
|
||||
|
||||
/* Allow strtok() here since this isn't used threaded */
|
||||
/* Allow strtok() here since this is not used threaded */
|
||||
/* !checksrc! disable BANNEDFUNC 2 */
|
||||
for(token = strtok(buffer, sep);
|
||||
token;
|
||||
|
|
@ -508,7 +508,7 @@ ParameterError str2offset(curl_off_t *val, const char *str)
|
|||
{
|
||||
char *endptr;
|
||||
if(str[0] == '-')
|
||||
/* offsets aren't negative, this indicates weird input */
|
||||
/* offsets are not negative, this indicates weird input */
|
||||
return PARAM_NEGATIVE_NUMERIC;
|
||||
|
||||
#if(SIZEOF_CURL_OFF_T > SIZEOF_LONG)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static FILE *execpath(const char *filename, char **pathp)
|
|||
{
|
||||
static char filebuffer[512];
|
||||
/* Get the filename of our executable. GetModuleFileName is already declared
|
||||
* via inclusions done in setup header file. We assume that we are using
|
||||
* via inclusions done in setup header file. We assume that we are using
|
||||
* the ASCII version here.
|
||||
*/
|
||||
unsigned long len = GetModuleFileNameA(0, filebuffer, sizeof(filebuffer));
|
||||
|
|
@ -196,7 +196,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||
if(*line) {
|
||||
*line = '\0'; /* null-terminate */
|
||||
|
||||
/* to detect mistakes better, see if there's data following */
|
||||
/* to detect mistakes better, see if there is data following */
|
||||
line++;
|
||||
/* pass all spaces */
|
||||
while(*line && ISSPACE(*line))
|
||||
|
|
@ -217,7 +217,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||
}
|
||||
if(!*param)
|
||||
/* do this so getparameter can check for required parameters.
|
||||
Otherwise it always thinks there's a parameter. */
|
||||
Otherwise it always thinks there is a parameter. */
|
||||
param = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||
operation = global->last;
|
||||
|
||||
if(!res && param && *param && !usedarg)
|
||||
/* we passed in a parameter that wasn't used! */
|
||||
/* we passed in a parameter that was not used! */
|
||||
res = PARAM_GOT_EXTRA_PARAMETER;
|
||||
|
||||
if(res == PARAM_NEXT_OPERATION) {
|
||||
|
|
@ -255,7 +255,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||
}
|
||||
|
||||
if(res != PARAM_OK && res != PARAM_NEXT_OPERATION) {
|
||||
/* the help request isn't really an error */
|
||||
/* the help request is not really an error */
|
||||
if(!strcmp(filename, "-")) {
|
||||
filename = "<stdin>";
|
||||
}
|
||||
|
|
@ -282,7 +282,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||
rc = 1;
|
||||
}
|
||||
else
|
||||
rc = 1; /* couldn't open the file */
|
||||
rc = 1; /* could not open the file */
|
||||
|
||||
free(pathalloc);
|
||||
return rc;
|
||||
|
|
@ -293,7 +293,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||
* backslash-quoted characters and NUL-terminating the output string.
|
||||
* Stops at the first non-backslash-quoted double quote character or the
|
||||
* end of the input string. param must be at least as long as the input
|
||||
* string. Returns the pointer after the last handled input character.
|
||||
* string. Returns the pointer after the last handled input character.
|
||||
*/
|
||||
static const char *unslashquote(const char *line, char *param)
|
||||
{
|
||||
|
|
@ -341,7 +341,7 @@ static bool my_get_line(FILE *fp, struct curlx_dynbuf *db,
|
|||
/* fgets() returns s on success, and NULL on error or when end of file
|
||||
occurs while no characters have been read. */
|
||||
if(!fgets(buf, sizeof(buf), fp))
|
||||
/* only if there's data in the line, return TRUE */
|
||||
/* only if there is data in the line, return TRUE */
|
||||
return curlx_dyn_len(db) ? TRUE : FALSE;
|
||||
if(curlx_dyn_add(db, buf)) {
|
||||
*error = TRUE; /* error */
|
||||
|
|
|
|||
|
|
@ -48,13 +48,13 @@ static char *max5data(curl_off_t bytes, char *max5)
|
|||
msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "k", bytes/ONE_KILOBYTE);
|
||||
|
||||
else if(bytes < CURL_OFF_T_C(100) * ONE_MEGABYTE)
|
||||
/* 'XX.XM' is good as long as we're less than 100 megs */
|
||||
/* 'XX.XM' is good as long as we are less than 100 megs */
|
||||
msnprintf(max5, 6, "%2" CURL_FORMAT_CURL_OFF_T ".%0"
|
||||
CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE,
|
||||
(bytes%ONE_MEGABYTE) / (ONE_MEGABYTE/CURL_OFF_T_C(10)) );
|
||||
|
||||
else if(bytes < CURL_OFF_T_C(10000) * ONE_MEGABYTE)
|
||||
/* 'XXXXM' is good until we're at 10000MB or above */
|
||||
/* 'XXXXM' is good until we are at 10000MB or above */
|
||||
msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE);
|
||||
|
||||
else if(bytes < CURL_OFF_T_C(100) * ONE_GIGABYTE)
|
||||
|
|
@ -75,7 +75,7 @@ static char *max5data(curl_off_t bytes, char *max5)
|
|||
/* up to 10000PB, display without decimal: XXXXP */
|
||||
msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "P", bytes/ONE_PETABYTE);
|
||||
|
||||
/* 16384 petabytes (16 exabytes) is the maximum a 64 bit unsigned number can
|
||||
/* 16384 petabytes (16 exabytes) is the maximum a 64-bit unsigned number can
|
||||
hold, but our data type is signed so 8192PB will be the maximum. */
|
||||
return max5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
* OutStruct variables keep track of information relative to curl's
|
||||
* output writing, which may take place to a standard stream or a file.
|
||||
*
|
||||
* 'filename' member is either a pointer to a file name string or NULL
|
||||
* 'filename' member is either a pointer to a filename string or NULL
|
||||
* when dealing with a standard stream.
|
||||
*
|
||||
* 'alloc_filename' member is TRUE when string pointed by 'filename' has been
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*
|
||||
* 's_isreg' member is TRUE when output goes to a regular file, this also
|
||||
* implies that output is 'seekable' and 'appendable' and also that member
|
||||
* 'filename' points to file name's string. For any standard stream member
|
||||
* 'filename' points to filename's string. For any standard stream member
|
||||
* 's_isreg' will be FALSE.
|
||||
*
|
||||
* 'fopened' member is TRUE when output goes to a regular file and it
|
||||
|
|
@ -93,7 +93,7 @@ struct getout {
|
|||
|
||||
#define GETOUT_OUTFILE (1<<0) /* set when outfile is deemed done */
|
||||
#define GETOUT_URL (1<<1) /* set when URL is deemed done */
|
||||
#define GETOUT_USEREMOTE (1<<2) /* use remote file name locally */
|
||||
#define GETOUT_USEREMOTE (1<<2) /* use remote filename locally */
|
||||
#define GETOUT_UPLOAD (1<<3) /* if set, -T has been used */
|
||||
#define GETOUT_NOUPLOAD (1<<4) /* if set, -T "" has been used */
|
||||
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ static const struct NameValue setopt_nv_CURLNONZERODEFAULTS[] = {
|
|||
#define REM1(f,a) ADDF((&easysrc_toohard, f,a))
|
||||
#define REM3(f,a,b,c) ADDF((&easysrc_toohard, f,a,b,c))
|
||||
|
||||
/* Escape string to C string syntax. Return NULL if out of memory.
|
||||
/* Escape string to C string syntax. Return NULL if out of memory.
|
||||
* Is this correct for those wacky EBCDIC guys? */
|
||||
|
||||
#define MAX_STRING_LENGTH_OUTPUT 2000
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ static int multiply(curl_off_t *amount, curl_off_t with)
|
|||
#else
|
||||
sum = *amount * with;
|
||||
if(sum/with != *amount)
|
||||
return 1; /* didn't fit, bail out */
|
||||
return 1; /* did not fit, bail out */
|
||||
#endif
|
||||
}
|
||||
*amount = sum;
|
||||
|
|
@ -123,7 +123,7 @@ static CURLcode glob_set(struct URLGlob *glob, char **patternp,
|
|||
return GLOBERROR("empty string within braces", *posp,
|
||||
CURLE_URL_MALFORMAT);
|
||||
|
||||
/* add 1 to size since it'll be incremented below */
|
||||
/* add 1 to size since it will be incremented below */
|
||||
if(multiply(amount, pat->content.Set.size + 1))
|
||||
return GLOBERROR("range overflow", 0, CURLE_URL_MALFORMAT);
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ struct timeval tvnow(void)
|
|||
/*
|
||||
** Even when the configure process has truly detected monotonic clock
|
||||
** availability, it might happen that it is not actually available at
|
||||
** run-time. When this occurs simply fallback to other time source.
|
||||
** runtime. When this occurs simply fallback to other time source.
|
||||
*/
|
||||
#ifdef HAVE_GETTIMEOFDAY
|
||||
else
|
||||
|
|
@ -126,7 +126,7 @@ struct timeval tvnow(void)
|
|||
|
||||
/*
|
||||
* Make sure that the first argument is the more recent time, as otherwise
|
||||
* we'll get a weird negative time-diff back...
|
||||
* we will get a weird negative time-diff back...
|
||||
*
|
||||
* Returns: the time difference in number of milliseconds.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ int is_vms_shell(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* VMS has two exit() routines. When running under a Unix style shell, then
|
||||
* VMS has two exit() routines. When running under a Unix style shell, then
|
||||
* Unix style and the __posix_exit() routine is used.
|
||||
*
|
||||
* When running under the DCL shell, then the VMS encoded codes and decc$exit()
|
||||
|
|
@ -133,9 +133,9 @@ struct decc_feat_t {
|
|||
static const struct decc_feat_t decc_feat_array[] = {
|
||||
/* Preserve command-line case with SET PROCESS/PARSE_STYLE=EXTENDED */
|
||||
{ "DECC$ARGV_PARSE_STYLE", 1 },
|
||||
/* Preserve case for file names on ODS5 disks. */
|
||||
/* Preserve case for filenames on ODS5 disks. */
|
||||
{ "DECC$EFS_CASE_PRESERVE", 1 },
|
||||
/* Enable multiple dots (and most characters) in ODS5 file names,
|
||||
/* Enable multiple dots (and most characters) in ODS5 filenames,
|
||||
while preserving VMS-ness of ";version". */
|
||||
{ "DECC$EFS_CHARSET", 1 },
|
||||
/* List terminator. */
|
||||
|
|
@ -165,14 +165,14 @@ static void decc_init(void)
|
|||
feat_index = decc$feature_get_index(decc_feat_array[i].name);
|
||||
|
||||
if(feat_index >= 0) {
|
||||
/* Valid item. Collect its properties. */
|
||||
/* Valid item. Collect its properties. */
|
||||
feat_value = decc$feature_get_value(feat_index, 1);
|
||||
feat_value_min = decc$feature_get_value(feat_index, 2);
|
||||
feat_value_max = decc$feature_get_value(feat_index, 3);
|
||||
|
||||
if((decc_feat_array[i].value >= feat_value_min) &&
|
||||
(decc_feat_array[i].value <= feat_value_max)) {
|
||||
/* Valid value. Set it if necessary. */
|
||||
/* Valid value. Set it if necessary. */
|
||||
if(feat_value != decc_feat_array[i].value) {
|
||||
sts = decc$feature_set_value(feat_index, 1,
|
||||
decc_feat_array[i].value);
|
||||
|
|
@ -198,7 +198,7 @@ static void decc_init(void)
|
|||
#pragma nostandard
|
||||
|
||||
/* Establish the LIB$INITIALIZE PSECTs, with proper alignment and
|
||||
other attributes. Note that "nopic" is significant only on VAX. */
|
||||
other attributes. Note that "nopic" is significant only on VAX. */
|
||||
#pragma extern_model save
|
||||
#pragma extern_model strict_refdef "LIB$INITIALIZ" 2, nopic, nowrt
|
||||
const int spare[8] = {0};
|
||||
|
|
|
|||
|
|
@ -582,7 +582,7 @@ void ourWriteOut(struct OperationConfig *config, struct per_transfer *per,
|
|||
switch(wv->id) {
|
||||
case VAR_ONERROR:
|
||||
if(per_result == CURLE_OK)
|
||||
/* this isn't error so skip the rest */
|
||||
/* this is not error so skip the rest */
|
||||
done = TRUE;
|
||||
break;
|
||||
case VAR_STDOUT:
|
||||
|
|
@ -645,7 +645,7 @@ void ourWriteOut(struct OperationConfig *config, struct per_transfer *per,
|
|||
}
|
||||
end = strchr(ptr, '}');
|
||||
if(end) {
|
||||
char fname[512]; /* holds the longest file name */
|
||||
char fname[512]; /* holds the longest filename */
|
||||
size_t flen = end - ptr;
|
||||
if(flen < sizeof(fname)) {
|
||||
FILE *stream2;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ int jsonquoted(const char *in, size_t len,
|
|||
else {
|
||||
char o = (char)*i;
|
||||
if(lowercase && (o >= 'A' && o <= 'Z'))
|
||||
/* do not use tolower() since that's locale specific */
|
||||
/* do not use tolower() since that is locale specific */
|
||||
o |= ('a' - 'A');
|
||||
result = curlx_dyn_addn(out, &o, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ static ParameterError varfunc(struct GlobalConfig *global,
|
|||
if(*f == '}')
|
||||
/* end of functions */
|
||||
break;
|
||||
/* On entry, this is known to be a colon already. In subsequent laps, it
|
||||
/* On entry, this is known to be a colon already. In subsequent laps, it
|
||||
is also known to be a colon since that is part of the FUNCMATCH()
|
||||
checks */
|
||||
f++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue