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 minor problems and update the documentation (#237)

These are minor fixes I've accumulated over time. The following
changes are somewhat notable:

- Added a missing entry for 'typeset -s' to the man page.
- Add strftime(3) to the 'see also' section. This and the date(1)
  addition are meant to add onto the documentation for 'printf %T'.
- Removed the man page the entry for ksh reading $PWD/.profile on
  login. That feature was removed in commit aa7713c2.
- Added date(1) to the 'see also' section of the man page.
- Note that the 'hash' command can be used instead of 'alias -t' to
  workaround one of the caveats listed in the man page.
- Use an 'out of memory' error message rather than 'out of space'
  when memory allocation fails.
- Replaced backticks with quotes in some places for consistency.
- Added missing documentation for the %P date format.
- Added missing documentation for the printf %Q and %p formats
  (backported from ksh2020: https://github.com/att/ast/pull/1032).
- The comments that show each builtin's options have been updated.
This commit is contained in:
Johnothan King 2021-03-21 07:39:03 -07:00 committed by GitHub
parent 2d7e9a0d6d
commit 814b5c6890
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
151 changed files with 378 additions and 378 deletions

View file

@ -30,7 +30,7 @@ hash: generic, scoped hash table support
hashsize explicitly change table size (usually automatic)
hashwalk apply function to each table entry
memhash return hash code for n-char chunk of memory
strhash return hash code for null terminated string
strhash return hash code for null-terminated string
include/ast: libast support headers

View file

@ -706,7 +706,7 @@
03-09-23 modedata.c: table is for external modes, so no arch specific hacks
optget.c: fix option prefix match translation bug
optget.c: add `<length> <name>=<value>\n' to optstr()
features/lib: add memcmp() test for sgi optimzation bug
features/lib: add memcmp() test for sgi optimization bug
03-09-22 regex.h,regcomp.c: add regncomp()
regclass.c: fix for loop dangling ; in regaddclass()
03-09-20 sftable.c,sfvprintf.c: fix SFFMT_CHAR handling to match extf api
@ -963,7 +963,7 @@
02-06-27 ast_std.h: map _sysconf => _ast_sysconf for sun
02-06-26 cdt,sfio,vmalloc: kpv sync -- is this ever easy?
02-06-24 sfio: kpv sync, vfwscanf(),fputw() fix (wcslen(x)*sizeof(wchar_t)!!)
misc/fts.c: fix symlink chdir() optimzation bug
misc/fts.c: fix symlink chdir() optimization bug
02-06-11 sfio/sfwrite.c: string to file fix
Makefile: __OBSOLETE__==20020101
02-06-01 regex/regcomp.c: REG_DELIMITED now consumes the delimiter
@ -1076,7 +1076,7 @@
misc/glob.c: fix \ trim() bug that restored / to wrong position
string/fmtre.c: fix { ^ . $ } translations
misc/optget.c: use original string if translation fails -- duh
sfio/sfhdr.h: assume <errno.h> assigns proper atttibutes to errno
sfio/sfhdr.h: assume <errno.h> assigns proper attributes to errno
comp/regcmp.c: __ia64 workaround fixed by proper CC.DLL probe
comp/getdate.c: __ia64 workaround fixed by proper CC.DLL probe
features/lib: add lib getdate
@ -1090,7 +1090,7 @@
string/fmtmode.c: fix bug that omitted trailing '\0'
01-10-12 misc/optget.c: . => \&. for --??nroff
comp/wc.c: fix mbstate_t initialization typo
features/float: fix max integer / float loop termiation
features/float: fix max integer / float loop termination
features/float: fix LDBL_UINTMAX_MAX typo that did DBL_UINTMAX_MAX
01-10-11 include/sfio.h: fix _Sfstd* import/export
features/common: fix _UWIN __DYNAMIC__() definition

View file

@ -134,7 +134,7 @@ typedef struct _dtlib_s
(dt)->disc && (dt)->disc->eventf ) ? \
(*(dt)->disc->eventf)((dt), DT_ANNOUNCE|(ty), (ob), (dt)->disc) : 0 )
/* map bits for upward compabitibility */
/* map bits for upward compatibility */
#define DTTYPE(dt,ty) ((dt)->typef ? (*(dt)->typef)((dt), (ty)) : (ty) )
/* short-hands for fields in Dtlink_t.

View file

@ -49,7 +49,7 @@ Dtmethod_t* meth;
list = dtextract(dt); /* extract elements out of dictionary */
/* try to create internal structure for new method */
if(dt->searchf == oldmt->searchf) /* ie, not viewpathing */
if(dt->searchf == oldmt->searchf) /* i.e., not viewpathing */
dt->searchf = meth->searchf;
dt->meth = meth;
dt->data = NIL(Dtdata_t*);

View file

@ -1107,7 +1107,7 @@ error(DEBUG_TRACE, "AHA#%d _ast_iconv_open f=%s:%s:%d t=%s:%s:%d\n", __LINE__, f
cc->cvt = (iconv_t)(-1);
/*
* 8 bit maps are the easiest
* 8-bit maps are the easiest
*/
if (fc >= 0 && tc >= 0)

View file

@ -199,7 +199,7 @@ native_setlocale(int category, const char* locale)
/*
* LC_COLLATE and LC_CTYPE debug support
*
* mutibyte debug encoding
* multibyte debug encoding
*
* DL0 [ '0' .. '4' ] c1 ... c4 DR0
* DL1 [ '0' .. '4' ] c1 ... c4 DR1

View file

@ -34,8 +34,8 @@ struct list
};
/*
* elimnates shell quoting as inserted with sh_fmtq
* result relaces <string>
* eliminates shell quoting as inserted with sh_fmtq
* result replaces <string>
* length of resulting string is returned.
*/
static int sh_unquote(char* string)

View file

@ -59,7 +59,7 @@ nomalloc(Vmalloc_t* region, int type, void* obj, Vmdisc_t* disc)
#endif
case VM_NOMEM:
vmstat(region, &st);
error(ERROR_SYSTEM|3, "storage allocator out of space on %lu byte request ( region %lu segments %lu busy %lu:%lu:%lu free %lu:%lu:%lu )", (size_t)obj, st.extent, st.n_seg, st.n_busy, st.s_busy, st.m_busy, st.n_free, st.s_free, st.m_free);
error(ERROR_SYSTEM|3, "storage allocator out of memory on %lu byte request ( region %lu segments %lu busy %lu:%lu:%lu free %lu:%lu:%lu )", (size_t)obj, st.extent, st.n_seg, st.n_busy, st.s_busy, st.m_busy, st.n_free, st.s_free, st.m_free);
return(-1);
}
return(0);

View file

@ -88,7 +88,7 @@ int type;
}
if(done < n && (di->cntl & FDIRECT) )
{ /* turn off directIO for remaining IO operation */
{ /* turn off direct IO for remaining IO operation */
di->cntl &= ~FDIRECT;
(void)fcntl(f->file, F_SETFL, di->cntl);
}

View file

@ -30,7 +30,7 @@
#include "hashlib.h"
/*
* return the hash of the null terminated string s
* return the hash of the null-terminated string s
*/
unsigned int

View file

@ -176,7 +176,7 @@ typedef struct
#define FMT_ALWAYS 0x01 /* always quote */
#define FMT_ESCAPED 0x02 /* already escaped */
#define FMT_SHELL 0x04 /* escape $ ` too */
#define FMT_WIDE 0x08 /* don't escape 8 bit chars */
#define FMT_WIDE 0x08 /* don't escape 8-bit chars */
#define FMT_PARAM 0x10 /* disable FMT_SHELL ${$( quote */
/*

View file

@ -130,7 +130,7 @@ struct _glob_
/* error return values */
#define GLOB_ABORTED 1
#define GLOB_NOMATCH 2
#define GLOB_NOSPACE 3
#define GLOB_NOSPACE 3 /* note: this error is for ENOMEM */
#define GLOB_INTR 4
#define GLOB_APPERR 5
#define GLOB_NOSYS 6

View file

@ -35,7 +35,7 @@
#include <ast_mode.h>
/*
* some systems (could it beee AIX) pollute the std name space
* some systems (could be AIX) pollute the std name space
*/
#undef fileid

View file

@ -118,7 +118,7 @@
#define REG_EBRACE 9 /* \{...\} or {...} imbalance */
#define REG_BADBR 10 /* invalid {...} digits */
#define REG_ERANGE 11 /* invalid [...] range endpoint */
#define REG_ESPACE 12 /* out of space */
#define REG_ESPACE 12 /* out of memory */
#define REG_BADRPT 13 /* unary op not preceded by re */
#define REG_ENULL 14 /* empty subexpr in pattern */
#define REG_ECOUNT 15 /* re component count overflow */

View file

@ -125,7 +125,7 @@ Returns the error message text corresponding to the
.Ss "char* strerror(int \fIerrno\fP)"
Equivalent to fmterror(\fIerrno\fP).
.Ss "int strgrpmatch(const char* \fIstring\fP, const char* \fIpattern\fP, int* \fIsub\fP, int \fInsub\fP, int \fIflags\fP)"
Matches the null terminated \fIstring\fP against the null terminated
Matches the null-terminated \fIstring\fP against the null-terminated
.BR ksh (1)
augmented \fIpattern\fP.
If \fIsub\fP!=0 then \fIsub\fP[2*\fIi\fP] is set to the start offset and \fIsub\fP[2*\fIi\fP+1] is set

View file

@ -592,7 +592,7 @@ Explicit calls to this routine are not necessary as hash tables
are automatically resized.
.TP
.L "int strhash(char* name)"
Hashes the null terminated character string
Hashes the null-terminated character string
.L name
using a linear congruent pseudo-random number generator algorithm
and returns a non-negative

View file

@ -1545,7 +1545,7 @@ for indicating the type of a scanned element.
For example, \f5%hd\fP means scanning a \f5short int\fP.
The flags \f5ll\fP and \f5L\fP mean respectively scanning an
integer or a floating point value with largest size
(i.e, \f5Sflong_t\fP or \f5Sfdouble_t\fP).
(i.e., \f5Sflong_t\fP or \f5Sfdouble_t\fP).
.PP
The \f5%i\fP, \f5%d\fP and \f5%u\fP patterns scan numbers in bases
from \f52\fP to \f564\fP.

View file

@ -43,7 +43,7 @@ strcopy \- copy strings
.L "char* strcopy(char* a, char* b)"
.SH DESCRIPTION
.I strcopy
copies the nul-terminated string
copies the null-terminated string
.I b
into
.IR a .

View file

@ -38,12 +38,12 @@
..
.TH STRDUP 3
.SH NAME
strdup \- duplicate nul-terminated string
strdup \- duplicate null-terminated string
.SH SYNOPSIS
.L "char* strdup(char* s)"
.SH DESCRIPTION
.I strdup
copies the nul-terminated string
copies the null-terminated string
.I s
to a new location provided by
.IR malloc (3)

View file

@ -45,7 +45,7 @@ stresc \- convert character constants in string
.I stresc
converts
.L \e
character constant expressions in the nul-terminated string
character constant expressions in the null-terminated string
.I s
in place and returns the length of the converted
.IR s .

View file

@ -43,7 +43,7 @@ streval \- long integer arithmetic expression evaluator
.L "long streval(char* s, char** e, long (*conv)(char* cs, char** ce))"
.SH DESCRIPTION
.I streval
evaluates the long integer arithmetic expression in the nul-terminated string
evaluates the long integer arithmetic expression in the null-terminated string
.I s
and returns the result.
If

View file

@ -49,7 +49,7 @@ stropt \- table driven option expression evaluator
.L " void* a)"
.SH DESCRIPTION
.I stropt
parses option expressions in the nul-terminated string
parses option expressions in the null-terminated string
.I s
using the option names in
.IR tab .

View file

@ -43,7 +43,7 @@ strperm \- evaluate file permission expression
.L "int strperm(char* s, char** e, int p)"
.SH DESCRIPTION
.I strperm
applies a file permission expression in the nul-terminated string
applies a file permission expression in the null-terminated string
.I s
to the initial file permission mask
.IR p .

View file

@ -43,7 +43,7 @@ strtape \- convert string to tape device pathname
.L "char* strtape(char* s, char** e)"
.SH DESCRIPTION
.I strtape
converts the generic tape device specification in the nul-terminated string
converts the generic tape device specification in the null-terminated string
.I s
to a local tape device pathname.
A pointer to the device pathname is returned.

View file

@ -43,7 +43,7 @@ strton \- convert string to long integer
.L "long strton(char* s, char** e)"
.SH DESCRIPTION
.I strton
converts the nul-terminated string
converts the null-terminated string
.I s
to a long integer.
If

View file

@ -149,7 +149,7 @@ cmdopen_20120411(char** argv, int argmax, int size, const char* argpat, Cmddisc_
if (!(cmd = newof(0, Cmdarg_t, 1, n + m)))
{
if (disc->errorf)
(*disc->errorf)(NiL, sh, ERROR_SYSTEM|2, "out of space");
(*disc->errorf)(NiL, sh, ERROR_SYSTEM|2, "out of memory");
return 0;
}
cmd->id = lib;

View file

@ -159,7 +159,7 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di
if (!(vm = vmopen(Vmdcheap, Vmbest, 0)))
goto nospace;
goto nomemory;
/*
* NOTE: searching for FIND_CODES would be much simpler if we
@ -173,7 +173,7 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di
if (disc->flags & FIND_GENERATE)
{
if (!(fp = (Find_t*)vmnewof(vm, 0, Find_t, 1, sizeof(Encode_t) - sizeof(Code_t))))
goto nospace;
goto nomemory;
fp->vm = vm;
fp->id = lib;
fp->disc = disc;
@ -519,14 +519,14 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di
if (*(s = disc->dirs[i]) == '/')
sfsprintf(b, sizeof(fp->decode.temp) - 1, "%s", s);
else if (!p && !(p = getcwd(fp->decode.path, sizeof(fp->decode.path))))
goto nospace;
goto nomemory;
else
sfsprintf(b, sizeof(fp->decode.temp) - 1, "%s/%s", p, s);
s = pathcanon(b, sizeof(fp->decode.temp), 0);
*s = '/';
*(s + 1) = 0;
if (!(fp->dirs[q] = vmstrdup(fp->vm, b)))
goto nospace;
goto nomemory;
if (j)
(fp->dirs[q])[s - b] = 0;
q++;
@ -537,7 +537,7 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di
if (!strneq(b, fp->dirs[q - 1], s - b))
{
if (!(fp->dirs[q] = vmstrdup(fp->vm, b)))
goto nospace;
goto nomemory;
if (j)
(fp->dirs[q])[s - b] = 0;
q++;
@ -647,9 +647,9 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di
}
}
return fp;
nospace:
nomemory:
if (disc->errorf)
(*fp->disc->errorf)(fp, fp->disc, 2, "out of space");
(*fp->disc->errorf)(fp, fp->disc, 2, "out of memory");
if (!vm)
return 0;
if (!fp)

View file

@ -24,7 +24,7 @@
* Glenn Fowler
* AT&T Research
*
* return 1 if path exisis
* return 1 if path exists
* maintains a cache to minimize stat(2) calls
* path is modified in-place but restored on return
* path components checked in pairs to cut stat()'s

View file

@ -813,7 +813,7 @@ feature(register Feature_t* fp, const char* name, const char* path, const char*
if (!(fp = newof(0, Feature_t, 1, n + 1)))
{
if (conferror)
(*conferror)(&state, &state, 2, "%s: out of space", name);
(*conferror)(&state, &state, 2, "%s: out of memory", name);
return 0;
}
fp->op = -1;

View file

@ -421,7 +421,7 @@ char** argv;
case CHARSET:
if (!(cp = newof(0, Charset_t, 1, s - b + 1)))
{
fprintf(stderr, "%s: %d: out of space\n", command, line);
fprintf(stderr, "%s: %d: out of memory\n", command, line);
return 1;
}
b = (char*)(cp + 1);
@ -437,7 +437,7 @@ char** argv;
case TERRITORY:
if (!(tp = newof(0, Territory_t, 1, s - b + 1)))
{
fprintf(stderr, "%s: %d: out of space\n", command, line);
fprintf(stderr, "%s: %d: out of memory\n", command, line);
return 1;
}
b = (char*)(tp + 1);
@ -459,7 +459,7 @@ char** argv;
}
if (!(ll = newof(0, Language_list_t, 1, 0)))
{
fprintf(stderr, "%s: %d: out of space\n", command, line);
fprintf(stderr, "%s: %d: out of memory\n", command, line);
return 1;
}
if (!tp->languages)
@ -491,7 +491,7 @@ char** argv;
case LANGUAGE:
if (!(lp = newof(0, Language_t, 1, s - b + 1)))
{
fprintf(stderr, "%s: %d: out of space\n", command, line);
fprintf(stderr, "%s: %d: out of memory\n", command, line);
return 1;
}
b = (char*)(lp + 1);
@ -527,14 +527,14 @@ char** argv;
fprintf(lf, "0,");
if (!(ap = newof(0, Attribute_t, 1, 0)))
{
fprintf(stderr, "%s: %d: out of space\n", command, line);
fprintf(stderr, "%s: %d: out of memory\n", command, line);
return 1;
}
ap->link.code = b;
ap->link.index = i++;
if (!(al = newof(0, Attribute_list_t, 1, 0)))
{
fprintf(stderr, "%s: %d: out of space\n", command, line);
fprintf(stderr, "%s: %d: out of memory\n", command, line);
return 1;
}
if (!lp->attributes)
@ -560,7 +560,7 @@ char** argv;
case MAP:
if (!(mp = newof(0, Map_t, 1, s - b + 1)))
{
fprintf(stderr, "%s: %d: out of space\n", command, line);
fprintf(stderr, "%s: %d: out of memory\n", command, line);
return 1;
}
b = (char*)(mp + 1);

View file

@ -44,7 +44,7 @@ static const char* reg_error[] =
/* REG_EBRACE */ "\\{...\\} or {...} imbalance",
/* REG_BADBR */ "invalid {...} digits",
/* REG_ERANGE */ "invalid [...] range endpoint",
/* REG_ESPACE */ "out of space",
/* REG_ESPACE */ "out of memory",
/* REG_BADRPT */ "unary op not preceded by re",
/* REG_ENULL */ "empty subexpr in pattern",
/* REG_ECOUNT */ "re component count overflow",

View file

@ -30,7 +30,7 @@
** consideration is stacking a discipline onto a read stream. Each
** discipline operation implies buffer synchronization so the stream
** buffer should be empty. However, a read stream representing an
** unseekable device (eg, a pipe) may not be synchronizable. In that
** unseekable device (e.g., a pipe) may not be synchronizable. In that
** case, any buffered data must then be fed to the new discipline
** to preserve data processing semantics. This is done by creating
** a temporary discipline to cache such buffered data and feed

View file

@ -54,7 +54,7 @@ size_t n; /* buffer size */
int rc; /* record character */
long tm; /* time-out */
int action; /* >0: peeking, if rc>=0, get action records,
<0: no peeking, if rc>=0, get -action records,
<0: no peeking, if rc>=0, get action records,
=0: no peeking, if rc>=0, must get a single record
=2: same as >0, but always use select(2)
*/
@ -107,12 +107,12 @@ int action; /* >0: peeking, if rc>=0, get action records,
break;
}
}
#endif /* stream_peek */
#endif /* _stream_peek */
if(ntry == 1)
break;
/* poll or select to see if data is present. */
/* use select to see if data is present */
while(tm >= 0 || action > 0 ||
/* block until there is data before peeking again */
((t&STREAM_PEEK) && rc >= 0) ||

View file

@ -34,7 +34,7 @@ int sfpoll(Sfio_t** fa, reg int n, int tm)
int sfpoll(fa, n, tm)
Sfio_t** fa; /* array of streams to poll */
reg int n; /* number of streams in array */
int tm; /* time in millisecs for select/poll */
int tm; /* time in milliseconds for select/poll */
#endif
{
reg int r, c, m, np, eintr;

View file

@ -203,7 +203,7 @@ int type; /* 0: from org, 1: from here, 2: from end */
#ifdef MAP_TYPE
if(f->bits&SF_MMAP)
{ /* if mmap is not great, stop mmaping if moving around too much */
{ /* if mmap is not great, stop mmapping if moving around too much */
#if _mmap_worthy < 2
if((f->next - f->data) < ((f->endb - f->data)/4) )
{ SFSETBUF(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND);

View file

@ -410,7 +410,7 @@ done:
_Sfi = f->val = obuf ? osize : 0;
/* blksz is used for aligning disk block boundary while reading data to
** optimize data transfer from disk (eg, via direct I/O). blksz can be
** optimize data transfer from disk (e.g., via direct I/O). blksz can be
** at most f->size/2 so that data movement in buffer can be optimized.
** blksz should also be a power-of-2 for optimal disk seeks.
*/

View file

@ -218,7 +218,7 @@ Sfio_t* f;
# if defined(__linux__) && _lib_statfs
/*
* Use the area of POSIX shared memory objects for the new temporary file descriptor
* that is do not access HD or SSD but only the memory based tmpfs of the POSIX SHM
* that is do not access the HDD or SSD but only the memory based tmpfs of the POSIX SHM
*/
static int doshm;
static char *shm = "/dev/shm";

View file

@ -148,7 +148,7 @@ spliceline(Sfio_t* s, int op, void* val, Sfdisc_t* ad)
*
* flags: 0 arg: open Sfio_t*
* flags: SF_READ arg: file name
* flags: SF_STRING arg: null terminated char*
* flags: SF_STRING arg: null-terminated char*
*
* if line!=0 then it points to a line count that starts at 0
* and is incremented for each input line

View file

@ -75,5 +75,4 @@ extern char* getpass(const char *prompt)
return(cp?passwd:0);
}
#endif

View file

@ -27,7 +27,7 @@ void _STUB_vmlast(){}
#include "vmhdr.h"
/* Allocation with freeing and reallocing of last allocated block only.
/* Allocation with freeing and reallocating of last allocated block only.
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/