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.
*/

View file

@ -53,7 +53,7 @@
09-09-09 fds.c: add --unit=fd
09-08-25 tail.c: initialize Tail_t.fifo=0 !!
09-08-15 tail.c: fix fifo logic
09-08-11 wc.c: add setlocale(LC_CTYPE,"C") cleanup, add utf8 optimzations
09-08-11 wc.c: add setlocale(LC_CTYPE,"C") cleanup, add UTF-8 optimizations
09-08-10 uniq.c: replace -c 1..9999 sfsprintf() with inline conversion
09-08-01 join.c: fix empty field null pointer deref
09-07-23 pathchk.c: add -P,--path and -a,--all

View file

@ -286,7 +286,7 @@ b_chgrp(int argc, char** argv, Shbltin_t* context)
mapdisc.key = offsetof(Map_t, key);
mapdisc.size = sizeof(Key_t);
if (!(map = dtopen(&mapdisc, Dtset)))
error(ERROR_exit(1), "out of space [id map]");
error(ERROR_exit(1), "out of memory [id map]");
continue;
case 'n':
options |= OPT_SHOW;
@ -358,7 +358,7 @@ b_chgrp(int argc, char** argv, Shbltin_t* context)
if (!(m = (Map_t*)dtmatch(map, &key)))
{
if (!(m = (Map_t*)stakalloc(sizeof(Map_t))))
error(ERROR_exit(1), "out of space [id dictionary]");
error(ERROR_exit(1), "out of memory [id dictionary]");
m->key = key;
m->to.uid = m->to.gid = NOID;
dtinsert(map, m);

View file

@ -106,7 +106,7 @@ static const char usage[] =
"[P:physical|nofollow?Don't follow symbolic links when traversing directories.]"
"[R:recursive?Change the mode for files in subdirectories recursively.]"
"[c:changes?Describe only files whose permission actually change.]"
"[f:quiet|silent?Do not report files whose permissioins fail to change.]"
"[f:quiet|silent?Do not report files whose permissions fail to change.]"
"[h|l:symlink?Change the mode of symbolic links on systems that "
"support \blchmod\b(2). Implies \b--physical\b.]"
"[i:ignore-umask?Ignore the \bumask\b(2) value in symbolic mode "

View file

@ -289,7 +289,7 @@ visit(State_t* state, register FTSENT* ent)
if (state->directory)
{
if ((state->postsiz + len) > state->pathsiz && !(state->path = newof(state->path, char, state->pathsiz = roundof(state->postsiz + len, PATH_CHUNK), 0)))
error(ERROR_SYSTEM|3, "out of space");
error(ERROR_SYSTEM|3, "out of memory");
if (state->hierarchy && ent->fts_level == 0 && strchr(base, '/'))
{
s = state->path + state->postsiz;
@ -688,7 +688,7 @@ b_cp(int argc, register char** argv, Shbltin_t* context)
if (!(sh = CMD_CONTEXT(context)) || !(state = (State_t*)sh->ptr))
{
if (!(state = newof(0, State_t, 1, 0)))
error(ERROR_SYSTEM|3, "out of space");
error(ERROR_SYSTEM|3, "out of memory");
if (sh)
sh->ptr = state;
}
@ -873,7 +873,7 @@ b_cp(int argc, register char** argv, Shbltin_t* context)
argv++;
}
if (!(v = (char**)stkalloc(stkstd, (argc + 2) * sizeof(char*))))
error(ERROR_SYSTEM|3, "out of space");
error(ERROR_SYSTEM|3, "out of memory");
memcpy(v, argv, (argc + 1) * sizeof(char*));
argv = v;
if (!standard)
@ -960,7 +960,7 @@ b_cp(int argc, register char** argv, Shbltin_t* context)
error(3, "%s: not a directory", file);
state->postsiz = strlen(file);
if (state->pathsiz < roundof(state->postsiz + 2, PATH_CHUNK) && !(state->path = newof(state->path, char, state->pathsiz = roundof(state->postsiz + 2, PATH_CHUNK), 0)))
error(ERROR_SYSTEM|3, "out of space");
error(ERROR_SYSTEM|3, "out of memory");
memcpy(state->path, file, state->postsiz + 1);
if (state->directory && state->path[state->postsiz - 1] != '/')
state->path[state->postsiz++] = '/';

View file

@ -31,7 +31,7 @@ static const char usage[] =
"[--catalog?" ERROR_CATALOG "]"
"[+NAME?cut - cut out selected columns or fields of each line of a file]"
"[+DESCRIPTION?\bcut\b bytes, characters, or character-delimited fields "
"from one or more files, contatenating them on standard output.]"
"from one or more files, concatenating them on standard output.]"
"[+?The option argument \alist\a is a comma-separated or blank-separated "
"list of positive numbers and ranges. Ranges can be of three "
"forms. The first is two positive integers separated by a hyphen "
@ -52,7 +52,7 @@ static const char usage[] =
"[d:delimiter]:[delim?The field character for the \b-f\b option is set "
"to \adelim\a. The default is the \btab\b character.]"
"[f:fields]:[list?\bcut\b based on fields separated by the delimiter "
"character specified with the \b-d\b optiion.]"
"character specified with the \b-d\b option.]"
"[n!:split?Split multibyte characters selected by the \b-b\b option.]"
"[R|r:reclen]#[reclen?If \areclen\a > 0, the input will be read as fixed length "
"records of length \areclen\a when used with the \b-b\b or \b-c\b "
@ -60,7 +60,7 @@ static const char usage[] =
"[s:suppress|only-delimited?Suppress lines with no delimiter characters, "
"when used with the \b-f\b option. By default, lines with no "
"delimiters will be passed in untouched.]"
"[D:line-delimeter|output-delimiter]:[ldelim?The line delimiter character for "
"[D:line-delimiter|output-delimiter]:[ldelim?The line delimiter character for "
"the \b-f\b option is set to \aldelim\a. The default is the "
"\bnewline\b character.]"
"[N!:newline?Output new-lines at end of each record when used "
@ -138,7 +138,7 @@ cutinit(int mode, char* str, Delim_t* wdelim, Delim_t* ldelim, size_t reclen)
Cut_t* cut;
if (!(cut = (Cut_t*)stakalloc(sizeof(Cut_t) + strlen(cp) * sizeof(int))))
error(ERROR_exit(1), "out of space");
error(ERROR_exit(1), "out of memory");
if (cut->mb = mbwide())
{
memset(cut->space, 0, sizeof(cut->space) / 2);

View file

@ -95,8 +95,8 @@ static const char usage[] =
" [+d?day of month number]"
" [+D?date as \amm/dd/yy\a]"
" [+e?blank padded day of month number]"
" [+f?print a date with the format '\%Y.\%m.\%d-\%H:\%M:\%S']"
" [+F?%ISO 8601:2000 standard date format; equivalent to Y-%m-%d]"
" [+f?print a date with the format \b%Y.%m.%d-%H:%M:%S\b]"
" [+F?ISO 8601:2000 standard date format; equivalent to \b%Y-%m-%d\b]"
" [+g?\bls\b(1) \b-l\b recent date with \ahh:mm\a]"
" [+G?\bls\b(1) \b-l\b distant date with \ayyyy\a]"
" [+h?abbreviated month name]"
@ -114,9 +114,10 @@ static const char usage[] =
" [+n?newline character]"
" [+N?nanoseconds 000000000-999999999]"
" [+p?meridian (e.g., \bAM\b or \bPM\b)]"
" [+P?lowercase meridian (e.g., \bam\b or \bpm\b)]"
" [+q?quarter of the year]"
" [+Q?\a<del>recent<del>distant<del>\a: \a<del>\a is a unique"
" delimter character; \arecent\a format for recent"
" delimiter character; \arecent\a format for recent"
" dates, \adistant\a format otherwise]"
" [+r?12-hour time as \ahh:mm:ss meridian\a]"
" [+R?24-hour time as \ahh:mm\a]"
@ -344,7 +345,7 @@ b_date(int argc, register char** argv, Shbltin_t* context)
continue;
case 'p':
if (!(f = newof(0, Fmt_t, 1, 0)))
error(ERROR_SYSTEM|3, "out of space [format]");
error(ERROR_SYSTEM|3, "out of memory [format]");
f->next = fmts;
f->format = opt_info.arg;
fmts = f;

View file

@ -43,7 +43,7 @@ static const char usage[] =
"other than a single byte:]"
"{"
"[+b?512 bytes.]"
"[+k?1-killobyte.]"
"[+k?1-kilobyte.]"
"[+m?1-megabyte.]"
"}"
"[+?For backwards compatibility, \b-\b\anumber\a is equivalent to \b-n\b "

View file

@ -232,7 +232,7 @@ getids(Sfio_t* sp, const char* name, register int flags)
if ((maxgroups = getgroups(0, groups)) <= 0)
maxgroups = NGROUPS_MAX;
if (!(groups = newof(0, gid_t, maxgroups + 1, 0)))
error(ERROR_exit(1), "out of space [group array]");
error(ERROR_exit(1), "out of memory [group array]");
}
ngroups = getgroups(maxgroups, groups);
for (i = j = 0; i < ngroups; i++)

View file

@ -704,7 +704,7 @@ sfprintf(sfstdout, "[2#%d:0,%lld,%lld]", __LINE__, lo, hi);
jp->samesize = roundof(n2, 16);
if (!(jp->same = newof(jp->same, char, jp->samesize, 0)))
{
error(ERROR_SYSTEM|2, "out of space");
error(ERROR_SYSTEM|2, "out of memory");
return -1;
}
}
@ -824,7 +824,7 @@ b_join(int argc, char** argv, Shbltin_t* context)
cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY);
#endif
if (!(jp = init()))
error(ERROR_system(1),"out of space");
error(ERROR_system(1),"out of memory");
jp->context = context;
for (;;)
{

View file

@ -75,4 +75,3 @@ b_logname(int argc, char** argv, Shbltin_t* context)
sfputr(sfstdout, logname, '\n');
return 0;
}

View file

@ -30,7 +30,7 @@ static const char usage[] =
"[-?\n@(#)$Id: mkfifo (AT&T Research) 2009-01-02 $\n]"
"[--catalog?" ERROR_CATALOG "]"
"[+NAME?mkfifo - make FIFOs (named pipes)]"
"[+DESCRIPTION?\bmkfifo\b creates one or more FIFO's. By "
"[+DESCRIPTION?\bmkfifo\b creates one or more FIFOs. By "
"default, the mode of created FIFO is \ba=rw\b minus the "
"bits set in the \bumask\b(1).]"
"[m:mode]:[mode?Set the mode of created FIFO to \amode\a. "
@ -40,8 +40,8 @@ static const char usage[] =
"\nfile ...\n"
"\n"
"[+EXIT STATUS?]{"
"[+0?All FIFO's created successfully.]"
"[+>0?One or more FIFO's could not be created.]"
"[+0?All FIFOs created successfully.]"
"[+>0?One or more FIFOs could not be created.]"
"}"
"[+SEE ALSO?\bchmod\b(1), \bumask\b(1)]"
;

View file

@ -109,7 +109,7 @@ b_mktemp(int argc, char** argv, Shbltin_t* context)
continue;
case 'R':
if (!pathtemp(NiL, 0, opt_info.arg, "/seed", NiL))
error(2, "%s: regression test initializtion failed", opt_info.arg);
error(2, "%s: regression test initialization failed", opt_info.arg);
continue;
case ':':
error(2, "%s", opt_info.arg);

View file

@ -213,7 +213,7 @@ b_paste(int argc, char** argv, Shbltin_t* context)
delim[1] = 0;
}
if (!(delim = strdup(delim)))
error(ERROR_system(1), "out of space");
error(ERROR_system(1), "out of memory");
dlen = dsiz = stresc(delim);
mp = 0;
if (mbwide())
@ -231,7 +231,7 @@ b_paste(int argc, char** argv, Shbltin_t* context)
if (!(mp = newof(0, Delim_t, dlen, 0)))
{
free(delim);
error(ERROR_system(1), "out of space");
error(ERROR_system(1), "out of memory");
}
cp = delim;
dlen = 0;
@ -254,7 +254,7 @@ b_paste(int argc, char** argv, Shbltin_t* context)
if(!sflag)
{
if (!(streams = (Sfio_t**)stakalloc(n*sizeof(Sfio_t*))))
error(ERROR_exit(1), "out of space");
error(ERROR_exit(1), "out of memory");
n = 0;
}
do

View file

@ -76,7 +76,7 @@ static int rev_char(Sfio_t *in, Sfio_t *out)
w = roundof(n + 1, 1024);
if (!(wp = newof(wp, wchar_t, w, 0)))
{
error(ERROR_SYSTEM|2, "out of space");
error(ERROR_SYSTEM|2, "out of memory");
return 0;
}
}

View file

@ -123,4 +123,3 @@ b_rmdir(int argc, char** argv, Shbltin_t* context)
}
return(error_info.errors != 0);
}

View file

@ -611,7 +611,7 @@ b_tail(int argc, char** argv, Shbltin_t* context)
if (flags & FOLLOW)
{
if (!(fp = (Tail_t*)stakalloc(argc * sizeof(Tail_t))))
error(ERROR_system(1), "out of space");
error(ERROR_system(1), "out of memory");
files = 0;
s = *argv;
do

View file

@ -193,7 +193,7 @@ b_tee(int argc, register char** argv, Shbltin_t* context)
}
}
else
error(ERROR_exit(0), "out of space");
error(ERROR_exit(0), "out of memory");
}
if ((sfmove(sfstdin, sfstdout, SF_UNBOUND, -1) < 0 || !sfeof(sfstdin)) && !ERROR_PIPE(errno) && errno != EINTR)
error(ERROR_system(0), "read error");

View file

@ -339,4 +339,3 @@ b_uniq(int argc, char** argv, Shbltin_t* context)
sfclose(fpout);
return(error_info.errors);
}

View file

@ -53,7 +53,7 @@ static const char usage[] =
"[L:longest-line|max-line-length?List the longest line length; the newline,"
"if any, is not counted in the length.]"
"[N!:utf8?For \bUTF-8\b locales \b--noutf8\b disables \bUTF-8\b "
"optimzations and relies on the native \bmbtowc\b(3).]"
"optimizations and relies on the native \bmbtowc\b(3).]"
"\n"
"\n[file ...]\n"
"\n"

View file

@ -512,4 +512,3 @@ int wc_count(Wc_t *wp, Sfio_t *fd, const char* file)
wp->lines = nlines;
return 0;
}

View file

@ -215,7 +215,7 @@ static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2010-10-20 $\0\
char *loc;
/* the symbol name representation is a nuisance since
* 8 character names appear in l_name but may
* not be null terminated. This code works around
* not be null-terminated. This code works around
* that by brute force
*/
if (ldsym->l_zeroes)
@ -335,7 +335,7 @@ static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2010-10-20 $\0\
static const char e_cover[] = T("cannot access covered library");
static const char e_handle[] = T("invalid handle");
static const char e_space[] = T("out of space");
static const char e_nomemory[] = T("out of memory");
static const char e_static[] = T("image statically linked");
static const char e_undefined[] = T("undefined symbol");
@ -382,7 +382,7 @@ static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2010-10-20 $\0\
dll = &global;
else if (!(dll = newof(0, Dll_t, 1, strlen(path))))
{
dlmessage = e_space;
dlmessage = e_nomemory;
return 0;
}
else

View file

@ -80,7 +80,7 @@ dllopen(const char* name, int mode)
#else
/*
* dlopen() wrapper -- waiting for prestidigitaions
* dlopen() wrapper -- waiting for prestidigitations
*/
void*

View file

@ -40,7 +40,7 @@
* ASSERT NOTE:
* Some sanity checking code is included using assert(). On my FreeBSD
* system, this additional code can be removed by compiling with NDEBUG
* defined. Check your own systems manpage on assert() to see how to
* defined. Check your own systems man page on assert() to see how to
* compile WITHOUT the sanity checking code on your system.
*
* UNROLLED TRANSFORM LOOP NOTE:
@ -118,7 +118,7 @@ typedef uint64_t sha2_word64; /* Exactly 8 bytes */
* Define the following sha2_* types to types of the correct length on
* the native architecture. Most BSD systems and Linux define u_intXX_t
* types. Machines with very recent ANSI C headers, can use the
* uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H
* uintXX_t definitions from inttypes.h by defining SHA2_USE_INTTYPES_H
* during compile or in the sha.h header file.
*
* Machines that support neither u_intXX_t nor inttypes.h's uintXX_t