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:
Daniel Stenberg 2024-07-01 16:47:21 +02:00
parent 9b683577e1
commit c074ba64a8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
213 changed files with 1719 additions and 1715 deletions

View file

@ -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))