Remove trailing whitespace.

Reviewed by:	phk
This commit is contained in:
Rodney W. Grimes 1995-05-30 00:07:29 +00:00
parent 236bb30377
commit 2162b2d226
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8855
66 changed files with 320 additions and 320 deletions

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: cp.c,v 1.4 1995/01/25 07:31:01 davidg Exp $ * $Id: cp.c,v 1.5 1995/04/02 00:49:16 bde Exp $
*/ */
#ifndef lint #ifndef lint
@ -48,11 +48,11 @@ static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
/* /*
* Cp copies source files to target files. * Cp copies source files to target files.
* *
* The global PATH_T structure "to" always contains the path to the * The global PATH_T structure "to" always contains the path to the
* current target file. Since fts(3) does not change directories, * current target file. Since fts(3) does not change directories,
* this path can be either absolute or dot-realative. * this path can be either absolute or dot-realative.
* *
* The basic algorithm is to initialize "to" and use fts(3) to traverse * The basic algorithm is to initialize "to" and use fts(3) to traverse
* the file hierarchy rooted in the argument list. A trivial case is the * the file hierarchy rooted in the argument list. A trivial case is the
* case of 'cp file1 file2'. The more interesting case is the case of * case of 'cp file1 file2'. The more interesting case is the case of
@ -105,7 +105,7 @@ main(argc, argv)
char *target; char *target;
Hflag = Lflag = Pflag = Rflag = 0; Hflag = Lflag = Pflag = Rflag = 0;
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF) while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
switch (ch) { switch (ch) {
case 'H': case 'H':
Hflag = 1; Hflag = 1;
@ -188,8 +188,8 @@ main(argc, argv)
to.target_end = to.p_end; to.target_end = to.p_end;
/* Set end of argument list for fts(3). */ /* Set end of argument list for fts(3). */
argv[argc] = NULL; argv[argc] = NULL;
/* /*
* Cp has two distinct cases: * Cp has two distinct cases:
* *
@ -210,7 +210,7 @@ main(argc, argv)
if (r == -1 || !S_ISDIR(to_stat.st_mode)) { if (r == -1 || !S_ISDIR(to_stat.st_mode)) {
/* /*
* Case (1). Target is not a directory. * Case (1). Target is not a directory.
*/ */
if (argc > 1) { if (argc > 1) {
usage(); usage();
exit(1); exit(1);
@ -227,7 +227,7 @@ main(argc, argv)
stat(*argv, &tmp_stat); stat(*argv, &tmp_stat);
else else
lstat(*argv, &tmp_stat); lstat(*argv, &tmp_stat);
if (S_ISDIR(tmp_stat.st_mode) && (Rflag || rflag)) if (S_ISDIR(tmp_stat.st_mode) && (Rflag || rflag))
type = DIR_TO_DNE; type = DIR_TO_DNE;
else else
@ -274,8 +274,8 @@ copy(argv, type, fts_options)
} }
/* /*
* If we are in case (2) or (3) above, we need to append the * If we are in case (2) or (3) above, we need to append the
* source name to the target name. * source name to the target name.
*/ */
if (type != FILE_TO_FILE) { if (type != FILE_TO_FILE) {
/* /*
@ -300,10 +300,10 @@ copy(argv, type, fts_options)
if (curr->fts_level == FTS_ROOTLEVEL) if (curr->fts_level == FTS_ROOTLEVEL)
if (type != DIR_TO_DNE) { if (type != DIR_TO_DNE) {
p = strrchr(curr->fts_path, '/'); p = strrchr(curr->fts_path, '/');
base = (p == NULL) ? 0 : base = (p == NULL) ? 0 :
(int)(p - curr->fts_path + 1); (int)(p - curr->fts_path + 1);
if (!strcmp(&curr->fts_path[base], if (!strcmp(&curr->fts_path[base],
"..")) ".."))
base += 1; base += 1;
} else } else
@ -316,7 +316,7 @@ copy(argv, type, fts_options)
*target_mid++ = '/'; *target_mid++ = '/';
*target_mid = 0; *target_mid = 0;
if (target_mid - to.p_path + nlen > MAXPATHLEN) { if (target_mid - to.p_path + nlen > MAXPATHLEN) {
warnx("%s%s: name too long (not copied)", warnx("%s%s: name too long (not copied)",
to.p_path, p); to.p_path, p);
rval = 1; rval = 1;
continue; continue;
@ -365,7 +365,7 @@ copy(argv, type, fts_options)
* umask blocks owner writes, we fail.. * umask blocks owner writes, we fail..
*/ */
if (dne) { if (dne) {
if (mkdir(to.p_path, if (mkdir(to.p_path,
curr->fts_statp->st_mode | S_IRWXU) < 0) curr->fts_statp->st_mode | S_IRWXU) < 0)
err(1, "%s", to.p_path); err(1, "%s", to.p_path);
} else if (!S_ISDIR(to_stat.st_mode)) { } else if (!S_ISDIR(to_stat.st_mode)) {
@ -374,14 +374,14 @@ copy(argv, type, fts_options)
} }
/* /*
* If not -p and directory didn't exist, set it to be * If not -p and directory didn't exist, set it to be
* the same as the from directory, umodified by the * the same as the from directory, umodified by the
* umask; arguably wrong, but it's been that way * umask; arguably wrong, but it's been that way
* forever. * forever.
*/ */
if (pflag && setfile(curr->fts_statp, 0)) if (pflag && setfile(curr->fts_statp, 0))
rval = 1; rval = 1;
else if (dne) else if (dne)
(void)chmod(to.p_path, (void)chmod(to.p_path,
curr->fts_statp->st_mode); curr->fts_statp->st_mode);
break; break;
case S_IFBLK: case S_IFBLK:

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: utils.c,v 1.2 1994/09/24 02:53:42 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -64,7 +64,7 @@ copy_file(entp, dne)
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
char *p; char *p;
#endif #endif
if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) { if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {
warn("%s", entp->fts_path); warn("%s", entp->fts_path);
return (1); return (1);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: alloc.c,v 1.2 1994/09/24 02:53:45 davidg Exp $ * $Id: alloc.c,v 1.3 1995/03/19 13:28:10 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -122,6 +122,6 @@ showall(v, t)
{ {
memtop = (char *) sbrk(0); memtop = (char *) sbrk(0);
(void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%ld).\n", (void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%ld).\n",
(unsigned long) membot, (unsigned long) memtop, (unsigned long) membot, (unsigned long) memtop,
(unsigned long) (memtop - membot)); (unsigned long) (memtop - membot));
} }

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: const.c,v 1.2 1994/09/24 02:53:48 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -72,7 +72,7 @@ Char STRcent2[] = { '%', '%', '\0' };
Char STRcenthash[] = { '%', '#', '\0' }; Char STRcenthash[] = { '%', '#', '\0' };
Char STRcentplus[] = { '%', '+', '\0' }; Char STRcentplus[] = { '%', '+', '\0' };
Char STRcentminus[] = { '%', '-', '\0' }; Char STRcentminus[] = { '%', '-', '\0' };
Char STRchase_symlinks[] = { 'c', 'h', 'a', 's', 'e', '_', 's', 'y', 'm', 'l', Char STRchase_symlinks[] = { 'c', 'h', 'a', 's', 'e', '_', 's', 'y', 'm', 'l',
'i', 'n', 'k', 's', '\0' }; 'i', 'n', 'k', 's', '\0' };
Char STRchild[] = { 'c', 'h', 'i', 'l', 'd', '\0' }; Char STRchild[] = { 'c', 'h', 'i', 'l', 'd', '\0' };
Char STRcolon[] = { ':', '\0' }; Char STRcolon[] = { ':', '\0' };
@ -90,7 +90,7 @@ Char STRfignore[] = { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
Char STRfilec[] = { 'f', 'i', 'l', 'e', 'c', '\0' }; Char STRfilec[] = { 'f', 'i', 'l', 'e', 'c', '\0' };
#endif /* FILEC */ #endif /* FILEC */
Char STRhistchars[] = { 'h', 'i', 's', 't', 'c', 'h', 'a', 'r', 's', '\0' }; Char STRhistchars[] = { 'h', 'i', 's', 't', 'c', 'h', 'a', 'r', 's', '\0' };
Char STRtildothist[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r', Char STRtildothist[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r',
'y', '\0' }; 'y', '\0' };
Char STRhistfile[] = { 'h', 'i', 's', 't', 'f', 'i', 'l', 'e', '\0' }; Char STRhistfile[] = { 'h', 'i', 's', 't', 'f', 'i', 'l', 'e', '\0' };
Char STRhistory[] = { 'h', 'i', 's', 't', 'o', 'r', 'y', '\0' }; Char STRhistory[] = { 'h', 'i', 's', 't', 'o', 'r', 'y', '\0' };
@ -109,7 +109,7 @@ Char STRml[] = { '-', 'l', '\0' };
Char STRmn[] = { '-', 'n', '\0' }; Char STRmn[] = { '-', 'n', '\0' };
Char STRmquestion[] = { '?' | QUOTE, ' ', '\0' }; Char STRmquestion[] = { '?' | QUOTE, ' ', '\0' };
Char STRnice[] = { 'n', 'i', 'c', 'e', '\0' }; Char STRnice[] = { 'n', 'i', 'c', 'e', '\0' };
Char STRnoambiguous[] = { 'n', 'o', 'a', 'm', 'b', 'i', 'g', 'u', 'o', 'u', Char STRnoambiguous[] = { 'n', 'o', 'a', 'm', 'b', 'i', 'g', 'u', 'o', 'u',
's', '\0' }; 's', '\0' };
Char STRnobeep[] = { 'n', 'o', 'b', 'e', 'e', 'p', '\0' }; Char STRnobeep[] = { 'n', 'o', 'b', 'e', 'e', 'p', '\0' };
Char STRnoclobber[] = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' }; Char STRnoclobber[] = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
@ -121,7 +121,7 @@ Char STRnotify[] = { 'n', 'o', 't', 'i', 'f', 'y', '\0' };
Char STRor[] = { '|', '\0' }; Char STRor[] = { '|', '\0' };
Char STRor2[] = { '|', '|', '\0' }; Char STRor2[] = { '|', '|', '\0' };
Char STRpath[] = { 'p', 'a', 't', 'h', '\0' }; Char STRpath[] = { 'p', 'a', 't', 'h', '\0' };
Char STRprintexitvalue[] = { 'p', 'r', 'i', 'n', 't', 'e', 'x', 'i', 't', 'v', Char STRprintexitvalue[] = { 'p', 'r', 'i', 'n', 't', 'e', 'x', 'i', 't', 'v',
'a', 'l', 'u', 'e', '\0' }; 'a', 'l', 'u', 'e', '\0' };
Char STRprompt[] = { 'p', 'r', 'o', 'm', 'p', 't', '\0' }; Char STRprompt[] = { 'p', 'r', 'o', 'm', 'p', 't', '\0' };
Char STRprompt2[] = { 'p', 'r', 'o', 'm', 'p', 't', '2', '\0' }; Char STRprompt2[] = { 'p', 'r', 'o', 'm', 'p', 't', '2', '\0' };

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: csh.c,v 1.2 1994/09/24 02:53:51 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -618,7 +618,7 @@ importpath(cp)
for (;;) { for (;;) {
if ((c = *dp) == ':' || c == 0) { if ((c = *dp) == ':' || c == 0) {
*dp = 0; *dp = 0;
if ((*cp != '/' || *cp == '\0') && (euid == 0 || uid == 0)) if ((*cp != '/' || *cp == '\0') && (euid == 0 || uid == 0))
(void) fprintf(csherr, (void) fprintf(csherr,
"Warning: imported path contains relative components\n"); "Warning: imported path contains relative components\n");
pv[i++] = Strsave(*cp ? cp : STRdot); pv[i++] = Strsave(*cp ? cp : STRdot);
@ -809,7 +809,7 @@ rechist()
(void) Strcat(buf, STRsldthist); (void) Strcat(buf, STRsldthist);
} }
if ((fp = creat(short2str(hfile), 0600)) == -1) if ((fp = creat(short2str(hfile), 0600)) == -1)
return; return;
oldidfds = didfds; oldidfds = didfds;
@ -873,14 +873,14 @@ int sig;
/* /*
* We kill the last foreground process group. It then becomes * We kill the last foreground process group. It then becomes
* responsible to propagate the SIGHUP to its progeny. * responsible to propagate the SIGHUP to its progeny.
*/ */
{ {
struct process *pp, *np; struct process *pp, *np;
for (pp = proclist.p_next; pp; pp = pp->p_next) { for (pp = proclist.p_next; pp; pp = pp->p_next) {
np = pp; np = pp;
/* /*
* Find if this job is in the foreground. It could be that * Find if this job is in the foreground. It could be that
* the process leader has exited and the foreground flag * the process leader has exited and the foreground flag
* is cleared for it. * is cleared for it.
@ -888,7 +888,7 @@ int sig;
do do
/* /*
* If a process is in the foreground; we try to kill * If a process is in the foreground; we try to kill
* it's process group. If we succeed, then the * it's process group. If we succeed, then the
* whole job is gone. Otherwise we keep going... * whole job is gone. Otherwise we keep going...
* But avoid sending HUP to the shell again. * But avoid sending HUP to the shell again.
*/ */
@ -1267,9 +1267,9 @@ vis_fputc(ch, fp)
{ {
char uenc[5]; /* 4 + NULL */ char uenc[5]; /* 4 + NULL */
if (ch & QUOTE) if (ch & QUOTE)
return fputc(ch & TRIM, fp); return fputc(ch & TRIM, fp);
/* /*
* XXX: When we are in AsciiOnly we want all characters >= 0200 to * XXX: When we are in AsciiOnly we want all characters >= 0200 to
* be encoded, but currently there is no way in vis to do that. * be encoded, but currently there is no way in vis to do that.
*/ */

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: dir.c,v 1.2 1994/09/24 02:53:54 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -221,7 +221,7 @@ printdirs()
} }
if (!(dirflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) && if (!(dirflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
(len = Strlen(hp), Strncmp(hp, dp->di_name, len) == 0) && (len = Strlen(hp), Strncmp(hp, dp->di_name, len) == 0) &&
(dp->di_name[len] == '\0' || dp->di_name[len] == '/')) (dp->di_name[len] == '\0' || dp->di_name[len] == '/'))
len = Strlen(s = (dp->di_name + len)) + 2; len = Strlen(s = (dp->di_name + len)) + 2;
else else
len = Strlen(s = dp->di_name) + 1; len = Strlen(s = dp->di_name) + 1;

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: dol.c,v 1.2 1994/09/24 02:53:56 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -425,7 +425,7 @@ Dgetdol()
if (dimen || bitset) if (dimen || bitset)
stderror(ERR_SYNTAX); stderror(ERR_SYNTAX);
if (backpid != 0) { if (backpid != 0) {
if (dolbang) if (dolbang)
xfree((ptr_t) dolbang); xfree((ptr_t) dolbang);
setDolp(dolbang = putn(backpid)); setDolp(dolbang = putn(backpid));
} }
@ -645,13 +645,13 @@ fixDolMod()
dolwcnt = 10000; dolwcnt = 10000;
c = DgetC(0); c = DgetC(0);
} }
if ((c == 'g' && dolmcnt != 10000) || if ((c == 'g' && dolmcnt != 10000) ||
(c == 'a' && dolwcnt != 10000)) { (c == 'a' && dolwcnt != 10000)) {
if (c == 'g') if (c == 'g')
dolmcnt = 10000; dolmcnt = 10000;
else else
dolwcnt = 10000; dolwcnt = 10000;
c = DgetC(0); c = DgetC(0);
} }
if (c == 's') { /* [eichin:19910926.0755EST] */ if (c == 's') { /* [eichin:19910926.0755EST] */
@ -659,12 +659,12 @@ fixDolMod()
int delim = DgetC(0); int delim = DgetC(0);
dolmod[dolnmod++] = c; dolmod[dolnmod++] = c;
dolmod[dolnmod++] = delim; dolmod[dolnmod++] = delim;
if (!delim || letter(delim) if (!delim || letter(delim)
|| Isdigit(delim) || any(" \t\n", delim)) { || Isdigit(delim) || any(" \t\n", delim)) {
seterror(ERR_BADSUBST); seterror(ERR_BADSUBST);
break; break;
} }
while ((c = DgetC(0)) != (-1)) { while ((c = DgetC(0)) != (-1)) {
dolmod[dolnmod++] = c; dolmod[dolnmod++] = c;
if(c == delim) delimcnt--; if(c == delim) delimcnt--;
@ -708,7 +708,7 @@ setDolp(cp)
Char *lhsub, *rhsub, *np; Char *lhsub, *rhsub, *np;
size_t lhlen = 0, rhlen = 0; size_t lhlen = 0, rhlen = 0;
int didmod = 0; int didmod = 0;
delim = dolmod[++i]; delim = dolmod[++i];
if (!delim || letter(delim) if (!delim || letter(delim)
|| Isdigit(delim) || any(" \t\n", delim)) { || Isdigit(delim) || any(" \t\n", delim)) {

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: exec.c,v 1.2 1994/09/24 02:53:59 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -50,7 +50,7 @@ static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 5/31/93";
# include <stdarg.h> # include <stdarg.h>
#else #else
# include <varargs.h> # include <varargs.h>
#endif #endif
#include "csh.h" #include "csh.h"
#include "extern.h" #include "extern.h"
@ -696,7 +696,7 @@ tellmewhat(lex)
if (eq(sp->word, str2short(bptr->bname))) { if (eq(sp->word, str2short(bptr->bname))) {
if (aliased) if (aliased)
prlex(cshout, lex); prlex(cshout, lex);
(void) fprintf(cshout, "%s: shell built-in command.\n", (void) fprintf(cshout, "%s: shell built-in command.\n",
vis_str(sp->word)); vis_str(sp->word));
sp->word = s0; /* we save and then restore this */ sp->word = s0; /* we save and then restore this */
return; return;

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: file.c,v 1.2 1994/09/24 02:54:03 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -521,7 +521,7 @@ tsearch(word, command, max_word_length)
return (numitems); return (numitems);
} }
else { /* LIST */ else { /* LIST */
qsort((ptr_t) items, numitems, sizeof(items[0]), qsort((ptr_t) items, numitems, sizeof(items[0]),
(int (*) __P((const void *, const void *))) sortscmp); (int (*) __P((const void *, const void *))) sortscmp);
print_by_column(looking_for_lognames ? NULL : tilded_dir, print_by_column(looking_for_lognames ? NULL : tilded_dir,
items, numitems); items, numitems);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: func.c,v 1.2 1994/09/24 02:54:04 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -860,12 +860,12 @@ wfree()
if (wp->w_end.type != I_SEEK && wp->w_start.type == wp->w_end.type && if (wp->w_end.type != I_SEEK && wp->w_start.type == wp->w_end.type &&
wp->w_start.type == o.type) { wp->w_start.type == o.type) {
if (wp->w_end.type == F_SEEK) { if (wp->w_end.type == F_SEEK) {
if (o.f_seek >= wp->w_start.f_seek && if (o.f_seek >= wp->w_start.f_seek &&
(wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek)) (wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek))
break; break;
} }
else { else {
if (o.a_seek >= wp->w_start.a_seek && if (o.a_seek >= wp->w_start.a_seek &&
(wp->w_end.a_seek == 0 || o.a_seek < wp->w_end.a_seek)) (wp->w_end.a_seek == 0 || o.a_seek < wp->w_end.a_seek))
break; break;
} }

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: glob.c,v 1.2 1994/09/24 02:54:05 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -574,7 +574,7 @@ tglob(t)
*/ */
if (c == '`') { if (c == '`') {
gflag |= G_CSH; gflag |= G_CSH;
while (*p && *p != '`') while (*p && *p != '`')
if (*p++ == '\\') { if (*p++ == '\\') {
if (*p) /* Quoted chars */ if (*p) /* Quoted chars */
p++; p++;
@ -806,7 +806,7 @@ pword()
pnleft = MAXPATHLEN - 4; pnleft = MAXPATHLEN - 4;
} }
int int
Gmatch(string, pattern) Gmatch(string, pattern)
Char *string, *pattern; Char *string, *pattern;
{ {
@ -829,7 +829,7 @@ Gmatch(string, pattern)
blkfree(blk); blkfree(blk);
return(gres == gpol); return(gres == gpol);
} }
static int static int
pmatch(string, pattern) pmatch(string, pattern)
@ -870,7 +870,7 @@ pmatch(string, pattern)
(*(pattern-2) & TRIM) <= stringc); (*(pattern-2) & TRIM) <= stringc);
pattern++; pattern++;
} }
else else
match = (stringc == (rangec & TRIM)); match = (stringc == (rangec & TRIM));
} }
if (rangec == 0) if (rangec == 0)

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: lex.c,v 1.2 1994/09/24 02:54:09 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -575,12 +575,12 @@ getdol()
int delimcnt = 2; int delimcnt = 2;
int delim = getC(0); int delim = getC(0);
*np++ = delim; *np++ = delim;
if (!delim || letter(delim) if (!delim || letter(delim)
|| Isdigit(delim) || any(" \t\n", delim)) { || Isdigit(delim) || any(" \t\n", delim)) {
seterror(ERR_BADSUBST); seterror(ERR_BADSUBST);
break; break;
} }
while ((c = getC(0)) != (-1)) { while ((c = getC(0)) != (-1)) {
*np++ = c; *np++ = c;
if(c == delim) delimcnt--; if(c == delim) delimcnt--;
@ -877,7 +877,7 @@ dosub(sc, en, global)
wdp = hp; wdp = hp;
while (--i >= 0) { while (--i >= 0) {
register struct wordent *new = register struct wordent *new =
(struct wordent *) xcalloc(1, sizeof *wdp); (struct wordent *) xcalloc(1, sizeof *wdp);
new->word = 0; new->word = 0;

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: parse.c,v 1.2 1994/09/24 02:54:11 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -52,19 +52,19 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93";
static void asyntax __P((struct wordent *, struct wordent *)); static void asyntax __P((struct wordent *, struct wordent *));
static void asyn0 __P((struct wordent *, struct wordent *)); static void asyn0 __P((struct wordent *, struct wordent *));
static void asyn3 __P((struct wordent *, struct wordent *)); static void asyn3 __P((struct wordent *, struct wordent *));
static struct wordent static struct wordent
*freenod __P((struct wordent *, struct wordent *)); *freenod __P((struct wordent *, struct wordent *));
static struct command static struct command
*syn0 __P((struct wordent *, struct wordent *, int)); *syn0 __P((struct wordent *, struct wordent *, int));
static struct command static struct command
*syn1 __P((struct wordent *, struct wordent *, int)); *syn1 __P((struct wordent *, struct wordent *, int));
static struct command static struct command
*syn1a __P((struct wordent *, struct wordent *, int)); *syn1a __P((struct wordent *, struct wordent *, int));
static struct command static struct command
*syn1b __P((struct wordent *, struct wordent *, int)); *syn1b __P((struct wordent *, struct wordent *, int));
static struct command static struct command
*syn2 __P((struct wordent *, struct wordent *, int)); *syn2 __P((struct wordent *, struct wordent *, int));
static struct command static struct command
*syn3 __P((struct wordent *, struct wordent *, int)); *syn3 __P((struct wordent *, struct wordent *, int));
#define ALEFT 21 /* max of 20 alias expansions */ #define ALEFT 21 /* max of 20 alias expansions */

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: sem.c,v 1.2 1994/09/24 02:54:15 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -438,7 +438,7 @@ execute(t, wanttty, pipein, pipeout)
} }
/* /*
* Fall through for all breaks from switch * Fall through for all breaks from switch
* *
* If there will be no more executions of this command, flush all file * If there will be no more executions of this command, flush all file
* descriptors. Places that turn on the F_REPEAT bit are responsible for * descriptors. Places that turn on the F_REPEAT bit are responsible for
* doing donefds after the last re-execution * doing donefds after the last re-execution
@ -476,7 +476,7 @@ int i;
* *
* I don't know what is best to do. I think that Ambiguous is better * I don't know what is best to do. I think that Ambiguous is better
* than restructuring the command vector, because the user can get * than restructuring the command vector, because the user can get
* unexpected results. In any case, the command vector restructuring * unexpected results. In any case, the command vector restructuring
* code is present and the user can choose it by setting noambiguous * code is present and the user can choose it by setting noambiguous
*/ */
static Char * static Char *

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: set.c,v 1.2 1994/09/24 02:54:16 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -664,7 +664,7 @@ exportpath(val)
"Warning: ridiculously long PATH truncated\n"); "Warning: ridiculously long PATH truncated\n");
break; break;
} }
if ((**val != '/' || **val == '\0') && (euid == 0 || uid == 0)) if ((**val != '/' || **val == '\0') && (euid == 0 || uid == 0))
(void) fprintf(csherr, (void) fprintf(csherr,
"Warning: exported path contains relative components.\n"); "Warning: exported path contains relative components.\n");
(void) Strcat(exppath, *val++); (void) Strcat(exppath, *val++);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: str.c,v 1.2 1994/09/24 02:54:18 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -449,21 +449,21 @@ vis_str(cp)
if (cp == NULL) if (cp == NULL)
return (NULL); return (NULL);
for (dp = cp; *dp++;) for (dp = cp; *dp++;)
continue; continue;
n = ((dp - cp) << 2) + 1; /* 4 times + NULL */ n = ((dp - cp) << 2) + 1; /* 4 times + NULL */
if (dstsize < n) { if (dstsize < n) {
sdst = (char *) (dstsize ? sdst = (char *) (dstsize ?
xrealloc(sdst, (size_t) n * sizeof(char)) : xrealloc(sdst, (size_t) n * sizeof(char)) :
xmalloc((size_t) n * sizeof(char))); xmalloc((size_t) n * sizeof(char)));
dstsize = n; dstsize = n;
} }
/* /*
* XXX: When we are in AsciiOnly we want all characters >= 0200 to * XXX: When we are in AsciiOnly we want all characters >= 0200 to
* be encoded, but currently there is no way in vis to do that. * be encoded, but currently there is no way in vis to do that.
*/ */
(void) strvis(sdst, short2str(cp), VIS_NOSLASH); (void) strvis(sdst, short2str(cp), VIS_NOSLASH);
return (sdst); return (sdst);
} }

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: time.c,v 1.3 1995/02/16 09:17:27 jkh Exp $ * $Id: time.c,v 1.4 1995/03/19 13:28:12 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -180,7 +180,7 @@ prusage(r0, r1, e, b)
break; break;
case 'X': /* (average) shared text size */ case 'X': /* (average) shared text size */
(void) fprintf(cshout, "%ld", t == 0 ? 0L : (void) fprintf(cshout, "%ld", t == 0 ? 0L :
(r1->ru_ixrss - r0->ru_ixrss) / t); (r1->ru_ixrss - r0->ru_ixrss) / t);
break; break;

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: netdate.c,v 1.2 1994/09/24 02:54:38 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -169,7 +169,7 @@ netsettime(tval)
(void)close(s); (void)close(s);
return (0); return (0);
default: default:
warnx("wrong ack received from timed: %s", warnx("wrong ack received from timed: %s",
tsptype[msg.tsp_type]); tsptype[msg.tsp_type]);
timed_ack = -1; timed_ack = -1;
break; break;

View File

@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: df.c,v 1.5 1994/09/24 02:55:11 davidg Exp $ * $Id: df.c,v 1.6 1995/03/19 13:28:15 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -99,7 +99,7 @@ struct typetab {
{"misc", MT(MOUNT_LOFS)|MT(MOUNT_FDESC)|MT(MOUNT_PORTAL)| {"misc", MT(MOUNT_LOFS)|MT(MOUNT_FDESC)|MT(MOUNT_PORTAL)|
MT(MOUNT_KERNFS)|MT(MOUNT_PROCFS)}, MT(MOUNT_KERNFS)|MT(MOUNT_PROCFS)},
{NULL, 0} {NULL, 0}
}; };
long addtype __P((long, char *)); long addtype __P((long, char *));
@ -336,7 +336,7 @@ prtstat(sfsp, maxwidth)
used = inodes - sfsp->f_ffree; used = inodes - sfsp->f_ffree;
(void)printf(" %7ld %7ld %5.0f%% ", used, sfsp->f_ffree, (void)printf(" %7ld %7ld %5.0f%% ", used, sfsp->f_ffree,
inodes == 0 ? 100.0 : (double)used / (double)inodes * 100.0); inodes == 0 ? 100.0 : (double)used / (double)inodes * 100.0);
} else } else
(void)printf(" "); (void)printf(" ");
(void)printf(" %s\n", sfsp->f_mntonname); (void)printf(" %s\n", sfsp->f_mntonname);
} }
@ -424,7 +424,7 @@ bread(off, buf, cnt)
void void
usage() usage()
{ {
fprintf(stderr, fprintf(stderr,
"usage: df [-ikn] [-t fstype] [file | file_system ...]\n"); "usage: df [-ikn] [-t fstype] [file | file_system ...]\n");
exit(1); exit(1);
} }

View File

@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: buf.c,v 1.6 1994/09/24 02:55:22 davidg Exp $
*/ */
#ifndef lint #ifndef lint
static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp"; static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
@ -253,7 +253,7 @@ init_buffers()
{ {
int i = 0; int i = 0;
/* Read stdin one character at a time to avoid i/o contention /* Read stdin one character at a time to avoid i/o contention
with shell escapes invoked by nonterminal input, e.g., with shell escapes invoked by nonterminal input, e.g.,
ed - <<EOF ed - <<EOF
!cat !cat

View File

@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: glbl.c,v 1.2 1994/09/24 02:55:26 davidg Exp $ * $Id: glbl.c,v 1.3 1995/03/19 13:28:27 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -158,7 +158,7 @@ set_active_node(lp)
#if defined(sun) || defined(NO_REALLOC_NULL) #if defined(sun) || defined(NO_REALLOC_NULL)
if (active_list != NULL) { if (active_list != NULL) {
#endif #endif
if ((ts = (line_t **) realloc(active_list, if ((ts = (line_t **) realloc(active_list,
(ti += MINBUFSZ) * sizeof(line_t **))) == NULL) { (ti += MINBUFSZ) * sizeof(line_t **))) == NULL) {
fprintf(stderr, "%s\n", strerror(errno)); fprintf(stderr, "%s\n", strerror(errno));
sprintf(errmsg, "out of memory"); sprintf(errmsg, "out of memory");
@ -167,7 +167,7 @@ set_active_node(lp)
} }
#if defined(sun) || defined(NO_REALLOC_NULL) #if defined(sun) || defined(NO_REALLOC_NULL)
} else { } else {
if ((ts = (line_t **) malloc((ti += MINBUFSZ) * if ((ts = (line_t **) malloc((ti += MINBUFSZ) *
sizeof(line_t **))) == NULL) { sizeof(line_t **))) == NULL) {
fprintf(stderr, "%s\n", strerror(errno)); fprintf(stderr, "%s\n", strerror(errno));
sprintf(errmsg, "out of memory"); sprintf(errmsg, "out of memory");

View File

@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: main.c,v 1.3 1994/09/24 02:55:28 davidg Exp $ * $Id: main.c,v 1.4 1995/03/19 13:28:34 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -42,7 +42,7 @@ static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
* CREDITS * CREDITS
* *
* This program is based on the editor algorithm described in * This program is based on the editor algorithm described in
* Brian W. Kernighan and P. J. Plauger's book "Software Tools * Brian W. Kernighan and P. J. Plauger's book "Software Tools
* in Pascal," Addison-Wesley, 1981. * in Pascal," Addison-Wesley, 1981.
* *
* The buffering algorithm is attributed to Rodney Ruddock of * The buffering algorithm is attributed to Rodney Ruddock of
@ -192,7 +192,7 @@ main(argc, argv)
fputs("?\n", stderr); fputs("?\n", stderr);
sprintf(errmsg, "warning: file modified"); sprintf(errmsg, "warning: file modified");
if (!isatty(0)) { if (!isatty(0)) {
fprintf(stderr, garrulous ? fprintf(stderr, garrulous ?
"script, line %d: %s\n" : "script, line %d: %s\n" :
"", lineno, errmsg); "", lineno, errmsg);
quit(2); quit(2);
@ -213,7 +213,7 @@ main(argc, argv)
isglobal = 0; isglobal = 0;
if ((status = extract_addr_range()) >= 0 && if ((status = extract_addr_range()) >= 0 &&
(status = exec_command()) >= 0) (status = exec_command()) >= 0)
if (!status || if (!status ||
(status = display_lines(current_addr, current_addr, (status = display_lines(current_addr, current_addr,
status)) >= 0) status)) >= 0)
continue; continue;
@ -225,16 +225,16 @@ main(argc, argv)
fputs("?\n", stderr); /* give warning */ fputs("?\n", stderr); /* give warning */
sprintf(errmsg, "warning: file modified"); sprintf(errmsg, "warning: file modified");
if (!isatty(0)) { if (!isatty(0)) {
fprintf(stderr, garrulous ? fprintf(stderr, garrulous ?
"script, line %d: %s\n" : "script, line %d: %s\n" :
"", lineno, errmsg); "", lineno, errmsg);
quit(2); quit(2);
} }
break; break;
case FATAL: case FATAL:
if (!isatty(0)) if (!isatty(0))
fprintf(stderr, garrulous ? fprintf(stderr, garrulous ?
"script, line %d: %s\n" : "", "script, line %d: %s\n" : "",
lineno, errmsg); lineno, errmsg);
else else
fprintf(stderr, garrulous ? "%s\n" : "", fprintf(stderr, garrulous ? "%s\n" : "",
@ -243,7 +243,7 @@ main(argc, argv)
default: default:
fputs("?\n", stderr); fputs("?\n", stderr);
if (!isatty(0)) { if (!isatty(0)) {
fprintf(stderr, garrulous ? fprintf(stderr, garrulous ?
"script, line %d: %s\n" : "", "script, line %d: %s\n" : "",
lineno, errmsg); lineno, errmsg);
quit(2); quit(2);
@ -256,7 +256,7 @@ main(argc, argv)
long first_addr, second_addr, addr_cnt; long first_addr, second_addr, addr_cnt;
/* extract_addr_range: get line addresses from the command buffer until an /* extract_addr_range: get line addresses from the command buffer until an
illegal address is seen; return status */ illegal address is seen; return status */
int int
extract_addr_range() extract_addr_range()
@ -548,7 +548,7 @@ exec_command()
GET_COMMAND_SUFFIX(); GET_COMMAND_SUFFIX();
isglobal++; isglobal++;
if (exec_global(n, gflag) < 0) if (exec_global(n, gflag) < 0)
return ERR; return ERR;
break; break;
case 'h': case 'h':
if (addr_cnt > 0) { if (addr_cnt > 0) {
@ -691,7 +691,7 @@ exec_command()
sflags |= SGR; sflags |= SGR;
ibufp++; ibufp++;
break; break;
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': case '5': case '6': case '7': case '8': case '9':
STRTOL(sgnum, ibufp); STRTOL(sgnum, ibufp);
sflags |= SGF; sflags |= SGF;
@ -802,7 +802,7 @@ exec_command()
return ERR; return ERR;
} }
#endif #endif
if ((addr = write_file(*fnp ? fnp : old_filename, if ((addr = write_file(*fnp ? fnp : old_filename,
(c == 'W') ? "a" : "w", first_addr, second_addr)) < 0) (c == 'W') ? "a" : "w", first_addr, second_addr)) < 0)
return ERR; return ERR;
else if (addr == addr_last) else if (addr == addr_last)
@ -888,7 +888,7 @@ check_addr_range(n, m)
} }
/* get_matching_node_addr: return the address of the next line matching a /* get_matching_node_addr: return the address of the next line matching a
pattern in a given direction. wrap around begin/end of editor buffer if pattern in a given direction. wrap around begin/end of editor buffer if
necessary */ necessary */
long long
@ -1148,7 +1148,7 @@ move_lines(addr)
REQUE(b2, b1->q_forw); REQUE(b2, b1->q_forw);
REQUE(a1->q_back, a2); REQUE(a1->q_back, a2);
REQUE(b1, a1); REQUE(b1, a1);
current_addr = addr + ((addr < first_addr) ? current_addr = addr + ((addr < first_addr) ?
second_addr - first_addr + 1 : 0); second_addr - first_addr + 1 : 0);
} }
if (isglobal) if (isglobal)

View File

@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: re.c,v 1.8 1994/09/24 02:55:29 davidg Exp $ * $Id: re.c,v 1.9 1995/03/19 13:28:36 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -39,7 +39,7 @@ extern int patlock;
char errmsg[MAXPATHLEN + 40] = ""; char errmsg[MAXPATHLEN + 40] = "";
/* get_compiled_pattern: return pointer to compiled pattern from command /* get_compiled_pattern: return pointer to compiled pattern from command
buffer */ buffer */
pattern_t * pattern_t *
get_compiled_pattern() get_compiled_pattern()

View File

@ -1,4 +1,4 @@
/* sub.c: This file contains the substitution routines for the ed /* sub.c: This file contains the substitution routines for the ed
line editor */ line editor */
/*- /*-
* Copyright (c) 1993 Andrew Moore, Talke Studio. * Copyright (c) 1993 Andrew Moore, Talke Studio.
@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: sub.c,v 1.4 1995/01/14 11:47:16 alm Exp $ * $Id: sub.c,v 1.5 1995/03/19 13:28:38 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -188,7 +188,7 @@ substitute_matching_text(pat, lp, gflag, kth)
if ((txt = get_sbuf_line(lp)) == NULL) if ((txt = get_sbuf_line(lp)) == NULL)
return ERR; return ERR;
if (isbinary) if (isbinary)
NUL_TO_NEWLINE(txt, lp->len); NUL_TO_NEWLINE(txt, lp->len);
eot = txt + lp->len; eot = txt + lp->len;
if (!regexec(pat, txt, SE_MAX, rm, 0)) { if (!regexec(pat, txt, SE_MAX, rm, 0)) {
@ -213,7 +213,7 @@ substitute_matching_text(pat, lp, gflag, kth)
off += i; off += i;
} }
txt += rm[0].rm_eo; txt += rm[0].rm_eo;
} while (*txt && } while (*txt &&
(!changed || ((gflag & GSG) && rm[0].rm_eo)) && (!changed || ((gflag & GSG) && rm[0].rm_eo)) &&
!regexec(pat, txt, SE_MAX, rm, REG_NOTBOL)); !regexec(pat, txt, SE_MAX, rm, REG_NOTBOL));
i = eot - txt; i = eot - txt;

View File

@ -1,8 +1,8 @@
# /b/source/CVS/src/bin/expr/Makefile,v 1.5 1993/06/14 19:56:06 jtc Exp # /b/source/CVS/src/bin/expr/Makefile,v 1.5 1993/06/14 19:56:06 jtc Exp
# $Id$ # $Id: Makefile,v 1.6 1994/09/24 02:55:36 davidg Exp $
PROG= expr PROG= expr
SRCS= expr.c SRCS= expr.c
CLEANFILES+= expr.c y.tab.h CLEANFILES+= expr.c y.tab.h
expr.c: expr.c:

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: print.c,v 1.2 1994/09/24 02:55:56 davidg Exp $ * $Id: print.c,v 1.3 1995/03/19 13:28:46 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -283,7 +283,7 @@ printlink(p)
if (p->fts_level == FTS_ROOTLEVEL) if (p->fts_level == FTS_ROOTLEVEL)
(void)snprintf(name, sizeof(name), "%s", p->fts_name); (void)snprintf(name, sizeof(name), "%s", p->fts_name);
else else
(void)snprintf(name, sizeof(name), (void)snprintf(name, sizeof(name),
"%s/%s", p->fts_parent->fts_accpath, p->fts_name); "%s/%s", p->fts_parent->fts_accpath, p->fts_name);
if ((lnklen = readlink(name, path, sizeof(path) - 1)) == -1) { if ((lnklen = readlink(name, path, sizeof(path) - 1)) == -1) {

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: ar_io.c,v 1.2 1994/09/24 02:56:11 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -278,7 +278,7 @@ ar_open(name)
break; break;
default: default:
/* /*
* should never happen, worse case, slow... * should never happen, worse case, slow...
*/ */
blksz = rdblksz = BLKMULT; blksz = rdblksz = BLKMULT;
break; break;
@ -458,8 +458,8 @@ ar_set_wr()
* will stop us if the archive containing the trailer was not written * will stop us if the archive containing the trailer was not written
*/ */
wr_trail = 0; wr_trail = 0;
/* /*
* Add any device dependent code as required here * Add any device dependent code as required here
*/ */
if (artyp != ISREG) if (artyp != ISREG)
@ -480,7 +480,7 @@ ar_set_wr()
/* /*
* ar_app_ok() * ar_app_ok()
* check if the last volume in the archive allows appends. We cannot check * check if the last volume in the archive allows appends. We cannot check
* this until we are ready to write since there is no spec that says all * this until we are ready to write since there is no spec that says all
* volumes in a single archive have to be of the same type... * volumes in a single archive have to be of the same type...
* Return: * Return:
* 0 if we can append, -1 otherwise. * 0 if we can append, -1 otherwise.
@ -592,7 +592,7 @@ ar_read(buf, cnt)
else else
warn(0, "End of archive volume %d reached", arvol); warn(0, "End of archive volume %d reached", arvol);
return(res); return(res);
} }
/* /*
* ar_write() * ar_write()
@ -710,8 +710,8 @@ ar_write(buf, bsz)
warn(1,"Unable to append, trailer re-write failed. Quitting."); warn(1,"Unable to append, trailer re-write failed. Quitting.");
return(res); return(res);
} }
if (res == 0) if (res == 0)
warn(0, "End of archive volume %d reached", arvol); warn(0, "End of archive volume %d reached", arvol);
else if (res < 0) else if (res < 0)
syswarn(1, errno, "Failed write to archive volume: %d", arvol); syswarn(1, errno, "Failed write to archive volume: %d", arvol);
@ -791,7 +791,7 @@ ar_rdsync()
if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0) if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0)
break; break;
mpos = fsbz - (cpos % (off_t)fsbz); mpos = fsbz - (cpos % (off_t)fsbz);
if (lseek(arfd, mpos, SEEK_CUR) < 0) if (lseek(arfd, mpos, SEEK_CUR) < 0)
break; break;
lstrval = 1; lstrval = 1;
break; break;
@ -850,14 +850,14 @@ ar_fow(sksz, skipped)
* number of physical blocks to skip (we do not know physical block * number of physical blocks to skip (we do not know physical block
* size at this point), so we must only read foward on tapes! * size at this point), so we must only read foward on tapes!
*/ */
if (artyp != ISREG) if (artyp != ISREG)
return(0); return(0);
/* /*
* figure out where we are in the archive * figure out where we are in the archive
*/ */
if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) >= 0) { if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) >= 0) {
/* /*
* we can be asked to move farther than there are bytes in this * we can be asked to move farther than there are bytes in this
* volume, if so, just go to file end and let normal buf_fill() * volume, if so, just go to file end and let normal buf_fill()
* deal with the end of file (it will go to next volume by * deal with the end of file (it will go to next volume by
@ -898,7 +898,7 @@ ar_rev(sksz)
{ {
off_t cpos; off_t cpos;
struct mtop mb; struct mtop mb;
register int phyblk; register int phyblk;
/* /*
* make sure we do not have try to reverse on a flawed archive * make sure we do not have try to reverse on a flawed archive
@ -908,7 +908,7 @@ ar_rev(sksz)
switch(artyp) { switch(artyp) {
case ISPIPE: case ISPIPE:
if (sksz <= 0) if (sksz <= 0)
break; break;
/* /*
* cannot go backwards on these critters * cannot go backwards on these critters
@ -1017,7 +1017,7 @@ ar_rev(sksz)
/* /*
* get_phys() * get_phys()
* Determine the physical block size on a tape drive. We need the physical * Determine the physical block size on a tape drive. We need the physical
* block size so we know how many bytes we skip over when we move with * block size so we know how many bytes we skip over when we move with
* mtio commands. We also make sure we are BEFORE THE TAPE FILEMARK when * mtio commands. We also make sure we are BEFORE THE TAPE FILEMARK when
* return. * return.
* This is one really SLOW routine... * This is one really SLOW routine...
@ -1218,7 +1218,7 @@ ar_next()
/* /*
* we are to continue with the same device * we are to continue with the same device
*/ */
if (ar_open(arcname) >= 0) if (ar_open(arcname) >= 0)
return(0); return(0);
tty_prnt("Cannot re-open %s, try again\n", tty_prnt("Cannot re-open %s, try again\n",
arcname); arcname);

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: ar_subs.c,v 1.2 1994/09/24 02:56:12 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -449,7 +449,7 @@ wr_archive(arcn, is_app)
if ((res > 0) || (docrc && (set_crc(arcn, fd) < 0))) { if ((res > 0) || (docrc && (set_crc(arcn, fd) < 0))) {
/* /*
* unable to obtain the crc we need, close the file, * unable to obtain the crc we need, close the file,
* purge link table entry * purge link table entry
*/ */
rdfile_close(arcn, &fd); rdfile_close(arcn, &fd);
purg_lnk(arcn); purg_lnk(arcn);
@ -472,7 +472,7 @@ wr_archive(arcn, is_app)
} }
wr_one = 1; wr_one = 1;
if (res > 0) { if (res > 0) {
/* /*
* format write says no file data needs to be stored * format write says no file data needs to be stored
* so we are done messing with this file * so we are done messing with this file
*/ */
@ -535,7 +535,7 @@ wr_archive(arcn, is_app)
* is called to add the new members. * is called to add the new members.
* PAX IMPLEMENTATION DETAIL NOTE: * PAX IMPLEMENTATION DETAIL NOTE:
* -u is implemented by adding the new members to the end of the archive. * -u is implemented by adding the new members to the end of the archive.
* Care is taken so that these do not end up as links to the older * Care is taken so that these do not end up as links to the older
* version of the same file already stored in the archive. It is expected * version of the same file already stored in the archive. It is expected
* when extraction occurs these newer versions will over-write the older * when extraction occurs these newer versions will over-write the older
* ones stored "earlier" in the archive (this may be a bad assumption as * ones stored "earlier" in the archive (this may be a bad assumption as
@ -677,7 +677,7 @@ append()
(void)fputs("done.\n", stderr); (void)fputs("done.\n", stderr);
vfpart = 0; vfpart = 0;
} }
/* /*
* go to the writing phase to add the new members * go to the writing phase to add the new members
*/ */
@ -765,7 +765,7 @@ copy()
/* /*
* start up the hard link table; file traversal routines and the * start up the hard link table; file traversal routines and the
* modification time and access mode database * modification time and access mode database
*/ */
if ((lnk_start() < 0) || (ftree_start() < 0) || (dir_start() < 0)) if ((lnk_start() < 0) || (ftree_start() < 0) || (dir_start() < 0))
return; return;
@ -881,7 +881,7 @@ copy()
* try to create a hard link to the src file if requested * try to create a hard link to the src file if requested
* but make sure we are not trying to overwrite ourselves. * but make sure we are not trying to overwrite ourselves.
*/ */
if (lflag) if (lflag)
res = cross_lnk(arcn); res = cross_lnk(arcn);
else else
res = chk_same(arcn); res = chk_same(arcn);
@ -988,7 +988,7 @@ next_head(arcn)
register int hsz; register int hsz;
register int in_resync = 0; /* set when we are in resync mode */ register int in_resync = 0; /* set when we are in resync mode */
int cnt = 0; /* counter for trailer function */ int cnt = 0; /* counter for trailer function */
/* /*
* set up initial conditions, we want a whole frmt->hsz block as we * set up initial conditions, we want a whole frmt->hsz block as we
* have no data yet. * have no data yet.
@ -1132,7 +1132,7 @@ get_arc()
register int minhd = BLKMULT; register int minhd = BLKMULT;
char *hdend; char *hdend;
int notice = 0; int notice = 0;
/* /*
* find the smallest header size in all archive formats and then set up * find the smallest header size in all archive formats and then set up
* to read the archive. * to read the archive.
@ -1192,7 +1192,7 @@ get_arc()
if ((*fsub[ford[i]].id)(hdbuf, hdsz) < 0) if ((*fsub[ford[i]].id)(hdbuf, hdsz) < 0)
continue; continue;
frmt = &(fsub[ford[i]]); frmt = &(fsub[ford[i]]);
/* /*
* yuck, to avoid slow special case code in the extract * yuck, to avoid slow special case code in the extract
* routines, just push this header back as if it was * routines, just push this header back as if it was
* not seen. We have left extra space at start of the * not seen. We have left extra space at start of the

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: buf_subs.c,v 1.2 1994/09/24 02:56:13 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -101,7 +101,7 @@ wr_start()
* archive that might be hard to read elsewhere. If all ok, we then * archive that might be hard to read elsewhere. If all ok, we then
* open the first archive volume * open the first archive volume
*/ */
if (!wrblksz) if (!wrblksz)
wrblksz = frmt->bsz; wrblksz = frmt->bsz;
if (wrblksz > MAXBLK) { if (wrblksz > MAXBLK) {
warn(1, "Write block size of %d too large, maximium is: %d", warn(1, "Write block size of %d too large, maximium is: %d",
@ -115,7 +115,7 @@ wr_start()
} }
/* /*
* we only allow wrblksz to be used with all archive operations * we only allow wrblksz to be used with all archive operations
*/ */
blksz = rdblksz = wrblksz; blksz = rdblksz = wrblksz;
if ((ar_open(arcname) < 0) && (ar_next() < 0)) if ((ar_open(arcname) < 0) && (ar_next() < 0))
@ -215,7 +215,7 @@ cp_start()
* about the conditions under which they will allow a write to occur. * about the conditions under which they will allow a write to occur.
* Often devices restrict the conditions where writes can be made writes, * Often devices restrict the conditions where writes can be made writes,
* so it may not be feasable to append archives stored on all types of * so it may not be feasable to append archives stored on all types of
* devices. * devices.
* Return: * Return:
* 0 for success, -1 for failure * 0 for success, -1 for failure
*/ */
@ -313,7 +313,7 @@ appnd_start(skcnt)
warn(1, "Unable to rewrite archive trailer, cannot append."); warn(1, "Unable to rewrite archive trailer, cannot append.");
return(-1); return(-1);
} }
/* /*
* rd_sync() * rd_sync()
* A read error occurred on this archive volume. Resync the buffer and * A read error occurred on this archive volume. Resync the buffer and
@ -488,7 +488,7 @@ rd_skip(skcnt)
return(0); return(0);
} }
/* /*
* wr_fin() * wr_fin()
* flush out any data (and pad if required) the last block. We always pad * flush out any data (and pad if required) the last block. We always pad
* with zero (even though we do not have to). Padding with 0 makes it a * with zero (even though we do not have to). Padding with 0 makes it a
@ -517,7 +517,7 @@ wr_fin()
* by format specific write routines to pass a file header). On failure we * by format specific write routines to pass a file header). On failure we
* punt. We do not allow the user to continue to write flawed archives. * punt. We do not allow the user to continue to write flawed archives.
* We assume these headers are not very large (the memory copy we use is * We assume these headers are not very large (the memory copy we use is
* a bit expensive). * a bit expensive).
* Return: * Return:
* 0 if buffer was filled ok, -1 o.w. (buffer flush failure) * 0 if buffer was filled ok, -1 o.w. (buffer flush failure)
*/ */
@ -810,7 +810,7 @@ rd_wrfile(arcn, ofd, left)
/* /*
* if we failed from archive read, we do not want to skip * if we failed from archive read, we do not want to skip
*/ */
if ((size > 0L) && (*left == 0L)) if ((size > 0L) && (*left == 0L))
return(-1); return(-1);
/* /*
@ -1019,7 +1019,7 @@ buf_flush(bufcnt)
/* /*
* write a block and check if it all went out ok * write a block and check if it all went out ok
*/ */
cnt = ar_write(buf, blksz); cnt = ar_write(buf, blksz);
if (cnt == blksz) { if (cnt == blksz) {
/* /*
* the write went ok * the write went ok

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: cpio.c,v 1.2 1994/09/24 02:56:16 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -93,7 +93,7 @@ cpio_strd()
* mode; looking for a valid header), and cnt (which starts at zero) * mode; looking for a valid header), and cnt (which starts at zero)
* which is used to count the number of empty blocks we have seen so far. * which is used to count the number of empty blocks we have seen so far.
* Return: * Return:
* 0 if a valid trailer, -1 if not a valid trailer, * 0 if a valid trailer, -1 if not a valid trailer,
*/ */
#if __STDC__ #if __STDC__
@ -572,7 +572,7 @@ cpio_wr(arcn)
/* /*
* vcpio_id() * vcpio_id()
* determine if a block given to us is a valid system VR4 cpio header * determine if a block given to us is a valid system VR4 cpio header
* WITHOUT crc. WATCH it the magic cookies are in OCTAL, the header * WITHOUT crc. WATCH it the magic cookies are in OCTAL, the header
* uses HEX * uses HEX
* Return: * Return:
* 0 if a valid header, -1 otherwise * 0 if a valid header, -1 otherwise

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)cpio.h 8.1 (Berkeley) 5/31/93 * @(#)cpio.h 8.1 (Berkeley) 5/31/93
* $Id$ * $Id: cpio.h,v 1.2 1994/09/24 02:56:17 davidg Exp $
*/ */
/* /*
@ -71,7 +71,7 @@ typedef struct {
char c_mtime[11]; /* modification time */ char c_mtime[11]; /* modification time */
char c_namesize[6]; /* length of pathname */ char c_namesize[6]; /* length of pathname */
char c_filesize[11]; /* length of file in bytes */ char c_filesize[11]; /* length of file in bytes */
} HD_CPIO; } HD_CPIO;
#define MAGIC 070707 /* transportable archive id */ #define MAGIC 070707 /* transportable archive id */
@ -82,7 +82,7 @@ typedef struct {
#endif /* _PAX_ */ #endif /* _PAX_ */
/* /*
* Binary cpio header structure * Binary cpio header structure
* *
* CAUTION! CAUTION! CAUTION! * CAUTION! CAUTION! CAUTION!
* Each field really represents a 16 bit short (NOT ASCII). Described as * Each field really represents a 16 bit short (NOT ASCII). Described as
@ -102,7 +102,7 @@ typedef struct {
u_char h_namesize[2]; u_char h_namesize[2];
u_char h_filesize_1[2]; u_char h_filesize_1[2];
u_char h_filesize_2[2]; u_char h_filesize_2[2];
} HD_BCPIO; } HD_BCPIO;
#ifdef _PAX_ #ifdef _PAX_
/* /*
@ -140,7 +140,7 @@ typedef struct {
char c_rmin[8]; /* special file minor # */ char c_rmin[8]; /* special file minor # */
char c_namesize[8]; /* length of pathname */ char c_namesize[8]; /* length of pathname */
char c_chksum[8]; /* 0 OR CRC of bytes of FILE data */ char c_chksum[8]; /* 0 OR CRC of bytes of FILE data */
} HD_VCPIO; } HD_VCPIO;
#define VMAGIC 070701 /* sVr4 new portable archive id */ #define VMAGIC 070701 /* sVr4 new portable archive id */
#define VCMAGIC 070702 /* sVr4 new portable archive id CRC */ #define VCMAGIC 070702 /* sVr4 new portable archive id CRC */

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: file_subs.c,v 1.2 1994/09/24 02:56:19 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -159,7 +159,7 @@ file_close(arcn, fd)
/* /*
* set owner/groups first as this may strip off mode bits we want * set owner/groups first as this may strip off mode bits we want
* then set file permission modes. Then set file access and * then set file permission modes. Then set file access and
* modification times. * modification times.
*/ */
if (pids) if (pids)
res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid); res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid);
@ -180,7 +180,7 @@ file_close(arcn, fd)
/* /*
* lnk_creat() * lnk_creat()
* Create a hard link to arcn->ln_name from arcn->name. arcn->ln_name * Create a hard link to arcn->ln_name from arcn->name. arcn->ln_name
* must exist; * must exist;
* Return: * Return:
* 0 if ok, -1 otherwise * 0 if ok, -1 otherwise
*/ */
@ -266,7 +266,7 @@ chk_same(arcn)
{ {
struct stat sb; struct stat sb;
/* /*
* if file does not exist, return. if file exists and -k, skip it * if file does not exist, return. if file exists and -k, skip it
* quietly * quietly
*/ */
@ -570,7 +570,7 @@ unlnk_exist(name, type)
*/ */
if (rmdir(name) < 0) { if (rmdir(name) < 0) {
if (type == PAX_DIR) if (type == PAX_DIR)
return(1); return(1);
syswarn(1,errno,"Unable to remove directory %s", name); syswarn(1,errno,"Unable to remove directory %s", name);
return(-1); return(-1);
} }
@ -847,7 +847,7 @@ file_write(fd, str, cnt, rem, isempt, sz, name)
register char *end; register char *end;
register int wcnt; register int wcnt;
register char *st = str; register char *st = str;
/* /*
* while we have data to process * while we have data to process
*/ */

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: ftree.c,v 1.2 1994/09/24 02:56:20 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -214,7 +214,7 @@ ftree_sel(arcn)
* when file trees are supplied pax as args. The list is not used when * when file trees are supplied pax as args. The list is not used when
* the trees are read from stdin. * the trees are read from stdin.
*/ */
if (ftcur != NULL) if (ftcur != NULL)
ftcur->refcnt = 1; ftcur->refcnt = 1;
/* /*
@ -307,7 +307,7 @@ ftree_arg()
if (fthead == NULL) { if (fthead == NULL) {
/* /*
* the user didn't supply any args, get the file trees * the user didn't supply any args, get the file trees
* to process from stdin; * to process from stdin;
*/ */
if (fgets(farray[0], PAXPATHLEN+1, stdin) == NULL) if (fgets(farray[0], PAXPATHLEN+1, stdin) == NULL)
return(-1); return(-1);
@ -362,7 +362,7 @@ next_file(arcn)
/* /*
* ftree_sel() might have set the ftree_skip flag if the user has the * ftree_sel() might have set the ftree_skip flag if the user has the
* -n option and a file was selected from this file arg tree. (-n says * -n option and a file was selected from this file arg tree. (-n says
* only one member is matched for each pattern) ftree_skip being 1 * only one member is matched for each pattern) ftree_skip being 1
* forces us to go to the next arg now. * forces us to go to the next arg now.
*/ */
if (ftree_skip) { if (ftree_skip) {

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: gen_subs.c,v 1.2 1994/09/24 02:56:22 davidg Exp $ * $Id: gen_subs.c,v 1.3 1995/03/19 13:28:49 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -203,7 +203,7 @@ ls_tty(arcn)
/* /*
* zf_strncpy() * zf_strncpy()
* copy src to dest up to len chars (stopping at first '\0'), when src is * copy src to dest up to len chars (stopping at first '\0'), when src is
* shorter than len, pads to len with '\0'. big performance win (and * shorter than len, pads to len with '\0'. big performance win (and
* a lot easier to code) over strncpy(), then a strlen() then a * a lot easier to code) over strncpy(), then a strlen() then a
* bzero(). (or doing the bzero() first). * bzero(). (or doing the bzero() first).
*/ */
@ -335,7 +335,7 @@ ul_asc(val, str, len, base)
{ {
register char *pt; register char *pt;
u_long digit; u_long digit;
/* /*
* WARNING str is not '\0' terminated by this routine * WARNING str is not '\0' terminated by this routine
*/ */
@ -350,7 +350,7 @@ ul_asc(val, str, len, base)
while (pt >= str) { while (pt >= str) {
if ((digit = (val & 0xf)) < 10) if ((digit = (val & 0xf)) < 10)
*pt-- = '0' + (char)digit; *pt-- = '0' + (char)digit;
else else
*pt-- = 'a' + (char)(digit - 10); *pt-- = 'a' + (char)(digit - 10);
if ((val = (val >> 4)) == (u_long)0) if ((val = (val >> 4)) == (u_long)0)
break; break;
@ -449,7 +449,7 @@ uqd_asc(val, str, len, base)
{ {
register char *pt; register char *pt;
u_quad_t digit; u_quad_t digit;
/* /*
* WARNING str is not '\0' terminated by this routine * WARNING str is not '\0' terminated by this routine
*/ */
@ -464,7 +464,7 @@ uqd_asc(val, str, len, base)
while (pt >= str) { while (pt >= str) {
if ((digit = (val & 0xf)) < 10) if ((digit = (val & 0xf)) < 10)
*pt-- = '0' + (char)digit; *pt-- = '0' + (char)digit;
else else
*pt-- = 'a' + (char)(digit - 10); *pt-- = 'a' + (char)(digit - 10);
if ((val = (val >> 4)) == (u_quad_t)0) if ((val = (val >> 4)) == (u_quad_t)0)
break; break;

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: pat_rep.c,v 1.2 1994/09/24 02:56:24 davidg Exp $ * $Id: pat_rep.c,v 1.3 1995/03/19 13:28:56 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -88,7 +88,7 @@ static int resub __P((regex_t *, regmatch_t *, char *, char *, char *));
* parses the -s replacement string; compiles the regular expression * parses the -s replacement string; compiles the regular expression
* and stores the compiled value and it's replacement string together in * and stores the compiled value and it's replacement string together in
* replacement string list. Input to this function is of the form: * replacement string list. Input to this function is of the form:
* /old/new/pg * /old/new/pg
* The first char in the string specifies the delimiter used by this * The first char in the string specifies the delimiter used by this
* replacement string. "Old" is a regular expression in "ed" format which * replacement string. "Old" is a regular expression in "ed" format which
* is compiled by regcomp() and is applied to filenames. "new" is the * is compiled by regcomp() and is applied to filenames. "new" is the
@ -348,7 +348,7 @@ pat_sel(arcn)
/* /*
* we reach this point only when we allow a single selected match per * we reach this point only when we allow a single selected match per
* pattern, if the pattern matches a directory and we do not have -d * pattern, if the pattern matches a directory and we do not have -d
* (dflag) we are done with this pattern. We may also be handed a file * (dflag) we are done with this pattern. We may also be handed a file
* in the subtree of a directory. in that case when we are operating * in the subtree of a directory. in that case when we are operating
* with -d, this pattern was already selected and we are done * with -d, this pattern was already selected and we are done
@ -372,7 +372,7 @@ pat_sel(arcn)
*/ */
if (pt->pend != NULL) if (pt->pend != NULL)
*pt->pend = '\0'; *pt->pend = '\0';
if ((pt->pstr = strdup(arcn->name)) == NULL) { if ((pt->pstr = strdup(arcn->name)) == NULL) {
warn(1, "Pattern select out of memory"); warn(1, "Pattern select out of memory");
if (pt->pend != NULL) if (pt->pend != NULL)
@ -397,7 +397,7 @@ pat_sel(arcn)
if (*(pt->pstr + len) == '/') { if (*(pt->pstr + len) == '/') {
*(pt->pstr + len) = '\0'; *(pt->pstr + len) = '\0';
pt->plen = len; pt->plen = len;
} }
pt->flgs = DIR_MTCH | MTCH; pt->flgs = DIR_MTCH | MTCH;
arcn->pat = pt; arcn->pat = pt;
return(0); return(0);
@ -438,7 +438,7 @@ pat_sel(arcn)
* this archive member is "selected" we process and mark the pattern as * this archive member is "selected" we process and mark the pattern as
* one which matched a selected archive member (see pat_sel()) * one which matched a selected archive member (see pat_sel())
* Return: * Return:
* 0 if this archive member should be processed, 1 if it should be * 0 if this archive member should be processed, 1 if it should be
* skipped and -1 if we are done with all patterns (and pax should quit * skipped and -1 if we are done with all patterns (and pax should quit
* looking for more members) * looking for more members)
*/ */
@ -515,7 +515,7 @@ pat_match(arcn)
/* /*
* fn_match() * fn_match()
* Return: * Return:
* 0 if this archive member should be processed, 1 if it should be * 0 if this archive member should be processed, 1 if it should be
* skipped and -1 if we are done with all patterns (and pax should quit * skipped and -1 if we are done with all patterns (and pax should quit
* looking for more members) * looking for more members)
* Note: *pend may be changed to show where the prefix ends. * Note: *pend may be changed to show where the prefix ends.
@ -564,7 +564,7 @@ fn_match(pattern, string, pend)
case '*': case '*':
c = *pattern; c = *pattern;
/* /*
* Collapse multiple *'s. * Collapse multiple *'s.
*/ */
while (c == '*') while (c == '*')
c = *++pattern; c = *++pattern;
@ -649,7 +649,7 @@ range_match(pattern, test)
* if we spot any file links to the old file name in the future, we will * if we spot any file links to the old file name in the future, we will
* know exactly how to fix the file link. * know exactly how to fix the file link.
* Return: * Return:
* 0 continue to process file, 1 skip this file, -1 pax is finished * 0 continue to process file, 1 skip this file, -1 pax is finished
*/ */
#if __STDC__ #if __STDC__
@ -862,7 +862,7 @@ fix_path(or_name, or_len, dir_name, dir_len)
*or_len = len; *or_len = len;
/* /*
* enough space, shift * enough space, shift
*/ */
while (src >= start) while (src >= start)
*dest-- = *src--; *dest-- = *src--;
@ -1014,7 +1014,7 @@ rep_name(name, nlen, prnt)
*/ */
} while (pt->flgs & GLOB); } while (pt->flgs & GLOB);
if (found) if (found)
break; break;
/* /*
@ -1037,7 +1037,7 @@ rep_name(name, nlen, prnt)
warn(1,"Replacement name too long %s >> %s", warn(1,"Replacement name too long %s >> %s",
name, nname); name, nname);
return(1); return(1);
} }
/* /*
* inform the user of the result if wanted * inform the user of the result if wanted
@ -1046,7 +1046,7 @@ rep_name(name, nlen, prnt)
if (*nname == '\0') if (*nname == '\0')
(void)fprintf(stderr,"%s >> <empty string>\n", (void)fprintf(stderr,"%s >> <empty string>\n",
name); name);
else else
(void)fprintf(stderr,"%s >> %s\n", name, nname); (void)fprintf(stderr,"%s >> %s\n", name, nname);
} }
@ -1054,7 +1054,7 @@ rep_name(name, nlen, prnt)
* if empty inform the caller this file is to be skipped * if empty inform the caller this file is to be skipped
* otherwise copy the new name over the orig name and return * otherwise copy the new name over the orig name and return
*/ */
if (*nname == '\0') if (*nname == '\0')
return(1); return(1);
*nlen = l_strncpy(name, nname, PAXPATHLEN + 1); *nlen = l_strncpy(name, nname, PAXPATHLEN + 1);
} }

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: pax.c,v 1.2 1994/09/24 02:56:27 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -116,7 +116,7 @@ sigset_t s_mask; /* signal mask for cleanup critical sect */
* *
* 1 READ ENHANCEMENTS * 1 READ ENHANCEMENTS
* 1.1 Operations which read archives will continue to operate even when * 1.1 Operations which read archives will continue to operate even when
* processing archives which may be damaged, truncated, or fail to meet * processing archives which may be damaged, truncated, or fail to meet
* format specs in several different ways. Damaged sections of archives * format specs in several different ways. Damaged sections of archives
* are detected and avoided if possible. Attempts will be made to resync * are detected and avoided if possible. Attempts will be made to resync
* archive read operations even with badly damaged media. * archive read operations even with badly damaged media.
@ -131,7 +131,7 @@ sigset_t s_mask; /* signal mask for cleanup critical sect */
* 1.5 The user is notified whenever something is found during archive * 1.5 The user is notified whenever something is found during archive
* read operations which violates spec (but the read will continue). * read operations which violates spec (but the read will continue).
* 1.6 Multiple archive volumes can be read and may span over different * 1.6 Multiple archive volumes can be read and may span over different
* archive devices * archive devices
* 1.7 Rigidly restores all file attributes exactly as they are stored on the * 1.7 Rigidly restores all file attributes exactly as they are stored on the
* archive. * archive.
* 1.8 Modification change time ranges can be specified via multiple -T * 1.8 Modification change time ranges can be specified via multiple -T
@ -157,7 +157,7 @@ sigset_t s_mask; /* signal mask for cleanup critical sect */
* these fields. This removes any restrictions on using these archive * these fields. This removes any restrictions on using these archive
* formats on large file systems. * formats on large file systems.
* 2.5 Multiple archive volumes can be written and may span over different * 2.5 Multiple archive volumes can be written and may span over different
* archive devices * archive devices
* 2.6 A archive volume record limit allows the user to specify the number * 2.6 A archive volume record limit allows the user to specify the number
* of bytes stored on an archive volume. When reached the user is * of bytes stored on an archive volume. When reached the user is
* prompted for the next archive volume. This is specified with the * prompted for the next archive volume. This is specified with the
@ -204,7 +204,7 @@ sigset_t s_mask; /* signal mask for cleanup critical sect */
* name modification (-Z) * name modification (-Z)
* *
* 4 GENERAL ENHANCEMENTS * 4 GENERAL ENHANCEMENTS
* 4.1 Internal structure is designed to isolate format dependent and * 4.1 Internal structure is designed to isolate format dependent and
* independent functions. Formats are selected via a format driver table. * independent functions. Formats are selected via a format driver table.
* This encourages the addition of new archive formats by only having to * This encourages the addition of new archive formats by only having to
* write those routines which id, read and write the archive header. * write those routines which id, read and write the archive header.
@ -235,7 +235,7 @@ main(argc, argv)
return(exit_val); return(exit_val);
/* /*
* select a primary operation mode * select a primary operation mode
*/ */
switch(act) { switch(act) {
case EXTRACT: case EXTRACT:
@ -349,7 +349,7 @@ gen_init()
/* /*
* Handle posix locale * Handle posix locale
* *
* set user defines time printing format for -v option * set user defines time printing format for -v option
*/ */
ltmfrmt = getenv("LC_TIME"); ltmfrmt = getenv("LC_TIME");
@ -371,27 +371,27 @@ gen_init()
n_hand.sa_handler = sig_cleanup; n_hand.sa_handler = sig_cleanup;
if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) && if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) &&
(o_hand.sa_handler == SIG_IGN) && (o_hand.sa_handler == SIG_IGN) &&
(sigaction(SIGHUP, &o_hand, &o_hand) < 0)) (sigaction(SIGHUP, &o_hand, &o_hand) < 0))
goto out; goto out;
if ((sigaction(SIGTERM, &n_hand, &o_hand) < 0) && if ((sigaction(SIGTERM, &n_hand, &o_hand) < 0) &&
(o_hand.sa_handler == SIG_IGN) && (o_hand.sa_handler == SIG_IGN) &&
(sigaction(SIGTERM, &o_hand, &o_hand) < 0)) (sigaction(SIGTERM, &o_hand, &o_hand) < 0))
goto out; goto out;
if ((sigaction(SIGINT, &n_hand, &o_hand) < 0) && if ((sigaction(SIGINT, &n_hand, &o_hand) < 0) &&
(o_hand.sa_handler == SIG_IGN) && (o_hand.sa_handler == SIG_IGN) &&
(sigaction(SIGINT, &o_hand, &o_hand) < 0)) (sigaction(SIGINT, &o_hand, &o_hand) < 0))
goto out; goto out;
if ((sigaction(SIGQUIT, &n_hand, &o_hand) < 0) && if ((sigaction(SIGQUIT, &n_hand, &o_hand) < 0) &&
(o_hand.sa_handler == SIG_IGN) && (o_hand.sa_handler == SIG_IGN) &&
(sigaction(SIGQUIT, &o_hand, &o_hand) < 0)) (sigaction(SIGQUIT, &o_hand, &o_hand) < 0))
goto out; goto out;
if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) && if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) &&
(o_hand.sa_handler == SIG_IGN) && (o_hand.sa_handler == SIG_IGN) &&
(sigaction(SIGXCPU, &o_hand, &o_hand) < 0)) (sigaction(SIGXCPU, &o_hand, &o_hand) < 0))
goto out; goto out;

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)pax.h 8.2 (Berkeley) 4/18/94 * @(#)pax.h 8.2 (Berkeley) 4/18/94
* $Id$ * $Id: pax.h,v 1.2 1994/09/24 02:56:28 davidg Exp $
*/ */
/* /*
@ -63,7 +63,7 @@
#define DEFOP LIST /* if no flags default is to LIST */ #define DEFOP LIST /* if no flags default is to LIST */
/* /*
* Device type of the current archive volume * Device type of the current archive volume
*/ */
#define ISREG 0 /* regular file */ #define ISREG 0 /* regular file */
#define ISCHR 1 /* character device */ #define ISCHR 1 /* character device */
@ -76,7 +76,7 @@
* *
* The format specific routine table allows new archive formats to be quickly * The format specific routine table allows new archive formats to be quickly
* added. Overall pax operation is independent of the actual format used to * added. Overall pax operation is independent of the actual format used to
* form the archive. Only those routines which deal directly with the archive * form the archive. Only those routines which deal directly with the archive
* are tailored to the oddities of the specifc format. All other routines are * are tailored to the oddities of the specifc format. All other routines are
* independent of the archive format. Data flow in and out of the format * independent of the archive format. Data flow in and out of the format
* dependent routines pass pointers to ARCHD structure (described below). * dependent routines pass pointers to ARCHD structure (described below).
@ -207,7 +207,7 @@ typedef struct {
#define PAX_FIF 7 /* fifo */ #define PAX_FIF 7 /* fifo */
#define PAX_HLK 8 /* hard link */ #define PAX_HLK 8 /* hard link */
#define PAX_HRG 9 /* hard link to a regular file */ #define PAX_HRG 9 /* hard link to a regular file */
#define PAX_CTG 10 /* high performance file */ #define PAX_CTG 10 /* high performance file */
} ARCHD; } ARCHD;
/* /*

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: tables.c,v 1.2 1994/09/24 02:56:34 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -85,7 +85,7 @@ static DEVT *chk_dev __P((dev_t, int));
/* /*
* hard link table routines * hard link table routines
* *
* The hard link table tries to detect hard links to files using the device and * The hard link table tries to detect hard links to files using the device and
* inode values. We do this when writing an archive, so we can tell the format * inode values. We do this when writing an archive, so we can tell the format
* write routine that this file is a hard link to another file. The format * write routine that this file is a hard link to another file. The format
* write routine then can store this file in whatever way it wants (as a hard * write routine then can store this file in whatever way it wants (as a hard
@ -333,10 +333,10 @@ lnk_end()
* that this is one HUGE database. To save memory space, the actual file names * that this is one HUGE database. To save memory space, the actual file names
* are stored in a scatch file and indexed by an in memory hash table. The * are stored in a scatch file and indexed by an in memory hash table. The
* hash table is indexed by hashing the file path. The nodes in the table store * hash table is indexed by hashing the file path. The nodes in the table store
* the length of the filename and the lseek offset within the scratch file * the length of the filename and the lseek offset within the scratch file
* where the actual name is stored. Since there are never any deletions to this * where the actual name is stored. Since there are never any deletions to this
* table, fragmentation of the scratch file is never a issue. Lookups seem to * table, fragmentation of the scratch file is never a issue. Lookups seem to
* not exhibit any locality at all (files in the database are rarely * not exhibit any locality at all (files in the database are rarely
* looked up more than once...). So caching is just a waste of memory. The * looked up more than once...). So caching is just a waste of memory. The
* only limitation is the amount of scatch file space available to store the * only limitation is the amount of scatch file space available to store the
* path names. * path names.
@ -468,7 +468,7 @@ chk_ftime(arcn)
*/ */
pt->mtime = arcn->sb.st_mtime; pt->mtime = arcn->sb.st_mtime;
return(0); return(0);
} }
/* /*
* file is older * file is older
*/ */
@ -493,7 +493,7 @@ chk_ftime(arcn)
return(0); return(0);
} }
syswarn(1, errno, "Failed write to file time table"); syswarn(1, errno, "Failed write to file time table");
} else } else
syswarn(1, errno, "Failed seek on file time table"); syswarn(1, errno, "Failed seek on file time table");
} else } else
warn(1, "File time table ran out of memory"); warn(1, "File time table ran out of memory");
@ -567,7 +567,7 @@ add_name(oname, onamelen, nname)
* should never happen * should never happen
*/ */
warn(0, "No interactive rename table, links may fail\n"); warn(0, "No interactive rename table, links may fail\n");
return(0); return(0);
} }
/* /*
@ -666,7 +666,7 @@ sub_name(oname, onamelen)
*/ */
return; return;
} }
/* /*
* device/inode mapping table routines * device/inode mapping table routines
* (used with formats that store device and inodes fields) * (used with formats that store device and inodes fields)
@ -856,7 +856,7 @@ map_dev(arcn, dev_mask, ino_mask)
return(0); return(0);
/* /*
* check for device and inode truncation, and extract the truncated * check for device and inode truncation, and extract the truncated
* bit pattern. * bit pattern.
*/ */
if ((arcn->sb.st_dev & (dev_t)dev_mask) != arcn->sb.st_dev) if ((arcn->sb.st_dev & (dev_t)dev_mask) != arcn->sb.st_dev)
++trc_dev; ++trc_dev;
@ -1064,7 +1064,7 @@ add_atdir(fname, dev, ino, mtime, atime)
return; return;
/* /*
* make sure this directory is not already in the table, if so just * make sure this directory is not already in the table, if so just
* return (the older entry always has the correct time). The only * return (the older entry always has the correct time). The only
* way this will happen is when the same subtree can be traversed by * way this will happen is when the same subtree can be traversed by
* different args to pax and the -n option is aborting fts out of a * different args to pax and the -n option is aborting fts out of a
@ -1233,7 +1233,7 @@ dir_start()
* name is name of the directory, psb the stat buffer with the data in it, * name is name of the directory, psb the stat buffer with the data in it,
* frc_mode is a flag that says whether to force the setting of the mode * frc_mode is a flag that says whether to force the setting of the mode
* (ignoring the user set values for preserving file mode). Frc_mode is * (ignoring the user set values for preserving file mode). Frc_mode is
* for the case where we created a file and found that the resulting * for the case where we created a file and found that the resulting
* directory was not writeable and the user asked for file modes to NOT * directory was not writeable and the user asked for file modes to NOT
* be preserved. (we have to preserve what was created by default, so we * be preserved. (we have to preserve what was created by default, so we
* have to force the setting at the end. this is stated explicitly in the * have to force the setting at the end. this is stated explicitly in the
@ -1312,15 +1312,15 @@ proc_dir()
* read the trailer, then the file name, if this fails * read the trailer, then the file name, if this fails
* just give up. * just give up.
*/ */
if (lseek(dirfd, -((off_t)sizeof(dblk)), SEEK_CUR) < 0) if (lseek(dirfd, -((off_t)sizeof(dblk)), SEEK_CUR) < 0)
break; break;
if (read(dirfd,(char *)&dblk, sizeof(dblk)) != sizeof(dblk)) if (read(dirfd,(char *)&dblk, sizeof(dblk)) != sizeof(dblk))
break; break;
if (lseek(dirfd, dblk.npos, SEEK_SET) < 0) if (lseek(dirfd, dblk.npos, SEEK_SET) < 0)
break; break;
if (read(dirfd, name, dblk.nlen) != dblk.nlen) if (read(dirfd, name, dblk.nlen) != dblk.nlen)
break; break;
if (lseek(dirfd, dblk.npos, SEEK_SET) < 0) if (lseek(dirfd, dblk.npos, SEEK_SET) < 0)
break; break;
/* /*

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)tables.h 8.1 (Berkeley) 5/31/93 * @(#)tables.h 8.1 (Berkeley) 5/31/93
* $Id$ * $Id: tables.h,v 1.2 1994/09/24 02:56:35 davidg Exp $
*/ */
/* /*
@ -106,7 +106,7 @@ typedef struct namt {
* this table. (When the inode field in the archive header are too small, we * this table. (When the inode field in the archive header are too small, we
* remap the dev on writes to remove accidental collisions). * remap the dev on writes to remove accidental collisions).
* *
* The list is hashed by device number using chain collision resolution. Off of * The list is hashed by device number using chain collision resolution. Off of
* each DEVT are linked the various remaps for this device based on those bits * each DEVT are linked the various remaps for this device based on those bits
* in the inode which were truncated. For example if we are just remapping to * in the inode which were truncated. For example if we are just remapping to
* avoid a device number during an update append, off the DEVT we would have * avoid a device number during an update append, off the DEVT we would have

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: tar.c,v 1.2 1994/09/24 02:56:37 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -182,7 +182,7 @@ ul_oct(val, str, len, term)
#endif #endif
{ {
register char *pt; register char *pt;
/* /*
* term selects the appropriate character(s) for the end of the string * term selects the appropriate character(s) for the end of the string
*/ */
@ -246,7 +246,7 @@ uqd_oct(val, str, len, term)
#endif #endif
{ {
register char *pt; register char *pt;
/* /*
* term selects the appropriate character(s) for the end of the string * term selects the appropriate character(s) for the end of the string
*/ */
@ -315,8 +315,8 @@ tar_chksm(blk, len)
*/ */
pt = blk; pt = blk;
stop = blk + CHK_OFFSET; stop = blk + CHK_OFFSET;
while (pt < stop) while (pt < stop)
chksm += (u_long)(*pt++ & 0xff); chksm += (u_long)(*pt++ & 0xff);
/* /*
* move past the checksum field and keep going, spec counts the * move past the checksum field and keep going, spec counts the
* checksum field as the sum of 8 blanks (which is pre-computed as * checksum field as the sum of 8 blanks (which is pre-computed as
@ -327,7 +327,7 @@ tar_chksm(blk, len)
pt += CHK_LEN; pt += CHK_LEN;
stop = blk + len; stop = blk + len;
while (pt < stop) while (pt < stop)
chksm += (u_long)(*pt++ & 0xff); chksm += (u_long)(*pt++ & 0xff);
return(chksm); return(chksm);
} }
@ -532,7 +532,7 @@ tar_rd(arcn, buf)
* strip off any trailing slash. * strip off any trailing slash.
*/ */
if (*pt == '/') { if (*pt == '/') {
*pt = '\0'; *pt = '\0';
--arcn->nlen; --arcn->nlen;
} }
return(0); return(0);
@ -1013,7 +1013,7 @@ ustar_wr(arcn)
*/ */
zf_strncpy(hd->name, pt, sizeof(hd->name)); zf_strncpy(hd->name, pt, sizeof(hd->name));
/* /*
* set the fields in the header that are type dependent * set the fields in the header that are type dependent
*/ */
switch(arcn->type) { switch(arcn->type) {

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: print.c,v 1.5 1994/10/02 14:11:32 ache Exp $ * $Id: print.c,v 1.6 1995/03/19 13:29:01 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -410,7 +410,7 @@ wchan(k, ve)
v = ve->var; v = ve->var;
if (KI_PROC(k)->p_wchan) { if (KI_PROC(k)->p_wchan) {
if (KI_PROC(k)->p_wmesg) if (KI_PROC(k)->p_wmesg)
(void)printf("%-*.*s", v->width, v->width, (void)printf("%-*.*s", v->width, v->width,
KI_EPROC(k)->e_wmesg); KI_EPROC(k)->e_wmesg);
else else
(void)printf("%-*x", v->width, (void)printf("%-*x", v->width,
@ -599,7 +599,7 @@ pagein(k, ve)
VAR *v; VAR *v;
v = ve->var; v = ve->var;
(void)printf("%*ld", v->width, (void)printf("%*ld", v->width,
k->ki_u.u_valid ? k->ki_u.u_ru.ru_majflt : 0); k->ki_u.u_valid ? k->ki_u.u_ru.ru_majflt : 0);
} }

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: ps.c,v 1.5 1994/10/18 04:27:46 davidg Exp $ * $Id: ps.c,v 1.6 1995/03/19 13:29:06 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -486,7 +486,7 @@ kludge_oldps_options(s)
* if there's a trailing number, and not a preceding 'p' (pid) or * if there's a trailing number, and not a preceding 'p' (pid) or
* 't' (tty) flag, then assume it's a pid and insert a 'p' flag. * 't' (tty) flag, then assume it's a pid and insert a 'p' flag.
*/ */
if (isdigit(*cp) && if (isdigit(*cp) &&
(cp == s || (cp[-1] != 't' && cp[-1] != 'p')) && (cp == s || (cp[-1] != 't' && cp[-1] != 'p')) &&
(cp - 1 == s || cp[-2] != 't')) (cp - 1 == s || cp[-2] != 't'))
*ns++ = 'p'; *ns++ = 'p';

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: rcp.c,v 1.2 1994/09/24 02:56:56 davidg Exp $ * $Id: rcp.c,v 1.3 1995/03/19 13:29:14 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -366,10 +366,10 @@ tolocal(argc, argv)
if ((bp = malloc(len)) == NULL) if ((bp = malloc(len)) == NULL)
err(1, NULL); err(1, NULL);
(void)snprintf(bp, len, "%s -f %s", cmd, src); (void)snprintf(bp, len, "%s -f %s", cmd, src);
rem = rem =
#ifdef KERBEROS #ifdef KERBEROS
use_kerberos ? use_kerberos ?
kerberos(&host, bp, pwd->pw_name, suser) : kerberos(&host, bp, pwd->pw_name, suser) :
#endif #endif
rcmd(&host, port, pwd->pw_name, suser, bp, 0); rcmd(&host, port, pwd->pw_name, suser, bp, 0);
(void)free(bp); (void)free(bp);
@ -714,7 +714,7 @@ bad: run_err("%s: %s", np, strerror(errno));
j = write(ofd, bp->buf, count); j = write(ofd, bp->buf, count);
if (j != count) { if (j != count) {
wrerr = YES; wrerr = YES;
wrerrno = j >= 0 ? EIO : errno; wrerrno = j >= 0 ? EIO : errno;
} }
} }
count = 0; count = 0;
@ -724,7 +724,7 @@ bad: run_err("%s: %s", np, strerror(errno));
if (count != 0 && wrerr == NO && if (count != 0 && wrerr == NO &&
(j = write(ofd, bp->buf, count)) != count) { (j = write(ofd, bp->buf, count)) != count) {
wrerr = YES; wrerr = YES;
wrerrno = j >= 0 ? EIO : errno; wrerrno = j >= 0 ? EIO : errno;
} }
if (ftruncate(ofd, size)) { if (ftruncate(ofd, size)) {
run_err("%s: truncate: %s", np, strerror(errno)); run_err("%s: truncate: %s", np, strerror(errno));
@ -780,9 +780,9 @@ kerberos(host, bp, locuser, user)
errno = 0; errno = 0;
if (dest_realm == NULL) if (dest_realm == NULL)
dest_realm = krb_realmofhost(*host); dest_realm = krb_realmofhost(*host);
rem = rem =
#ifdef CRYPT #ifdef CRYPT
doencrypt ? doencrypt ?
krcmd_mutual(host, krcmd_mutual(host,
port, user, bp, 0, dest_realm, &cred, schedule) : port, user, bp, 0, dest_realm, &cred, schedule) :
#endif #endif

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: util.c,v 1.2 1994/09/24 02:56:57 davidg Exp $ * $Id: util.c,v 1.3 1995/03/19 13:29:16 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -118,7 +118,7 @@ susystem(s, userid)
switch (pid) { switch (pid) {
case -1: case -1:
return (127); return (127);
case 0: case 0:
(void)setuid(userid); (void)setuid(userid);
execl(_PATH_BSHELL, "sh", "-c", s, NULL); execl(_PATH_BSHELL, "sh", "-c", s, NULL);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: rmail.c,v 1.3 1995/03/05 08:27:14 joerg Exp $ * $Id: rmail.c,v 1.4 1995/03/19 13:29:18 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -48,7 +48,7 @@ static char sccsid[] = "@(#)rmail.c 8.1 (Berkeley) 5/31/93";
* *
* This program reads the >From ... remote from ... lines that UUCP is so * This program reads the >From ... remote from ... lines that UUCP is so
* fond of and turns them into something reasonable. It then execs sendmail * fond of and turns them into something reasonable. It then execs sendmail
* with various options built from these lines. * with various options built from these lines.
* *
* The expected syntax is: * The expected syntax is:
* *

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: alias.c,v 1.2 1994/09/24 02:57:20 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -227,7 +227,7 @@ unaliascmd(argc, argv)
char **argv; char **argv;
{ {
int i; int i;
while ((i = nextopt("a")) != '\0') { while ((i = nextopt("a")) != '\0') {
if (i == 'a') { if (i == 'a') {
rmaliases(); rmaliases();

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: error.c,v 1.2 1994/09/24 02:57:27 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -53,7 +53,7 @@ static char sccsid[] = "@(#)error.c 8.1 (Berkeley) 5/31/93";
#ifdef __STDC__ #ifdef __STDC__
#include "stdarg.h" #include "stdarg.h"
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include <errno.h> #include <errno.h>

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: eval.c,v 1.2 1994/09/24 02:57:29 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -134,8 +134,8 @@ SHELLPROC {
* The eval commmand. * The eval commmand.
*/ */
evalcmd(argc, argv) evalcmd(argc, argv)
char **argv; char **argv;
{ {
char *p; char *p;
char *concat; char *concat;
@ -233,7 +233,7 @@ evaltree(n, flags)
evalsubshell(n, flags); evalsubshell(n, flags);
break; break;
case NIF: { case NIF: {
int status = 0; int status = 0;
evaltree(n->nif.test, EV_TESTED); evaltree(n->nif.test, EV_TESTED);
if (evalskip) if (evalskip)

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: exec.c,v 1.3 1994/09/24 02:57:32 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -744,7 +744,7 @@ delete_cmd_entry() {
void void
getcmdentry(name, entry) getcmdentry(name, entry)
char *name; char *name;
struct cmdentry *entry; struct cmdentry *entry;
{ {
struct tblentry *cmdp = cmdlookup(name, 0); struct tblentry *cmdp = cmdlookup(name, 0);

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: expand.c,v 1.2 1994/09/24 02:57:34 davidg Exp $ * $Id: expand.c,v 1.3 1995/03/01 13:04:15 guido Exp $
*/ */
#ifndef lint #ifndef lint
@ -322,10 +322,10 @@ expari(flag)
* scan backwards looking for the start of arithmetic. If the * scan backwards looking for the start of arithmetic. If the
* next previous character is a CTLESC character, then we * next previous character is a CTLESC character, then we
* have to rescan starting from the beginning since CTLESC * have to rescan starting from the beginning since CTLESC
* characters have to be processed left to right. * characters have to be processed left to right.
*/ */
CHECKSTRSPACE(8, expdest); CHECKSTRSPACE(8, expdest);
USTPUTC('\0', expdest); USTPUTC('\0', expdest);
start = stackblock(); start = stackblock();
p = expdest; p = expdest;
while (*p != CTLARI && p >= start) while (*p != CTLARI && p >= start)
@ -372,7 +372,7 @@ expbackq(cmd, quoted, flag)
saveifs = ifsfirst; saveifs = ifsfirst;
savelastp = ifslastp; savelastp = ifslastp;
saveargbackq = argbackq; saveargbackq = argbackq;
saveherefd = herefd; saveherefd = herefd;
herefd = -1; herefd = -1;
p = grabstackstr(dest); p = grabstackstr(dest);
evalbackcmd(cmd, &in); evalbackcmd(cmd, &in);
@ -625,7 +625,7 @@ varvalue(name, quoted, allow_split)
sep = '\0'; sep = '\0';
goto allargs; goto allargs;
} }
/* fall through */ /* fall through */
case '*': case '*':
sep = ' '; sep = ' ';
allargs: allargs:
@ -783,8 +783,8 @@ expandmeta(str, flag)
expdir = NULL; expdir = NULL;
INTON; INTON;
if (exparg.lastp == savelastp) { if (exparg.lastp == savelastp) {
/* /*
* no matches * no matches
*/ */
nometa: nometa:
*exparg.lastp = str; *exparg.lastp = str;
@ -969,7 +969,7 @@ msort(list, len)
if (len <= 1) if (len <= 1)
return list; return list;
half = len >> 1; half = len >> 1;
p = list; p = list;
for (n = half ; --n >= 0 ; ) { for (n = half ; --n >= 0 ; ) {
q = p; q = p;

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: histedit.c,v 1.2 1994/09/24 02:57:36 davidg Exp $ * $Id: histedit.c,v 1.3 1995/05/05 06:34:13 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -140,7 +140,7 @@ sethistsize() {
if (hist != NULL) { if (hist != NULL) {
cp = lookupvar("HISTSIZE"); cp = lookupvar("HISTSIZE");
if (cp == NULL || *cp == '\0' || if (cp == NULL || *cp == '\0' ||
(histsize = atoi(cp)) < 0) (histsize = atoi(cp)) < 0)
histsize = 100; histsize = 100;
history(hist, H_EVENT, histsize); history(hist, H_EVENT, histsize);
@ -172,7 +172,7 @@ histcmd(argc, argv)
if (hist == NULL) if (hist == NULL)
error("history not active"); error("history not active");
if (argc == 1) if (argc == 1)
error("missing history argument"); error("missing history argument");
@ -245,7 +245,7 @@ histcmd(argc, argv)
/* /*
* If executing, parse [old=new] now * If executing, parse [old=new] now
*/ */
if (lflg == 0 && argc > 0 && if (lflg == 0 && argc > 0 &&
((repl = strchr(argv[0], '=')) != NULL)) { ((repl = strchr(argv[0], '=')) != NULL)) {
pat = argv[0]; pat = argv[0];
*repl++ = '\0'; *repl++ = '\0';
@ -283,7 +283,7 @@ histcmd(argc, argv)
} }
/* /*
* XXX - this should not depend on the event numbers * XXX - this should not depend on the event numbers
* always increasing. Add sequence numbers or offset * always increasing. Add sequence numbers or offset
* to the history element in next (diskbased) release. * to the history element in next (diskbased) release.
*/ */
direction = first < last ? H_PREV : H_NEXT; direction = first < last ? H_PREV : H_NEXT;
@ -319,7 +319,7 @@ histcmd(argc, argv)
out1fmt("%5d ", he->num); out1fmt("%5d ", he->num);
out1str(he->str); out1str(he->str);
} else { } else {
char *s = pat ? char *s = pat ?
fc_replace(he->str, pat, repl) : (char *)he->str; fc_replace(he->str, pat, repl) : (char *)he->str;
if (sflg) { if (sflg) {
@ -329,7 +329,7 @@ histcmd(argc, argv)
evalstring(s); evalstring(s);
if (displayhist && hist) { if (displayhist && hist) {
/* /*
* XXX what about recursive and * XXX what about recursive and
* relative histnums. * relative histnums.
*/ */
history(hist, H_ENTER, s); history(hist, H_ENTER, s);
@ -355,7 +355,7 @@ histcmd(argc, argv)
readcmdfile(editfile); /* XXX - should read back - quick tst */ readcmdfile(editfile); /* XXX - should read back - quick tst */
unlink(editfile); unlink(editfile);
} }
if (lflg == 0 && active > 0) if (lflg == 0 && active > 0)
--active; --active;
if (displayhist) if (displayhist)
@ -438,7 +438,7 @@ str_to_event(str, last)
str); str);
} else { } else {
/* /*
* pattern * pattern
*/ */
he = history(hist, H_PREV_STR, str); he = history(hist, H_PREV_STR, str);
if (he == NULL) if (he == NULL)

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: input.c,v 1.2 1994/09/24 02:57:39 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -264,7 +264,7 @@ preadbuffer() {
done: done:
if (parsefile->fd == 0 && hist && something) { if (parsefile->fd == 0 && hist && something) {
INTOFF; INTOFF;
history(hist, whichprompt == 1 ? H_ENTER : H_ADD, history(hist, whichprompt == 1 ? H_ENTER : H_ADD,
parsefile->buf); parsefile->buf);
INTON; INTON;
} }
@ -276,7 +276,7 @@ preadbuffer() {
*/ */
i = parsenleft + 1; i = parsenleft + 1;
p = parsefile->buf; p = parsefile->buf;
for (; i--; p++) for (; i--; p++)
out2c(*p) out2c(*p)
flushout(out2); flushout(out2);
} }

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: jobs.c,v 1.2 1994/09/24 02:57:41 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -488,7 +488,7 @@ makejob(node, nprocs)
INTON; INTON;
TRACE(("makejob(0x%x, %d) returns %%%d\n", (int)node, nprocs, jp - jobtab + 1)); TRACE(("makejob(0x%x, %d) returns %%%d\n", (int)node, nprocs, jp - jobtab + 1));
return jp; return jp;
} }
/* /*

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: main.c,v 1.2 1994/09/24 02:57:48 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -153,7 +153,7 @@ main(argc, argv) char **argv; {
state1: state1:
state = 2; state = 2;
read_profile(".profile"); read_profile(".profile");
} }
state2: state2:
state = 3; state = 3;
if ((shinit = lookupvar("ENV")) != NULL && if ((shinit = lookupvar("ENV")) != NULL &&

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: mkinit.c,v 1.2 1994/09/24 02:57:54 davidg Exp $ * $Id: mkinit.c,v 1.3 1994/11/06 06:27:04 pst Exp $
*/ */
#ifndef lint #ifndef lint
@ -91,7 +91,7 @@ struct text {
int nleft; int nleft;
struct block *start; struct block *start;
struct block *last; struct block *last;
}; };
struct block { struct block {
struct block *next; struct block *next;

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: mksignames.c,v 1.2 1994/09/24 02:57:56 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -158,7 +158,7 @@ char writer[] = "\
main(argc, argv) char **argv; { main(argc, argv) char **argv; {
FILE *cfile, *hfile; FILE *cfile, *hfile;
struct sig *sigp; struct sig *sigp;
int maxsig; int maxsig;
int i; int i;

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: options.c,v 1.2 1994/09/24 02:58:04 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -201,7 +201,7 @@ minus_o(name, val)
error("Illegal option -o %s", name); error("Illegal option -o %s", name);
} }
} }
STATIC void STATIC void
setoption(flag, val) setoption(flag, val)

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: parser.c,v 1.4 1995/01/09 20:00:54 paul Exp $ * $Id: parser.c,v 1.5 1995/01/11 07:07:00 paul Exp $
*/ */
#ifndef lint #ifndef lint
@ -472,7 +472,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
STATIC union node * STATIC union node *
simplecmd(rpp, redir) simplecmd(rpp, redir)
union node **rpp, *redir; union node **rpp, *redir;
{ {
union node *args, **app; union node *args, **app;
@ -486,10 +486,10 @@ simplecmd(rpp, redir)
args = NULL; args = NULL;
app = &args; app = &args;
/* /*
* We save the incoming value, because we need this for shell * We save the incoming value, because we need this for shell
* functions. There can not be a redirect or an argument between * functions. There can not be a redirect or an argument between
* the function name and the open parenthesis. * the function name and the open parenthesis.
*/ */
orig_rpp = rpp; orig_rpp = rpp;
@ -630,7 +630,7 @@ readtoken() {
#ifdef DEBUG #ifdef DEBUG
int alreadyseen = tokpushback; int alreadyseen = tokpushback;
#endif #endif
top: top:
t = xxreadtoken(); t = xxreadtoken();
@ -926,7 +926,7 @@ readtoken1(firstc, syntax, eofmark, striptabs)
} else } else
USTPUTC(')', out); USTPUTC(')', out);
} else { } else {
/* /*
* unbalanced parens * unbalanced parens
* (don't 2nd guess - no error) * (don't 2nd guess - no error)
*/ */
@ -1176,7 +1176,7 @@ parsebackq: {
register c; register c;
int savelen; int savelen;
char *str; char *str;
STARTSTACKSTR(out); STARTSTACKSTR(out);
while ((c = pgetc ()) != '`') { while ((c = pgetc ()) != '`') {
if (c == '\\') { if (c == '\\') {

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: redir.c,v 1.2 1994/09/24 02:58:10 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -72,10 +72,10 @@ struct redirtab {
MKINIT struct redirtab *redirlist; MKINIT struct redirtab *redirlist;
/* /*
* We keep track of whether or not fd0 has been redirected. This is for * We keep track of whether or not fd0 has been redirected. This is for
* background commands, where we want to redirect fd0 to /dev/null only * background commands, where we want to redirect fd0 to /dev/null only
* if it hasn't already been redirected. * if it hasn't already been redirected.
*/ */
int fd0_redirected = 0; int fd0_redirected = 0;

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: trap.c,v 1.2 1994/09/24 02:58:18 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -187,13 +187,13 @@ setsignal(signo) {
} }
} }
t = &sigmode[signo - 1]; t = &sigmode[signo - 1];
if (*t == 0) { if (*t == 0) {
/* /*
* current setting unknown * current setting unknown
*/ */
sigact = getsigaction(signo); sigact = getsigaction(signo);
if (sigact == SIG_IGN) { if (sigact == SIG_IGN) {
if (mflag && (signo == SIGTSTP || if (mflag && (signo == SIGTSTP ||
signo == SIGTTIN || signo == SIGTTOU)) { signo == SIGTTIN || signo == SIGTTOU)) {
*t = S_IGN; /* don't hard ignore these */ *t = S_IGN; /* don't hard ignore these */
} else } else

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: var.c,v 1.2 1994/09/24 02:58:22 davidg Exp $
*/ */
#ifndef lint #ifndef lint
@ -93,7 +93,7 @@ const struct varinit varinit[] = {
{&vmail, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL="}, {&vmail, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL="},
{&vmpath, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH="}, {&vmpath, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH="},
{&vpath, VSTRFIXED|VTEXTFIXED, "PATH=:/bin:/usr/bin"}, {&vpath, VSTRFIXED|VTEXTFIXED, "PATH=:/bin:/usr/bin"},
/* /*
* vps1 depends on uid * vps1 depends on uid
*/ */
{&vps2, VSTRFIXED|VTEXTFIXED, "PS2=> "}, {&vps2, VSTRFIXED|VTEXTFIXED, "PS2=> "},
@ -586,7 +586,7 @@ unsetcmd(argc, argv) char **argv; {
} }
if (flg_func == 0 && flg_var == 0) if (flg_func == 0 && flg_var == 0)
flg_var = 1; flg_var = 1;
for (ap = argptr; *ap ; ap++) { for (ap = argptr; *ap ; ap++) {
if (flg_func) if (flg_func)
ret |= unsetfunc(*ap); ret |= unsetfunc(*ap);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: cchar.c,v 1.2 1994/09/24 02:58:55 davidg Exp $ * $Id: cchar.c,v 1.3 1995/04/28 19:29:28 ache Exp $
*/ */
#ifndef lint #ifndef lint
@ -100,7 +100,7 @@ csearch(argvp, ip)
struct cchar *cp, tmp; struct cchar *cp, tmp;
long val; long val;
char *arg, *ep, *name; char *arg, *ep, *name;
name = **argvp; name = **argvp;
tmp.name = name; tmp.name = name;

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: gfmt.c,v 1.2 1994/09/24 02:58:57 davidg Exp $ * $Id: gfmt.c,v 1.3 1995/03/19 13:29:23 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -72,7 +72,7 @@ gprint(tp, wp, ldisc)
} }
void void
gread(tp, s) gread(tp, s)
struct termios *tp; struct termios *tp;
char *s; char *s;
{ {

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: print.c,v 1.3 1995/04/28 19:29:30 ache Exp $ * $Id: print.c,v 1.4 1995/04/29 15:17:16 bde Exp $
*/ */
#ifndef lint #ifndef lint
@ -70,19 +70,19 @@ print(tp, wp, ldisc, fmt)
/* Line discipline. */ /* Line discipline. */
if (ldisc != TTYDISC) { if (ldisc != TTYDISC) {
switch(ldisc) { switch(ldisc) {
case TABLDISC: case TABLDISC:
cnt += printf("tablet disc; "); cnt += printf("tablet disc; ");
break; break;
case NTTYDISC: case NTTYDISC:
cnt += printf("new tty disc; "); cnt += printf("new tty disc; ");
break; break;
case SLIPDISC: case SLIPDISC:
cnt += printf("slip disc; "); cnt += printf("slip disc; ");
break; break;
case PPPDISC: case PPPDISC:
cnt += printf("ppp disc; "); cnt += printf("ppp disc; ");
break; break;
default: default:
cnt += printf("#%d disc; ", ldisc); cnt += printf("#%d disc; ", ldisc);
break; break;
} }

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: stty.c,v 1.2 1994/09/24 02:59:02 davidg Exp $ * $Id: stty.c,v 1.3 1995/04/29 15:00:34 bde Exp $
*/ */
#ifndef lint #ifndef lint
@ -58,7 +58,7 @@ static char sccsid[] = "@(#)stty.c 8.3 (Berkeley) 4/2/94";
#include "extern.h" #include "extern.h"
int int
main(argc, argv) main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
{ {
@ -117,7 +117,7 @@ args: argc -= optind;
gprint(&i.t, &i.win, i.ldisc); gprint(&i.t, &i.win, i.ldisc);
break; break;
} }
for (i.set = i.wset = 0; *argv; ++argv) { for (i.set = i.wset = 0; *argv; ++argv) {
if (ksearch(&argv, &i)) if (ksearch(&argv, &i))
continue; continue;

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: test.c,v 1.9 1994/11/05 20:48:06 ache Exp $ * $Id: test.c,v 1.10 1995/03/19 13:29:28 joerg Exp $
*/ */
#ifndef lint #ifndef lint
@ -238,13 +238,13 @@ main(argc, argv)
get_int(valsp->u.string, get_int(valsp->u.string,
&valsp->u.num); &valsp->u.num);
valsp->type = INTEGER; valsp->type = INTEGER;
} else if (c >= OP_STRING) { } else if (c >= OP_STRING) {
/* OP_STRING or OP_FILE */ /* OP_STRING or OP_FILE */
if (valsp->type == INTEGER) { if (valsp->type == INTEGER) {
if ((p = malloc(32)) == NULL) if ((p = malloc(32)) == NULL)
err(2, NULL); err(2, NULL);
#ifdef SHELL #ifdef SHELL
fmtstr(p, 32, "%d", fmtstr(p, 32, "%d",
valsp->u.num); valsp->u.num);
#else #else
(void)sprintf(p, (void)sprintf(p,
@ -253,7 +253,7 @@ main(argc, argv)
valsp->u.string = p; valsp->u.string = p;
} else if (valsp->type == BOOLEAN) { } else if (valsp->type == BOOLEAN) {
if (valsp->u.num) if (valsp->u.num)
valsp->u.string = valsp->u.string =
"true"; "true";
else else
valsp->u.string = ""; valsp->u.string = "";
@ -262,8 +262,8 @@ main(argc, argv)
if (c == OP_FILE && (fs.name == NULL || if (c == OP_FILE && (fs.name == NULL ||
strcmp(fs.name, valsp->u.string))) { strcmp(fs.name, valsp->u.string))) {
fs.name = valsp->u.string; fs.name = valsp->u.string;
fs.rcode = fs.rcode =
stat(valsp->u.string, stat(valsp->u.string,
&fs.stat); &fs.stat);
} }
} }