Improve consistency/spelling in some comments (#924)

* [comments] Fix incorrectly spelled verb "set up"

* [comments] Fix incorrectly capitalized "MIME" (as in MIME types)

* [comments] Fix inconsistent spelling: "filename" vs "file name"

* [comments] Add missing whitespace

* [comments] Make a comment capitalized like its sibings

* [comments] Improve sentence clarity with a comma

* [comments] Fix inconsistent spelling: "Esc" vs "Escape"

* [comments] Improve consistency of spelling and spacing

* Change 'set up' to 'set-up'
This commit is contained in:
Rudolf Adamkovič 2021-03-28 03:55:43 +02:00 committed by GitHub
parent 603c1580e8
commit 655e8886f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -452,10 +452,10 @@ static char g_pipepath[TMP_LEN_MAX] __attribute__ ((aligned));
/* Non-persistent runtime states */
static runstate g_state;
/* Options to identify file mime */
/* Options to identify file MIME */
#if defined(__APPLE__)
#define FILE_MIME_OPTS "-bIL"
#elif !defined(__sun) /* no mime option for 'file' */
#elif !defined(__sun) /* no MIME option for 'file' */
#define FILE_MIME_OPTS "-biL"
#endif
@ -1994,7 +1994,7 @@ static inline uint_t xgetenv_val(const char *name)
return 0;
}
/* Check if a dir exists, IS a dir and is readable */
/* Check if a dir exists, IS a dir, and is readable */
static bool xdiraccess(const char *path)
{
DIR *dirp = opendir(path);
@ -2870,7 +2870,7 @@ static int filterentries(char *path, char *lastname)
case KEY_MOUSE:
goto end;
#endif
case ESC: /* Exit filter mode on Escape and Alt+key */
case ESC: /* Exit filter mode on Esc and Alt+key */
if (handle_alt_key(ch) != ERR) {
if (*ch == ESC) { /* Handle Alt+Esc */
if (wln[1]) {
@ -2931,7 +2931,7 @@ static int filterentries(char *path, char *lastname)
continue;
}
/* toggle string or regex filter */
/* Toggle string or regex filter */
if (*ch == FILTER) {
ln[0] = (ln[0] == FILTER) ? RFILTER : FILTER;
wln[0] = (uchar_t)ln[0];
@ -3058,7 +3058,7 @@ static char *xreadline(const char *prefill, const char *prompt)
(len - pos) * WCHAR_T_WIDTH);
--len, --pos;
} // fallthrough
case '\t': /* TAB breaks cursor position, ignore it */
case '\t': /* Tab breaks cursor position, ignore it */
continue;
case CONTROL('F'):
if (pos < len)
@ -3098,7 +3098,7 @@ static char *xreadline(const char *prefill, const char *prompt)
len -= pos;
pos = 0;
continue;
case ESC: /* Exit prompt on Escape, but just filter out Alt+key */
case ESC: /* Exit prompt on Esc, but just filter out Alt+key */
if (handle_alt_key(ch) != ERR)
continue;
@ -4166,7 +4166,7 @@ static bool show_stats(const char *fpath, const struct stat *sb)
fprintf(fp, " %s\n ", begin);
#ifdef FILE_MIME_OPTS
/* Show the file mime type */
/* Show the file MIME type */
get_output(g_buf, CMD_LEN_MAX, "file", FILE_MIME_OPTS, fpath, FALSE);
fprintf(fp, "%s", g_buf);
#endif
@ -5971,7 +5971,7 @@ static bool browse(char *ipath, const char *session, int pkey)
xcols = COLS;
#ifndef NOSSN
/* setup first context */
/* set-up first context */
if (!session || !load_session(session, &path, &lastdir, &lastname, FALSE)) {
#else
(void)session;
@ -6350,7 +6350,7 @@ nochange:
&& get_output(g_buf, CMD_LEN_MAX, "file", FILE_MIME_OPTS, newpath, FALSE)
&& is_prefix(g_buf, "text/", 5)
#else
/* no mime option; guess from description instead */
/* no MIME option; guess from description instead */
&& get_output(g_buf, CMD_LEN_MAX, "file", "-bL", newpath, FALSE)
&& strstr(g_buf, "text")
#endif