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

@ -83,7 +83,7 @@ string:
strls ls -l format support
strmatch Korn shell file pattern match
strmode return ls -l style output given st.st_mode
strsignal return signal id string given SIG* number
strsignal return signal ID string given SIG* number
strtape convert generic tape unit to /dev/* file
token generate space separated tokens in string

View file

@ -223,7 +223,7 @@
09-12-04 features/options: add "opt map-libc" check
09-12-03 tm/tmxdate.c: fix 'next month final day' for dec -> jan
09-11-21 misc/magic.tab: add gimp XCF
09-11-20 vmalloc/vmtrace.c: add pid to assertion diagnostics
09-11-20 vmalloc/vmtrace.c: add PID to assertion diagnostics
09-11-11 regex.h,regcomp.c: add REG_CLASS_ESCAPE, \ inside [...] literal by default
09-11-03 regex/regcache.c: change to variable length pattern strings
09-10-28 include/error.h: fix ERROR_translate() arg parens
@ -1300,7 +1300,7 @@
astgetconf: add for thread safe error message control
astlicense: fix type=special but with non-null notice
errorx: add for ERROR_translate() support
ERROR_translate: add locale id args for alternate dictionary
ERROR_translate: add locale ID args for alternate dictionary
option.h: move _OPT_PRIVATE_ to pointer to avoid dll size mismatch
ftwalk: fix FTW_CHILDREN bug that hit top level non-dirs twice
translate.c: default error_info.translate
@ -1310,7 +1310,7 @@
00-03-07 optget: fix numeric option support test
sfkeyprintf: add %q for '...' quoting with ANSI escapes
00-03-06 features/stdio: fix _sfflsbuf prototype (dingold@gte.net)
00-02-14 pathtmp: fix pid cache bug that sometimes repeated after ~10 attempts
00-02-14 pathtmp: fix PID cache bug that sometimes repeated after ~10 attempts
optget: "..." attribute quote
pathfind: eliminate *: prefix in lib, not type
proc: PROC_FOREGROUND for system(3) semantics (wait status return)
@ -1372,7 +1372,7 @@
99-05-21 tm*: add TM_WINDOW==69 for consistent century windowing guard year
99-05-18 tmtime: add century leap year calc anticipating unsigned time_t
99-05-17 sfkeyprintf: handle %o and %x!!
99-05-09 pathprobe: $HOME/.probe if not suid and st_uid!=geteuid()
99-05-09 pathprobe: $HOME/.probe if not SUID and st_uid!=geteuid()
99-04-28 magic,magic.tab: add registry()
99-04-24 regcomp: fix ksh pattern +! parse
regfatalpat: add
@ -1430,7 +1430,7 @@
98-06-01 disc/sf*.c: memset(0) after disc malloc()
98-05-11 strelapsed: y==Y
fts: pathcanon() top list
98-04-01 error: error_info.time for all msgs, just after cmd id
98-04-01 error: error_info.time for all msgs, just after cmd ID
error: no sfsync(sfstdin)
sfio: sfpool, Sffmt_t update
magic.tab: SGI core dumps -- why aren't these ELF?
@ -1486,7 +1486,7 @@
sfio: update including SF_WHOLE
97-10-01 sfdostext: add \r\n => \n sfio discipline
stropt: NiL table => p=name for all name=value
97-08-11 pathtmp: check pid to note forks
97-08-11 pathtmp: check PID to note forks
procopen: FD_CLOEXEC rfd && wfd
fts: fts_close() after fts_children() with no fts_read() now works
97-07-17 error: sfsync(sfstdin,sfstdout,sfstderr) instead of sfsync(NiL)

View file

@ -66,7 +66,7 @@ aso_init_semaphore(void* data, const char* details)
{
/*
* semaphore 0 is the reference count
* the id is dropped on last reference
* the ID is dropped on last reference
*/
sem.sem_num = 0;

View file

@ -47,7 +47,7 @@ typedef struct Optdisc_s
{
unsigned long version; /* OPT_VERSION */
unsigned long flags; /* OPT_* flags */
char* catalog; /* error catalog id */
char* catalog; /* error catalog ID */
Optinfo_f infof; /* runtime info function */
} Optdisc_t;

View file

@ -21,7 +21,7 @@
* *
***********************************************************************/
/*
* access() euid/egid implementation
* access() EUID/EGID implementation
*/
#include <ast.h>

View file

@ -464,7 +464,7 @@ runve(int mode, const char* path, char* const* argv, char* const* envv)
{
/*
* 2004-02-29 Cygwin _P_DETACH is useless:
* spawn*() returns 0 instead of the spawned pid
* spawn*() returns 0 instead of the spawned PID
* spawned { pgid sid } are the same as the parent
*/

View file

@ -104,7 +104,7 @@ native_locale(const char* locale, char* buf, size_t siz)
const Lc_attribute_list_t* ap;
int i;
unsigned long lcid;
unsigned long lang;
unsigned long langidx;
unsigned long ctry;
char lbuf[128];
char cbuf[128];
@ -113,7 +113,7 @@ native_locale(const char* locale, char* buf, size_t siz)
{
if (!(lc = lcmake(locale)))
return 0;
lang = lc->language->index;
langidx = lc->language->index;
ctry = 0;
for (ap = lc->attributes; ap; ap = ap->next)
if (ctry = ap->attribute->index)
@ -128,12 +128,12 @@ native_locale(const char* locale, char* buf, size_t siz)
}
if (!ctry)
{
if (!lang)
if (!langidx)
return 0;
ctry = SUBLANG_DEFAULT;
}
}
lcid = MAKELCID(MAKELANGID(lang, ctry), SORT_DEFAULT);
lcid = MAKELCID(MAKELANGID(langidx, ctry), SORT_DEFAULT);
}
else
lcid = GetUserDefaultLCID();

View file

@ -51,7 +51,7 @@ extern int setpgrp(void);
#endif
/*
* set process group id
* set process group ID
*/
int

View file

@ -83,7 +83,7 @@
/* openlog flags */
#define LOG_PID 0x01 /* log the pid with each message */
#define LOG_PID 0x01 /* log the PID with each message */
#define LOG_CONS 0x02 /* log to console if errors in sending */
#define LOG_NDELAY 0x08 /* open right now */
#define LOG_ODELAY 0x04 /* delay open until syslog() is called */

View file

@ -23,7 +23,7 @@
/*
* POSIX waitpid()
*
* pid < -1 WUNTRACED may not be fully supported
* PID < -1 WUNTRACED may not be fully supported
* process group specifics ignored by non-{waitpid,wait4}
*/

View file

@ -196,7 +196,7 @@ cat{
unsigned long f_files; /* total # of file nodes (inodes) */
unsigned long f_ffree; /* total # of free file nodes */
unsigned long f_favail; /* # of free nodes avail to non-superuser */
unsigned long f_fsid; /* file system id (dev for now) */
unsigned long f_fsid; /* file system ID (dev for now) */
char f_basetype[16]; /* target fs type name, null-terminated */
unsigned long f_flag; /* bit-mask of flags */
unsigned long f_namemax; /* maximum file name length */

View file

@ -66,7 +66,7 @@ struct Cmddisc_s
typedef struct Cmdarg_s /* cmdopen() handle */
{
const char* id; /* library id string */
const char* id; /* library ID string */
#ifdef _CMDARG_PRIVATE_
_CMDARG_PRIVATE_

View file

@ -112,7 +112,7 @@ typedef struct Error_context_s Error_context_t;
int line; /* input|output line number */ \
int warnings; /* ERROR_WARNING count */ \
char* file; /* input|output file name */ \
char* id; /* command id */
char* id; /* command ID */
struct Error_context_s /* context stack element */
{

View file

@ -63,7 +63,7 @@ typedef struct Finddisc_s
typedef struct Find_s
{
const char* id; /* library id string */
const char* id; /* library ID string */
unsigned long stamp; /* codes time stamp */
#ifdef _FIND_PRIVATE_

View file

@ -63,7 +63,7 @@ typedef struct Magicdisc_s
typedef struct Magic_s
{
const char* id; /* library id string */
const char* id; /* library ID string */
#ifdef _MAGIC_PRIVATE_
_MAGIC_PRIVATE_

View file

@ -22,7 +22,7 @@
***********************************************************************/
/*
* generic binary magic id definitions
* generic binary magic ID definitions
*/
#ifndef _MAGICID_H

View file

@ -64,7 +64,7 @@ struct Mimedisc_s
struct Mime_s
{
const char* id; /* library id string */
const char* id; /* library ID string */
#ifdef _MIME_PRIVATE_
_MIME_PRIVATE_

View file

@ -45,7 +45,7 @@ typedef struct Optdisc_s
{
unsigned long version; /* OPT_VERSION */
unsigned long flags; /* OPT_* flags */
char* catalog; /* error catalog id */
char* catalog; /* error catalog ID */
Optinfo_f infof; /* runtime info function */
} Optdisc_t;

View file

@ -83,8 +83,8 @@
typedef struct
{
pid_t pid; /* process id */
pid_t pgrp; /* process group id */
pid_t pid; /* process ID */
pid_t pgrp; /* process group ID */
int rfd; /* read fd if applicable */
int wfd; /* write fd if applicable */

View file

@ -123,7 +123,7 @@
#define REG_ENULL 14 /* empty subexpr in pattern */
#define REG_ECOUNT 15 /* re component count overflow */
#define REG_BADESC 16 /* invalid \char escape */
#define REG_VERSIONID 17 /* version id (pseudo error) */
#define REG_VERSIONID 17 /* version ID (pseudo error) */
#define REG_EFLAGS 18 /* flags conflict */
#define REG_EDELIM 19 /* invalid or omitted delimiter */
#define REG_PANIC 20 /* unrecoverable internal error */

View file

@ -42,7 +42,7 @@
struct _sfdisc_s* disc; /* discipline */ \
struct _sfpool_s* pool; /* the pool containing this */ \
struct _sfrsrv_s* rsrv; /* reserved buffer */ \
struct _sfproc_s* proc; /* coprocess id, etc. */ \
struct _sfproc_s* proc; /* coprocess ID, etc. */ \
void* mutex; /* mutex for thread-safety */ \
void* stdio; /* stdio FILE if any */ \
Sfoff_t lpos; /* last seek position */ \

View file

@ -71,8 +71,8 @@
* bits used in mode field
*/
#define TSUID 04000 /* set uid on exec */
#define TSGID 02000 /* set gid on exec */
#define TSUID 04000 /* setuid on exec */
#define TSGID 02000 /* setgid on exec */
#define TSVTX 01000 /* sticky bit -- reserved */
/*

View file

@ -393,7 +393,7 @@ where the length of
.IR pfx ,
if !=0, is limited to 5, the length of
.I <pid>
(the base 64 representation of the current process id)
(the base 64 representation of the current process ID)
is limited to 3, and
.I <suf>
(an internally generated suffix that avoid file conflicts)

View file

@ -206,7 +206,7 @@ The child environment is cleared before
is added.
.TP
.L PROC_GID
The child effective group id is set to the real group id.
The child effective group ID is set to the real group ID.
.TP
.L PROC_IGNORE
Parent pipe errors are ignored.
@ -239,11 +239,11 @@ is used to execute
if it is a shell script.
.TP
.L PROC_PRIVELEGED
If the effective user id is
If the effective user ID is
.L 0
then the child real user id is set to
then the child real user ID is set to
.L 0
and the child real group id is set to the effective group id.
and the child real group ID is set to the effective group ID.
.TP
.L PROC_READ
.I proc.rfd
@ -259,7 +259,7 @@ entry
.LR PROC_SYS_PGRP(-1) .)
.TP
.L PROC_UID
The child effective user id is set to the real user id.
The child effective user ID is set to the real user ID.
.TP
.L PROC_WRITE
.I proc.wfd
@ -270,7 +270,7 @@ standard input.
The return value is a pointer to a structure with the following members:
.TP
.L "pid_t \fIpid\fP"
The child process id.
The child process ID.
.TP
.L "pid_t \fIpgrp\fP"
The child process group.

View file

@ -40,7 +40,7 @@
.SH NAME
strdup \- duplicate null-terminated string
.SH SYNOPSIS
.L "char* strdup(char* s)"
.L "char* strdup(const char* s)"
.SH DESCRIPTION
.I strdup
copies the null-terminated string

View file

@ -40,7 +40,7 @@
.SH NAME
strelapsed \- parse elapsed time expression
.SH SYNOPSIS
.L "unsigned long strelapsed(char* buf, char** next, int persec)"
.L "unsigned long strelapsed(const char* buf, char** next, int persec)"
.SH DESCRIPTION
.I strelapsed
returns a pointer to a string representation of the elapsed time for

View file

@ -40,7 +40,7 @@
.SH NAME
streval \- long integer arithmetic expression evaluator
.SH SYNOPSIS
.L "long streval(char* s, char** e, long (*conv)(char* cs, char** ce))"
.L "long streval(const char* s, char** e, long (*conv)(const char* cs, char** ce))"
.SH DESCRIPTION
.I streval
evaluates the long integer arithmetic expression in the null-terminated string

View file

@ -40,9 +40,9 @@
.SH NAME
strmatch \- match shell file patterns
.SH SYNOPSIS
.L "int strmatch(char* s, char* p)"
.L "int strmatch(const char* s, const char* p)"
.br
.L "char* submatch(char* s, char* p, int m)"
.L "char* submatch(const char* s, const char* p, int flags)"
.SH DESCRIPTION
.I strmatch
compares the string
@ -56,7 +56,7 @@ does a leading substring match of the shell pattern
with the string
.IR s .
If
.I m
.I flags
is 0 then the match is minimal, otherwise a maximal match is done.
A pointer to the first character after the matched substring is returned,
.I 0

View file

@ -42,7 +42,7 @@ stropt \- table driven option expression evaluator
.SH SYNOPSIS
.L "#include <namval.h>"
.br
.L "int stropt(char* s, struct namval* tab,
.L "int stropt(const char* s, struct namval* tab, int siz,
.br
.L " int (*fun)(void* a, struct namval* p, int n, char* v),"
.br

View file

@ -40,7 +40,7 @@
.SH NAME
strperm \- evaluate file permission expression
.SH SYNOPSIS
.L "int strperm(char* s, char** e, int p)"
.L "int strperm(const char* s, char** e, int p)"
.SH DESCRIPTION
.I strperm
applies a file permission expression in the null-terminated string

View file

@ -40,7 +40,7 @@
.SH NAME
strtape \- convert string to tape device pathname
.SH SYNOPSIS
.L "char* strtape(char* s, char** e)"
.L "char* strtape(const char* s, char** e)"
.SH DESCRIPTION
.I strtape
converts the generic tape device specification in the null-terminated string

View file

@ -40,7 +40,7 @@
.SH NAME
strton \- convert string to long integer
.SH SYNOPSIS
.L "long strton(char* s, char** e)"
.L "long strton(const char* s, char** e, char *basep, int m)"
.SH DESCRIPTION
.I strton
converts the null-terminated string

View file

@ -29,7 +29,7 @@ static char** ids;
static const char* dflt[] = { "ast", "standard", 0 };
/*
* initialize the conformance() id list
* initialize the conformance() ID list
*/
static char**
@ -97,8 +97,8 @@ initconformance(void)
}
/*
* return conformance id if s size n is in conformance
* prefix match of s on the conformance id table
* return conformance ID if s size n is in conformance
* prefix match of s on the conformance ID table
* s==0 => "standard"
*/

View file

@ -139,7 +139,7 @@ typedef struct Push_s
typedef struct Tag_s
{
unsigned char level; /* indent level */
unsigned char id; /* TAG_* id */
unsigned char id; /* TAG_* ID */
} Tag_t;
typedef struct Indent_s

View file

@ -101,7 +101,7 @@ typedef struct Optstate_s
Dtdisc_t msgdisc; /* msgdict discipline */
Dt_t* msgdict; /* default ast.id catalog msgs */
Optcache_t* cache; /* OPT_cache cache */
char** conformance; /* conformance id vector */
char** conformance; /* conformance ID vector */
} Optstate_t;
#define _OPT_PRIVATE_ \

View file

@ -29,7 +29,7 @@ static const char id[] = "\n@(#)$Id: ast (AT&T Research) 2012-05-28 $\0\n";
_Ast_info_t _ast_info =
{
"libast", /* id */
"libast", /* ID */
{ 0 },
0,0,0,0,0,
strcmp, /* collate */

View file

@ -422,7 +422,7 @@ char *_stkseek(register Sfio_t *stream, register ssize_t n)
/*
* advance the stack to the current top
* if extra is non-zero, first add a extra bytes and zero the first
* if extra is non-zero, first add extra bytes and zero the first
*/
char *stkfreeze(register Sfio_t *stream, register size_t extra)
{

View file

@ -349,7 +349,7 @@ translate(const char* loc, const char* cmd, const char* cat, const char* msg)
!(cp = mp->cat))
{
#if DEBUG_trace > 1
sfprintf(sfstderr, "AHA#%d:%s cmd %s cat %s:%s id %s msg `%s'\n", __LINE__, __FILE__, cmd, cat, error_info.catalog, ast.id, msg);
sfprintf(sfstderr, "AHA#%d:%s cmd %s cat %s:%s ID %s msg `%s'\n", __LINE__, __FILE__, cmd, cat, error_info.catalog, ast.id, msg);
#endif
cp = 0;
goto done;

View file

@ -36,7 +36,7 @@
*
* SHELL is read from the environment and must start with /
*
* if set-uid or set-gid then the executable and its containing
* if setuid or setgid then the executable and its containing
* directory must not be owned by the real user/group
*
* root/administrator has its own test

View file

@ -35,7 +35,7 @@
/*
* return 1 if files a and b are the same under preroot
*
* NOTE: the kernel disables preroot for set-uid processes
* NOTE: the kernel disables preroot for setuid processes
*/
static int

View file

@ -669,7 +669,7 @@ struct _sfrsrv_s
/* co-process structure */
typedef struct _sfproc_s Sfproc_t;
struct _sfproc_s
{ int pid; /* process id */
{ int pid; /* process ID */
uchar* rdata; /* read data being cached */
int ndata; /* size of cached data */
int size; /* buffer size */

View file

@ -147,7 +147,7 @@ int _sfsetpool(Sfio_t* f)
}
/* always add at end of array because if this was done during some sort
of walk thru all streams, we'll want the new stream to be seen.
of walk through all streams, we'll want the new stream to be seen.
*/
p->sf[p->n_sf++] = f;
rv = 0;

View file

@ -126,7 +126,7 @@ struct _vtmutex_s
/* structure for states of thread */
struct _vthread_s
{ _vtself_t self; /* self-handle */
_vtid_t id; /* thread id */
_vtid_t id; /* thread ID */
_vtattr_t attrs; /* attributes */
size_t stack; /* stack size */
int state; /* execution state */

View file

@ -129,7 +129,7 @@ ccmaplist(Ccmap_t* mp)
}
/*
* return ccode map id given name
* return ccode map ID given name
*/
int
@ -158,7 +158,7 @@ ccmapid(const char* name)
}
/*
* return ccode map name given id
* return ccode map name given ID
*/
char*

View file

@ -24,7 +24,7 @@
* Glenn Fowler
* AT&T Bell Laboratories
*
* cached gid number -> name
* cached GID number -> group name
*/
#if defined(__STDPP__directive) && defined(__STDPP__hide)
@ -53,7 +53,7 @@ typedef struct Id_s
} Id_t;
/*
* return gid name given gid number
* return group name for given GID number
*/
char*

View file

@ -24,7 +24,7 @@
* Glenn Fowler
* AT&T Bell Laboratories
*
* uid number -> name
* UID number -> user name
*/
#if defined(__STDPP__directive) && defined(__STDPP__hide)
@ -53,7 +53,7 @@ typedef struct Id_s
} Id_t;
/*
* return uid name given uid number
* return user name for given UID number
*/
char*

View file

@ -24,7 +24,7 @@
* Glenn Fowler
* AT&T Bell Laboratories
*
* gid name -> number
* group name -> GID number
*/
#if defined(__STDPP__directive) && defined(__STDPP__hide)
@ -60,8 +60,8 @@ typedef struct Id_s
} Id_t;
/*
* return gid number given gid/uid name
* gid attempted first, then uid->pw_gid
* return GID number for given group name
* gr->gr_gid attempted first, then pw->pw_gid
* -1 on first error for a given name
* -2 on subsequent errors for a given name
*/

View file

@ -24,7 +24,7 @@
* Glenn Fowler
* AT&T Bell Laboratories
*
* uid name -> number
* user name -> UID
*/
#if defined(__STDPP__directive) && defined(__STDPP__hide)
@ -56,7 +56,7 @@ typedef struct Id_s
} Id_t;
/*
* return uid number given uid name
* return UID number for given user name
* -1 on first error for a given name
* -2 on subsequent errors for a given name
*/

View file

@ -204,7 +204,7 @@ static int mminit(Mmdisc_t* mmdc)
MAP_SHARED, fd, (off_t)0 );
}
else
{ /* make the key and get/create an id for the share mem segment */
{ /* make the key and get/create an ID for the share mem segment */
if((key = ftok(mmdc->file, mmdc->proj)) < 0 )
goto done;
if((mmdc->shmid = shmget(key, size, IPC_CREAT|FILE_MODE)) < 0 )

View file

@ -64,7 +64,7 @@ static void* poolalloc(Vmalloc_t* vm, reg size_t size, int local)
size = ROUND(size,ALIGN);
/* look thru all segments for a suitable free block */
/* look through all segments for a suitable free block */
for(tp = NIL(Block_t*), seg = vd->seg; seg; seg = seg->next)
{ if((tp = seg->free) &&
(s = (SIZE(tp) & ~BITS) + sizeof(Head_t)) >= size )