1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix various typos, man page issues and improve the documentation (#415)

This commit makes various different improvements to the documentation:
- sh.1: Backported (with changes) mandoc warning fixes from ksh2020
  for the ksh93(1) man page: <https://github.com/att/ast/pull/1406>
- Removed unnecessary spaces at the end of lines to fix a few other
  mandoc warnings.
- Fixed various typos and capitalization errors in the documentation.
- ANNOUNCE: Document the addition of the ${.sh.pid} variable
  (re: 9de65210).
- libast/man/str*: Update the man pages for the libast str* functions
  to improve how accurately each function is described.
- ksh93/README: Update regression test/compatibility notes to include
  OpenBSD 7.0, FreeBSD 13.0 and WSL running Ubuntu 20.04.
- Change a few places to store the return value from strlen in a
  size_t variable rather than signed int.
- comp/setlocale.c: To avoid confusion of two separate variables named
  lang, the function local variable has been renamed to langidx.
This commit is contained in:
Johnothan King 2022-01-07 07:00:00 -08:00 committed by Martijn Dekker
parent d347ec0fc9
commit ca5803419b
95 changed files with 313 additions and 390 deletions

View file

@ -92,7 +92,7 @@
08-04-01 stty.c: fix off2 uninitialized reference
08-03-28 chgrp.c: add --before=file
08-03-14 pids.c: add
08-03-11 chgrp.c: fix -m to use uid:gid as lookup key
08-03-11 chgrp.c: fix -m to use UID:GID as lookup key
08-02-11 Makefile: add -lmd possibly required by sumlib.o -- hack alert
08-01-30 expr.c: fix <=0 type that broke substr * 1 * -- wow
07-12-13 cp.c: fix builtin state reinitialization
@ -299,7 +299,7 @@
mkdir: fix -p default mode
97-12-07 mkdir: fix umask() reset
97-11-11 chown,chgrp: proper interpretation of -h,-l for lchown()
chown,chgrp: only chown() if uid or gid change
chown,chgrp: only chown() if UID or GID change
97-10-31 mkdir: do umask right
97-08-11 cmdinit: clear opt_info.index to allow multiple calls
cp,ln,mv: add
@ -324,7 +324,7 @@
add void* context 3rd arg to b_main()
95-05-09 add getconf
cat -u avoids mmap
add chown|chgrp -m uid|gid map file
add chown|chgrp -m UID|GID map file
add chown|chgrp -P for systems with lchown(2)
chown|chgrp -P => lstat() too!
chmod|chown|chgrp -HLP

View file

@ -36,7 +36,7 @@ static const char usage_grp_1[] =
"[+NAME?chgrp - change the group ownership of files]"
"[+DESCRIPTION?\bchgrp\b changes the group ownership of each file"
" to \agroup\a, which can be either a group name or a numeric"
" group id. The user ownership of each file may also be changed to"
" group ID. The user ownership of each file may also be changed to"
" \auser\a by prepending \auser\a\b:\b to the group name.]"
;
@ -44,7 +44,7 @@ static const char usage_own_1[] =
"[+NAME?chown - change the ownership of files]"
"[+DESCRIPTION?\bchown\b changes the ownership of each file"
" to \auser\a, which can be either a user name or a numeric"
" user id. The group ownership of each file may also be changed to"
" user ID. The group ownership of each file may also be changed to"
" \auser\a by appending \b:\b\agroup\a to the user name.]"
;
@ -65,10 +65,10 @@ static const char usage_2[] =
"determined it is not overridden by any subsequent match. Unmatched "
"files are silently ignored.]"
"[n:show?Show actions but don't execute.]"
"[N:numeric?By default numeric user and group id operands are first "
"[N:numeric?By default numeric user and group ID operands are first "
"interpreted as names; if no name exists then they are interpreted as "
"explicit numeric ids. \b--numeric\b interprets numeric id operands as "
"numeric ids.]"
"explicit numeric IDs. \b--numeric\b interprets numeric ID operands as "
"numeric IDs.]"
"[r:reference?Omit the explicit ownership operand and use the ownership "
"of \afile\a instead.]:[file]"
"[u:unmapped?Print a diagnostic for each file for which either the "
@ -117,13 +117,13 @@ __STDPP__directive pragma pp:nohide lchown
#undef lchown
#endif
typedef struct Key_s /* uid/gid key */
typedef struct Key_s /* UID/GID key */
{
int uid; /* uid */
int gid; /* gid */
int uid; /* UID */
int gid; /* GID */
} Key_t;
typedef struct Map_s /* uid/gid map */
typedef struct Map_s /* UID/GID map */
{
Dtlink_t link; /* dictionary link */
Key_t key; /* key */
@ -132,19 +132,19 @@ typedef struct Map_s /* uid/gid map */
#define OPT_CHOWN 0x0001 /* chown */
#define OPT_FORCE 0x0002 /* ignore errors */
#define OPT_GID 0x0004 /* have gid */
#define OPT_GID 0x0004 /* have GID */
#define OPT_LCHOWN 0x0008 /* lchown */
#define OPT_NUMERIC 0x0010 /* favor numeric ids */
#define OPT_NUMERIC 0x0010 /* favor numeric IDs */
#define OPT_SHOW 0x0020 /* show but don't do */
#define OPT_TEST 0x0040 /* canonicalize output */
#define OPT_UID 0x0080 /* have uid */
#define OPT_UID 0x0080 /* have UID */
#define OPT_UNMAPPED 0x0100 /* unmapped file diagnostic */
#define OPT_VERBOSE 0x0200 /* have uid */
#define OPT_VERBOSE 0x0200 /* have UID */
extern int lchown(const char*, uid_t, gid_t);
/*
* parse uid and gid from s
* parse UID and GID from s
*/
static void
@ -483,11 +483,11 @@ b_chgrp(int argc, char** argv, Shbltin_t* context)
if ((options & OPT_UNMAPPED) && (uid < 0 || gid < 0))
{
if (uid < 0 && gid < 0)
error(ERROR_warn(0), "%s: uid and gid not mapped", ent->fts_path);
error(ERROR_warn(0), "%s: UID and GID not mapped", ent->fts_path);
else if (uid < 0)
error(ERROR_warn(0), "%s: uid not mapped", ent->fts_path);
error(ERROR_warn(0), "%s: UID not mapped", ent->fts_path);
else
error(ERROR_warn(0), "%s: gid not mapped", ent->fts_path);
error(ERROR_warn(0), "%s: GID not mapped", ent->fts_path);
}
if (uid != ent->fts_statp->st_uid && uid >= 0 || gid != ent->fts_statp->st_gid && gid >= 0)
{

View file

@ -121,7 +121,7 @@ typedef struct State_s /* program state */
int all; /* list all items */
Sfio_t* check; /* check previous output */
int flags; /* sumprint() SUM_* flags */
gid_t gid; /* caller gid */
gid_t gid; /* caller GID */
int header; /* list method on output */
int list; /* list file name too */
Sum_t* oldsum; /* previous sum method */
@ -135,7 +135,7 @@ typedef struct State_s /* program state */
Sum_t* sum; /* sum method */
int text; /* \r\n == \n */
int total; /* list totals only */
uid_t uid; /* caller uid */
uid_t uid; /* caller UID */
int warn; /* invalid check line warnings */
} State_t;
@ -336,7 +336,7 @@ verify(State_t* state, register char* s, char* check, Sfio_t* rp)
if (state->silent)
error_info.errors++;
else
error(2, "%s: uid should be %s", file, fmtuid(uid));
error(2, "%s: UID should be %s", file, fmtuid(uid));
}
if (gid < 0 || gid == st.st_gid)
gid = -1;
@ -345,7 +345,7 @@ verify(State_t* state, register char* s, char* check, Sfio_t* rp)
if (state->silent)
error_info.errors++;
else
error(2, "%s: gid should be %s", file, fmtgid(gid));
error(2, "%s: GID should be %s", file, fmtgid(gid));
}
if (state->permissions && (uid >= 0 || gid >= 0))
{

View file

@ -45,7 +45,7 @@ static const char usage_cp[] =
"[A:attributes?Preserve selected file attributes:]:[eipt]"
"{"
"[+e?Everything permissible.]"
"[+i?Owner uid and gid.]"
"[+i?Owner UID and GID.]"
"[+p?Permissions.]"
"[+t?Access and modify times.]"
"}"
@ -144,7 +144,7 @@ static const char usage_tail[] =
#define LN 2
#define MV 3
#define PRESERVE_IDS 0x1 /* preserve uid gid */
#define PRESERVE_IDS 0x1 /* preserve UID and GID */
#define PRESERVE_PERM 0x2 /* preserve permissions */
#define PRESERVE_TIME 0x4 /* preserve times */
@ -172,7 +172,7 @@ typedef struct State_s /* program state */
int remove; /* remove destination before op */
int suflen; /* strlen(state.suffix) */
int sync; /* fsync() each file after copy */
int uid; /* caller uid */
int uid; /* caller UID */
int update; /* replace only if newer */
int verbose; /* list each file before op */
int wflags; /* open() for write flags */

View file

@ -25,22 +25,22 @@
static const char usage[] =
"[-?\n@(#)$Id: pids (AT&T Research) 2011-08-27 $\n]"
"[--catalog?" ERROR_CATALOG "]"
"[+NAME?pids - list calling shell process ids]"
"[+NAME?pids - list calling shell process IDs]"
"[+DESCRIPTION?When invoked as a shell builtin, \bpids\b lists one or "
"more of the calling process ids determined by \bgetpid\b(2), "
"more of the calling process IDs determined by \bgetpid\b(2), "
"\bgetppid\b(2), \bgetpgrp\b(2), \btcgetpgrp\b(3) and \bgetsid\b(2). "
"Unknown or invalid ids have the value \b-1\b.]"
"[f:format?List the ids specified by \aformat\a. \aformat\a follows "
"\bprintf\b(3) conventions, except that \bsfio\b(3) inline ids are used "
"Unknown or invalid IDs have the value \b-1\b.]"
"[f:format?List the IDs specified by \aformat\a. \aformat\a follows "
"\bprintf\b(3) conventions, except that \bsfio\b(3) inline IDs are used "
"instead of arguments: "
"%[-+]][\awidth\a[.\aprecis\a[.\abase\a]]]]]](\aid\a)\achar\a. The "
"supported \aid\as are:]:[format:=" FORMAT "]"
"{"
"[+pid?The process id.]"
"[+pgid?The process group id.]"
"[+ppid?The parent process id.]"
"[+tid|tty?The controlling terminal id.]"
"[+sid?The session id.]"
"[+pid?The process ID.]"
"[+pgid?The process group ID.]"
"[+ppid?The parent process ID.]"
"[+tid|tty?The controlling terminal ID.]"
"[+sid?The session ID.]"
"}"
"[+SEE ALSO?\bgetpid\b(2), \bgetppid\b(2), \bgetpgrp\b(2), "
"\btcgetpgrp\b(3), \bgetsid\b(2)]"

View file

@ -86,7 +86,7 @@ typedef struct State_s /* program state */
int interactive; /* prompt for approval */
int recursive; /* remove subtrees too */
int terminal; /* attached to terminal */
int uid; /* caller uid */
int uid; /* caller UID */
int unconditional; /* enable dir rwx on preorder */
int verbose; /* display each file */
#if _lib_fsync

View file

@ -37,7 +37,7 @@ static const char usage[] =
"[g:save?Writes the current settings to standard output in a form that "
"can be used as an argument to another \bstty\b command. The \brows\b "
"and \bcolumns\b values are not included.]"
"[t:terminal-group?Print the terminal group id of the device, -1 if "
"[t:terminal-group?Print the terminal group ID of the device, -1 if "
"unknown.]"
"\n"
"\n[mode ...]\n"

View file

@ -55,7 +55,7 @@ static const char usage[] =
"[i:implementation|platform|hardware-platform?The hardware implementation;"
" this is \b--host-id\b on some systems.]"
"[o:operating-system?The generic operating system name.]"
"[h:host-id|id?The host id in hex.]"
"[h:host-id|id?The host ID in hex.]"
"[d:domain?The domain name returned by \agetdomainname\a(2).]"
"[R:extended-release?The extended release name.]"
"[A:everything?Equivalent to \b-snrvmpiohdR\b.]"

View file

@ -34,8 +34,8 @@ static const char usage[] =
"[+NAME?vmstate - list the calling process vmalloc region state]"
"[+DESCRIPTION?When invoked as a shell builtin, \bvmstate\b lists the "
"calling process \bvmalloc\b(3) state for all regions.]"
"[f:format?List the ids specified by \aformat\a. \aformat\a follows "
"\bprintf\b(3) conventions, except that \bsfio\b(3) inline ids are used "
"[f:format?List the IDs specified by \aformat\a. \aformat\a follows "
"\bprintf\b(3) conventions, except that \bsfio\b(3) inline IDs are used "
"instead of arguments: "
"%[-+]][\awidth\a[.\aprecis\a[.\abase\a]]]]]](\aid\a)\achar\a. The "
"supported \aid\as are:]:[format:=" FORMAT "]"