SCCS-vsn: bin/csh/csh.c 5.31
SCCS-vsn: bin/csh/dir.c 5.16
SCCS-vsn: bin/csh/dol.c 5.16
SCCS-vsn: bin/csh/file.c 5.20
SCCS-vsn: bin/csh/func.c 5.30
SCCS-vsn: bin/csh/glob.c 5.30
SCCS-vsn: bin/csh/lex.c 5.24
SCCS-vsn: bin/csh/misc.c 5.16
SCCS-vsn: bin/csh/proc.c 5.27
SCCS-vsn: bin/csh/set.c 5.16
SCCS-vsn: bin/csh/str.c 5.9
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)csh.c 5.30 (Berkeley) %G%";
+static char sccsid[] = "@(#)csh.c 5.31 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
tempv[1][0] = '\0';
tempv[1][1] = '\0';
tempv[1] = NULL;
tempv[1][0] = '\0';
tempv[1][1] = '\0';
tempv[1] = NULL;
- for (tcp = *tempv; *tcp++;);
+ for (tcp = *tempv; *tcp++;)
+ continue;
for (tcp--; tcp >= *tempv; tcp--)
tcp[1] = tcp[0];
*++tcp = '-';
for (tcp--; tcp >= *tempv; tcp--)
tcp[1] = tcp[0];
*++tcp = '-';
- for (k = 0200; k <= 0377 && !Isprint(k); k++);
+ for (k = 0200; k <= 0377 && !Isprint(k); k++)
+ continue;
AsciiOnly = k > 0377;
}
#else
AsciiOnly = k > 0377;
}
#else
/*
* Process the arguments.
/*
* Process the arguments.
* Note that processing of -v/-x is actually delayed till after script
* processing.
* Note that processing of -v/-x is actually delayed till after script
* processing.
* We set the first character of our name to be '-' if we are a shell
* We set the first character of our name to be '-' if we are a shell
- * running interruptible commands. Many programs which examine ps'es
+ * running interruptible commands. Many programs which examine ps'es
* use this to filter such shells out.
*/
argc--, tempv++;
* use this to filter such shells out.
*/
argc--, tempv++;
stderror(ERR_SYSTEM, tempv[0], strerror(errno));
}
ffile = SAVE(tempv[0]);
stderror(ERR_SYSTEM, tempv[0], strerror(errno));
}
ffile = SAVE(tempv[0]);
* Replace FSHIN. Handle /dev/std{in,out,err} specially
* since once they are closed we cannot open them again.
* In that case we use our own saved descriptors
*/
* Replace FSHIN. Handle /dev/std{in,out,err} specially
* since once they are closed we cannot open them again.
* In that case we use our own saved descriptors
*/
- if ((SHIN = dmove(nofile, FSHIN)) < 0)
+ if ((SHIN = dmove(nofile, FSHIN)) < 0)
switch(nofile) {
case 0:
SHIN = FSHIN;
switch(nofile) {
case 0:
SHIN = FSHIN;
shpgrp = getpid();
tpgrp = shpgrp;
/*
shpgrp = getpid();
tpgrp = shpgrp;
/*
- * Setpgid will fail if we are a session leader and
+ * Setpgid will fail if we are a session leader and
* mypid == mypgrp (POSIX 4.3.3)
*/
if (opgrp != shpgrp)
* mypid == mypgrp (POSIX 4.3.3)
*/
if (opgrp != shpgrp)
}
if (tpgrp == -1) {
notty:
}
if (tpgrp == -1) {
notty:
- (void) fprintf(csherr, "Warning: no access to tty (%s).\n",
+ (void) fprintf(csherr, "Warning: no access to tty (%s).\n",
strerror(errno));
(void) fprintf(csherr, "Thus no job control in this shell.\n");
}
strerror(errno));
(void) fprintf(csherr, "Thus no job control in this shell.\n");
}
* stream since we have stuff in different structures. If we weren't
* careful an interrupt could corrupt SHIN's Bin structure and kill the
* shell.
* stream since we have stuff in different structures. If we weren't
* careful an interrupt could corrupt SHIN's Bin structure and kill the
* shell.
* We could avoid the critical region by grouping all the stuff in a single
* structure and pointing at it to move it all at once. This is less
* efficient globally on many variable references however.
* We could avoid the critical region by grouping all the stuff in a single
* structure and pointing at it to move it all at once. This is less
* efficient globally on many variable references however.
/*
* Save input text on the history list if reading in old history, or it
* is from the terminal at the top level and not in a loop.
/*
* Save input text on the history list if reading in old history, or it
* is from the terminal at the top level and not in a loop.
* PWP: entry of items in the history list while in a while loop is done
* elsewhere...
*/
* PWP: entry of items in the history list while in a while loop is done
* elsewhere...
*/
if (seterr)
stderror(ERR_OLD);
if (seterr)
stderror(ERR_OLD);
- execute(savet, (tpgrp > 0 ? tpgrp : -1), NULL, NULL);
+ execute(savet, (tpgrp > 0 ? tpgrp : -1), NULL, NULL);
if (cnt == 1)
(void) fprintf(cshout, "You have %smail.\n", new ? "new " : "");
else
if (cnt == 1)
(void) fprintf(cshout, "You have %smail.\n", new ? "new " : "");
else
- (void) fprintf(cshout, "%s in %s.\n", new ? "New mail" : "Mail",
+ (void) fprintf(cshout, "%s in %s.\n", new ? "New mail" : "Mail",
short2str(*vp));
}
chktim = t;
short2str(*vp));
}
chktim = t;
(void) fprintf(cshout, "? ");
(void) fflush(cshout);
}
(void) fprintf(cshout, "? ");
(void) fflush(cshout);
}
-static char sccsid[] = "@(#)dir.c 5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)dir.c 5.16 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
/* Directory management. */
/* Directory management. */
-static Char *dfollow __P((Char *));
-static void printdirs __P((void));
-static Char *dgoto __P((Char *));
-static void dnewcwd __P((struct directory *));
-static void dset __P((Char *));
+static Char *dfollow __P((Char *));
+static void printdirs __P((void));
+static Char *dgoto __P((Char *));
+static void dnewcwd __P((struct directory *));
+static void dset __P((Char *));
struct directory dhead; /* "head" of loop */
int printd; /* force name to be printed */
struct directory dhead; /* "head" of loop */
int printd; /* force name to be printed */
{
/*
* Don't call set() directly cause if the directory contains ` or
{
/*
* Don't call set() directly cause if the directory contains ` or
- * other junk characters glob will fail.
+ * other junk characters glob will fail.
*/
register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
*/
register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
register Char *p, *q;
int cwdlen;
register Char *p, *q;
int cwdlen;
- for (p = dcwd->di_name; *p++;);
+ for (p = dcwd->di_name; *p++;)
+ continue;
if ((cwdlen = p - dcwd->di_name - 1) == 1) /* root */
cwdlen = 0;
if ((cwdlen = p - dcwd->di_name - 1) == 1) /* root */
cwdlen = 0;
+ for (p = cp; *p++;)
+ continue;
dp = (Char *) xmalloc((size_t)((cwdlen + (p - cp) + 1) * sizeof(Char)));
dp = (Char *) xmalloc((size_t)((cwdlen + (p - cp) + 1) * sizeof(Char)));
- for (p = dp, q = dcwd->di_name; *p++ = *q++;);
+ for (p = dp, q = dcwd->di_name; *p++ = *q++;)
+ continue;
if (cwdlen)
p[-1] = '/';
else
p--; /* don't add a / after root */
if (cwdlen)
p[-1] = '/';
else
p--; /* don't add a / after root */
- for (q = cp; *p++ = *q++;);
+ for (q = cp; *p++ = *q++;)
+ continue;
xfree((ptr_t) cp);
cp = dp;
dp += cwdlen;
xfree((ptr_t) cp);
cp = dp;
dp += cwdlen;
Char buf[MAXPATHLEN];
for (cdp = c->vec; *cdp; cdp++) {
Char buf[MAXPATHLEN];
for (cdp = c->vec; *cdp; cdp++) {
- for (dp = buf, p = *cdp; *dp++ = *p++;);
+ for (dp = buf, p = *cdp; *dp++ = *p++;)
+ continue;
- for (p = cp; *dp++ = *p++;);
+ for (p = cp; *dp++ = *p++;)
+ continue;
if (chdir(short2str(buf)) >= 0) {
printd = 1;
xfree((ptr_t) cp);
if (chdir(short2str(buf)) >= 0) {
printd = 1;
xfree((ptr_t) cp);
while (*p) { /* for each component */
sp = p; /* save slash address */
while (*++p == '/') /* flush extra slashes */
while (*p) { /* for each component */
sp = p; /* save slash address */
while (*++p == '/') /* flush extra slashes */
- for (p1 = sp, p2 = p; *p1++ = *p2++;);
+ for (p1 = sp, p2 = p; *p1++ = *p2++;)
+ continue;
p = sp; /* save start of component */
slash = 0;
while (*++p) /* find next slash or end of path */
p = sp; /* save start of component */
slash = 0;
while (*++p) /* find next slash or end of path */
*sp = '\0';
else if (sp[0] == '.' && sp[1] == 0) {
if (slash) {
*sp = '\0';
else if (sp[0] == '.' && sp[1] == 0) {
if (slash) {
- for (p1 = sp, p2 = p + 1; *p1++ = *p2++;);
+ for (p1 = sp, p2 = p + 1; *p1++ = *p2++;)
+ continue;
p = --sp;
}
else if (--sp != cp)
p = --sp;
}
else if (--sp != cp)
+ for (p1 = p; *p1++;)
+ continue;
if (*link != '/') {
/*
* Relative path, expand it between the "yyy/" and the
* "/..". First, back sp up to the character past "yyy/".
*/
if (*link != '/') {
/*
* Relative path, expand it between the "yyy/" and the
* "/..". First, back sp up to the character past "yyy/".
*/
+ while (*--sp != '/')
+ continue;
/*
* Copy new path into newcp
*/
/*
* Copy new path into newcp
*/
- for (p2 = cp; *p1++ = *p2++;);
- for (p1--, p2 = link; *p1++ = *p2++;);
- for (p1--, p2 = p; *p1++ = *p2++;);
+ for (p2 = cp; *p1++ = *p2++;)
+ continue;
+ for (p1--, p2 = link; *p1++ = *p2++;)
+ continue;
+ for (p1--, p2 = p; *p1++ = *p2++;)
+ continue;
/*
* Restart canonicalization at expanded "/xxx".
*/
/*
* Restart canonicalization at expanded "/xxx".
*/
/*
* Copy new path into newcp
*/
/*
* Copy new path into newcp
*/
- for (p2 = link; *p1++ = *p2++;);
- for (p1--, p2 = p; *p1++ = *p2++;);
+ for (p2 = link; *p1++ = *p2++;)
+ continue;
+ for (p1--, p2 = p; *p1++ = *p2++;)
+ continue;
/*
* Restart canonicalization at beginning
*/
/*
* Restart canonicalization at beginning
*/
}
*sp = '/';
if (sp != cp)
}
*sp = '/';
if (sp != cp)
+ while (*--sp != '/')
+ continue;
- for (p1 = sp + 1, p2 = p + 1; *p1++ = *p2++;);
+ for (p1 = sp + 1, p2 = p + 1; *p1++ = *p2++;)
+ continue;
p = sp;
}
else if (cp == sp)
p = sp;
}
else if (cp == sp)
+ for (p1 = p; *p1++;)
+ continue;
if (*link != '/') {
/*
* Relative path, expand it between the "yyy/" and the
* remainder. First, back sp up to the character past
* "yyy/".
*/
if (*link != '/') {
/*
* Relative path, expand it between the "yyy/" and the
* remainder. First, back sp up to the character past
* "yyy/".
*/
+ while (*--sp != '/')
+ continue;
/*
* Copy new path into newcp
*/
/*
* Copy new path into newcp
*/
- for (p2 = cp; *p1++ = *p2++;);
- for (p1--, p2 = link; *p1++ = *p2++;);
- for (p1--, p2 = p; *p1++ = *p2++;);
+ for (p2 = cp; *p1++ = *p2++;)
+ continue;
+ for (p1--, p2 = link; *p1++ = *p2++;)
+ continue;
+ for (p1--, p2 = p; *p1++ = *p2++;)
+ continue;
/*
* Restart canonicalization at expanded "/xxx".
*/
/*
* Restart canonicalization at expanded "/xxx".
*/
/*
* Copy new path into newcp
*/
/*
* Copy new path into newcp
*/
- for (p2 = link; *p1++ = *p2++;);
- for (p1--, p2 = p; *p1++ = *p2++;);
+ for (p2 = link; *p1++ = *p2++;)
+ continue;
+ for (p1--, p2 = p; *p1++ = *p2++;)
+ continue;
/*
* Restart canonicalization at beginning
*/
/*
* Restart canonicalization at beginning
*/
-static char sccsid[] = "@(#)dol.c 5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)dol.c 5.16 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
static int dolmcnt; /* :gx -> 10000, else 1 */
static void Dfix2 __P((Char **));
static int dolmcnt; /* :gx -> 10000, else 1 */
static void Dfix2 __P((Char **));
-static Char *Dpack __P((Char *, Char *));
+static Char *Dpack __P((Char *, Char *));
static int Dword __P((void));
static void dolerror __P((Char *));
static int DgetC __P((int));
static int Dword __P((void));
static void dolerror __P((Char *));
static int DgetC __P((int));
if (Isdigit(*np)) {
int i;
if (Isdigit(*np)) {
int i;
- for (i = 0; Isdigit(*np); i = i * 10 + *np++ - '0');
+ for (i = 0; Isdigit(*np); i = i * 10 + *np++ - '0')
+ continue;
if ((i < 0 || i > upb) && !any("-*", *np)) {
dolerror(vp->v_name);
return;
if ((i < 0 || i > upb) && !any("-*", *np)) {
dolerror(vp->v_name);
return;
-static char sccsid[] = "@(#)file.c 5.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)file.c 5.20 (Berkeley) %G%";
#endif /* not lint */
#ifdef FILEC
#endif /* not lint */
#ifdef FILEC
static void copyn __P((Char *, Char *, int));
static Char filetype __P((Char *, Char *));
static void print_by_column __P((Char *, Char *[], int));
static void copyn __P((Char *, Char *, int));
static Char filetype __P((Char *, Char *));
static void print_by_column __P((Char *, Char *[], int));
-static Char *tilde __P((Char *, Char *));
+static Char *tilde __P((Char *, Char *));
static void retype __P((void));
static void beep __P((void));
static void retype __P((void));
static void beep __P((void));
-static void print_recognized_stuff __P((Char *));
+static void print_recognized_stuff __P((Char *));
static void extract_dir_and_name __P((Char *, Char *, Char *));
static Char *getentry __P((DIR *, int));
static void free_items __P((Char **));
static void extract_dir_and_name __P((Char *, Char *, Char *));
static Char *getentry __P((DIR *, int));
static void free_items __P((Char **));
if (old[0] != '~')
return (Strcpy(new, old));
if (old[0] != '~')
return (Strcpy(new, old));
- for (p = person, o = &old[1]; *o && *o != '/'; *p++ = *o++);
+ for (p = person, o = &old[1]; *o && *o != '/'; *p++ = *o++)
+ continue;
*p = '\0';
if (person[0] == '\0')
(void) Strcpy(new, value(STRhome));
*p = '\0';
if (person[0] == '\0')
(void) Strcpy(new, value(STRhome));
return (numitems);
}
else { /* LIST */
return (numitems);
}
else { /* LIST */
- qsort((ptr_t) items, numitems, sizeof(items[0]),
+ qsort((ptr_t) items, numitems, sizeof(items[0]),
(int (*)(const void *, const void *)) sortscmp);
print_by_column(looking_for_lognames ? NULL : tilded_dir,
items, numitems);
(int (*)(const void *, const void *)) sortscmp);
print_by_column(looking_for_lognames ? NULL : tilded_dir,
items, numitems);
register int len = 0;
x = extended_name;
register int len = 0;
x = extended_name;
- for (ent = entry; *x && *x == *ent++; x++, len++);
+ for (ent = entry; *x && *x == *ent++; x++, len++)
+ continue;
*x = '\0'; /* Shorten at 1st Char diff */
if (len == name_length) /* Ambiguous to prefix? */
return (-1); /* So stop now and save time */
*x = '\0'; /* Shorten at 1st Char diff */
if (len == name_length) /* Ambiguous to prefix? */
return (-1); /* So stop now and save time */
- for (c = check; *c++;);
- for (t = template; *t++;);
+ for (c = check; *c++;)
+ continue;
+ for (t = template; *t++;)
+ continue;
for (;;) {
if (t == template)
return 1;
for (;;) {
if (t == template)
return 1;
-static char sccsid[] = "@(#)func.c 5.29 (Berkeley) %G%";
+static char sccsid[] = "@(#)func.c 5.30 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
struct whyle *nwp;
btell(&o);
struct whyle *nwp;
btell(&o);
return;
for (; whyles; whyles = nwp) {
return;
for (; whyles; whyles = nwp) {
if (wp->w_end.type != I_SEEK) {
if (wp->w_end.type != F_SEEK)
break;
if (wp->w_end.type != I_SEEK) {
if (wp->w_end.type != F_SEEK)
break;
- 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))
break;
}
(wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek))
break;
}
int k;
(void) setlocale(LC_ALL, "");
int k;
(void) setlocale(LC_ALL, "");
- for (k = 0200; k <= 0377 && !Isprint(k); k++);
+ for (k = 0200; k <= 0377 && !Isprint(k); k++)
+ continue;
AsciiOnly = k > 0377;
#else
AsciiOnly = 0;
AsciiOnly = k > 0377;
#else
AsciiOnly = 0;
* Find the longest environment variable
*/
for (maxi = 0, ep = STR_environ; *ep; ep++) {
* Find the longest environment variable
*/
for (maxi = 0, ep = STR_environ; *ep; ep++) {
- for (i = 0, p = *ep; *p && *p != '='; p++, i++);
+ for (i = 0, p = *ep; *p && *p != '='; p++, i++)
+ continue;
if (i > maxi)
maxi = i;
}
if (i > maxi)
maxi = i;
}
while (++v && *v)
for (maxi = 1; maxi;)
for (maxi = 0, ep = STR_environ; *ep; ep++) {
while (++v && *v)
for (maxi = 1; maxi;)
for (maxi = 0, ep = STR_environ; *ep; ep++) {
- for (n = name, p = *ep; *p && *p != '='; *n++ = *p++);
+ for (n = name, p = *ep; *p && *p != '='; *n++ = *p++)
+ continue;
*n = '\0';
if (!Gmatch(name, *v))
continue;
*n = '\0';
if (!Gmatch(name, *v))
continue;
int k;
(void) setlocale(LC_ALL, "");
int k;
(void) setlocale(LC_ALL, "");
- for (k = 0200; k <= 0377 && !Isprint(k); k++);
+ for (k = 0200; k <= 0377 && !Isprint(k); k++)
+ continue;
AsciiOnly = k > 0377;
#else
AsciiOnly = getenv("LANG") == NULL &&
AsciiOnly = k > 0377;
#else
AsciiOnly = getenv("LANG") == NULL &&
int limdiv;
char *limscale;
} limits[] = {
int limdiv;
char *limscale;
} limits[] = {
- RLIMIT_CPU, "cputime", 1, "seconds",
+ RLIMIT_CPU, "cputime", 1, "seconds",
RLIMIT_FSIZE, "filesize", 1024, "kbytes",
RLIMIT_DATA, "datasize", 1024, "kbytes",
RLIMIT_STACK, "stacksize", 1024, "kbytes",
RLIMIT_CORE, "coredumpsize", 1024, "kbytes",
RLIMIT_FSIZE, "filesize", 1024, "kbytes",
RLIMIT_DATA, "datasize", 1024, "kbytes",
RLIMIT_STACK, "stacksize", 1024, "kbytes",
RLIMIT_CORE, "coredumpsize", 1024, "kbytes",
- RLIMIT_RSS, "memoryuse", 1024, "kbytes",
+ RLIMIT_RSS, "memoryuse", 1024, "kbytes",
RLIMIT_MEMLOCK, "memorylocked", 1024, "kbytes",
RLIMIT_NPROC, "maxproc", 1, "",
RLIMIT_OFILE, "openfiles", 1, "",
RLIMIT_MEMLOCK, "memorylocked", 1024, "kbytes",
RLIMIT_NPROC, "maxproc", 1, "",
RLIMIT_OFILE, "openfiles", 1, "",
};
static struct limits *findlim();
};
static struct limits *findlim();
else if (lp->limconst == RLIMIT_CPU)
psecs((long) limit);
else
else if (lp->limconst == RLIMIT_CPU)
psecs((long) limit);
else
- (void) fprintf(cshout, "%ld %s", (long) (limit / lp->limdiv),
+ (void) fprintf(cshout, "%ld %s", (long) (limit / lp->limdiv),
lp->limscale);
(void) fputc('\n', cshout);
}
lp->limscale);
(void) fputc('\n', cshout);
}
char **c;
extern int progprintf __P((int, char **));
int ret;
char **c;
extern int progprintf __P((int, char **));
int ret;
ret = progprintf(blklen(v), c = short2blk(v));
blkfree((Char **) c);
if (ret)
stderror(ERR_SILENT);
}
ret = progprintf(blklen(v), c = short2blk(v));
blkfree((Char **) c);
if (ret)
stderror(ERR_SILENT);
}
-static char sccsid[] = "@(#)glob.c 5.29 (Berkeley) %G%";
+static char sccsid[] = "@(#)glob.c 5.30 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
gstart = gbuf;
*gstart++ = *s++;
u = s;
gstart = gbuf;
*gstart++ = *s++;
u = s;
- for (b = gstart, e = &gbuf[MAXPATHLEN - 1];
+ for (b = gstart, e = &gbuf[MAXPATHLEN - 1];
*s && *s != '/' && *s != ':' && b < e;
*s && *s != '/' && *s != ':' && b < e;
+ *b++ = *s++)
+ continue;
*b = EOS;
if (gethdir(gstart)) {
blkfree(nv);
*b = EOS;
if (gethdir(gstart)) {
blkfree(nv);
gflgs |= GLOB_APPEND;
}
while (*++vl);
gflgs |= GLOB_APPEND;
}
while (*++vl);
- vl = (globv.gl_pathc == 0 || (magic && !match && !nonomatch)) ?
+ vl = (globv.gl_pathc == 0 || (magic && !match && !nonomatch)) ?
NULL : blk2short(globv.gl_pathv);
globfree(&globv);
return (vl);
NULL : blk2short(globv.gl_pathv);
globfree(&globv);
return (vl);
register Char *p, *q;
int n;
register Char *p, *q;
int n;
- for (p = s1; *p++;);
- for (q = s2; *q++;);
+ for (p = s1; *p++;)
+ continue;
+ for (q = s2; *q++;)
+ continue;
n = (p - s1) + (q - s2) - 1;
if (++gargc >= gargsiz) {
gargsiz += GLOBSPACE;
n = (p - s1) + (q - s2) - 1;
if (++gargc >= gargsiz) {
gargsiz += GLOBSPACE;
}
gargv[gargc] = 0;
p = gargv[gargc - 1] = (Char *) xmalloc((size_t) n * sizeof(Char));
}
gargv[gargc] = 0;
p = gargv[gargc - 1] = (Char *) xmalloc((size_t) n * sizeof(Char));
- for (q = s1; *p++ = *q++;);
- for (p--, q = s2; *p++ = *q++;);
+ for (q = s1; *p++ = *q++;)
+ continue;
+ for (p--, q = s2; *p++ = *q++;)
+ continue;
-static char sccsid[] = "@(#)lex.c 5.23 (Berkeley) %G%";
+static char sccsid[] = "@(#)lex.c 5.24 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
static int getC1 __P((int));
static void getdol __P((void));
static void getexcl __P((int));
static int getC1 __P((int));
static void getdol __P((void));
static void getexcl __P((int));
*findev __P((Char *, bool));
static void setexclp __P((Char *));
static int bgetc __P((void));
static void bfree __P((void));
*findev __P((Char *, bool));
static void setexclp __P((Char *));
static int bgetc __P((void));
static void bfree __P((void));
*gethent __P((int));
static int matchs __P((Char *, Char *));
static int getsel __P((int *, int *, int));
*gethent __P((int));
static int matchs __P((Char *, Char *));
static int getsel __P((int *, int *, int));
*getsub __P((struct wordent *));
*getsub __P((struct wordent *));
-static Char *subword __P((Char *, int, bool *));
-static struct wordent
+static Char *subword __P((Char *, int, bool *));
+static struct wordent
*dosub __P((int, struct wordent *, bool));
/*
*dosub __P((int, struct wordent *, bool));
/*
wp = wbuf;
i = BUFSIZ - 4;
loop:
wp = wbuf;
i = BUFSIZ - 4;
loop:
- while ((c = getC(DOALL)) == ' ' || c == '\t');
+ while ((c = getC(DOALL)) == ' ' || c == '\t')
+ continue;
if (cmap(c, _META | _ESC))
switch (c) {
case '&':
if (cmap(c, _META | _ESC))
switch (c) {
case '&':
break;
#ifdef notdef
if (c == '~') {
break;
#ifdef notdef
if (c == '~') {
- if (&cp[Strlen(orhsb)] > &rhsb[sizeof(rhsb) /
+ if (&cp[Strlen(orhsb)] > &rhsb[sizeof(rhsb) /
sizeof(Char) - 2])
goto toorhs;
(void) Strcpy(cp, orhsb);
sizeof(Char) - 2])
goto toorhs;
(void) Strcpy(cp, orhsb);
aret = F_SEEK;
if (alvecp) {
aret = A_SEEK;
aret = F_SEEK;
if (alvecp) {
aret = A_SEEK;
return (c);
if (alvec && *alvec) {
alvecp = *alvec++;
return (c);
if (alvec && *alvec) {
alvecp = *alvec++;
tpgrp != ctpgrp) {
(void) tcsetpgrp(FSHTTY, tpgrp);
(void) killpg((pid_t) ctpgrp, SIGHUP);
tpgrp != ctpgrp) {
(void) tcsetpgrp(FSHTTY, tpgrp);
(void) killpg((pid_t) ctpgrp, SIGHUP);
- (void) fprintf(csherr, "Reset tty pgrp from %d to %d\n",
+ (void) fprintf(csherr, "Reset tty pgrp from %d to %d\n",
ctpgrp, tpgrp);
goto reread;
}
ctpgrp, tpgrp);
goto reread;
}
alvec = l->a_seek;
alvecp = (Char *) l->f_seek;
return;
alvec = l->a_seek;
alvecp = (Char *) l->f_seek;
return;
fseekp = l->f_seek;
return;
default:
fseekp = l->f_seek;
return;
default:
-static char sccsid[] = "@(#)misc.c 5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c 5.16 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
+ for (p = s; *p++;)
+ continue;
n = p = (char *) xmalloc((size_t) ((p - s) * sizeof(char)));
n = p = (char *) xmalloc((size_t) ((p - s) * sizeof(char)));
+ while (*p++ = *s++)
+ continue;
cp = "";
if (!dp)
dp = "";
cp = "";
if (!dp)
dp = "";
- for (p = cp; *p++;);
- for (q = dp; *q++;);
+ for (p = cp; *p++;)
+ continue;
+ for (q = dp; *q++;)
+ continue;
ep = (char *) xmalloc((size_t) (((p - cp) + (q - dp) - 1) * sizeof(char)));
ep = (char *) xmalloc((size_t) (((p - cp) + (q - dp) - 1) * sizeof(char)));
- for (p = ep, q = cp; *p++ = *q++;);
- for (p--, q = dp; *p++ = *q++;);
+ for (p = ep, q = cp; *p++ = *q++;)
+ continue;
+ for (p--, q = dp; *p++ = *q++;)
+ continue;
-static char sccsid[] = "@(#)proc.c 5.26 (Berkeley) %G%";
+static char sccsid[] = "@(#)proc.c 5.27 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
static void ptprint __P((struct process *));
static void pads __P((Char *));
static void pkill __P((Char **v, int));
static void ptprint __P((struct process *));
static void pads __P((Char *));
static void pkill __P((Char **v, int));
*pgetcurr __P((struct process *));
static void okpcntl __P((void));
*pgetcurr __P((struct process *));
static void okpcntl __P((void));
if ((jobflags & PRUNNING) == 0)
break;
#ifdef JOBDEBUG
if ((jobflags & PRUNNING) == 0)
break;
#ifdef JOBDEBUG
- (void) fprintf(csherr, "starting to sigpause for SIGCHLD on %d\n",
+ (void) fprintf(csherr, "starting to sigpause for SIGCHLD on %d\n",
fp->p_pid);
#endif /* JOBDEBUG */
(void) sigpause(omask & ~sigmask(SIGCHLD));
fp->p_pid);
#endif /* JOBDEBUG */
(void) sigpause(omask & ~sigmask(SIGCHLD));
pp->p_index = pcurrjob->p_index;
pp->p_friends = pcurrjob;
pp->p_jobid = pcurrjob->p_pid;
pp->p_index = pcurrjob->p_index;
pp->p_friends = pcurrjob;
pp->p_jobid = pcurrjob->p_pid;
- for (fp = pcurrjob; fp->p_friends != pcurrjob; fp = fp->p_friends);
+ for (fp = pcurrjob; fp->p_friends != pcurrjob; fp = fp->p_friends)
+ continue;
fp->p_friends = pp;
}
else {
fp->p_friends = pp;
}
else {
do {
jobflags |= pp->p_flags;
pstatus = pp->p_flags & PALLSTATES;
do {
jobflags |= pp->p_flags;
pstatus = pp->p_flags & PALLSTATES;
- if (tp != pp && !hadnl && !(flag & FANCY) &&
+ if (tp != pp && !hadnl && !(flag & FANCY) &&
((pstatus == status && pp->p_reason == reason) ||
!(flag & REASON))) {
(void) fputc(' ', cshout);
((pstatus == status && pp->p_reason == reason) ||
!(flag & REASON))) {
(void) fputc(' ', cshout);
&& reason != SIGINT
&& (reason != SIGPIPE
|| (pp->p_flags & PPOU) == 0))) {
&& reason != SIGINT
&& (reason != SIGPIPE
|| (pp->p_flags & PPOU) == 0))) {
- (void) fprintf(cshout, format,
+ (void) fprintf(cshout, format,
sys_siglist[pp->p_reason]);
hadnl = 0;
}
sys_siglist[pp->p_reason]);
hadnl = 0;
}
if (!strncasecmp(name, "sig", 3))
name += 3;
if (!strncasecmp(name, "sig", 3))
name += 3;
- for (signum = 1; signum < NSIG; signum++)
+ for (signum = 1; signum < NSIG; signum++)
if (!strcasecmp(sys_signame[signum], name))
break;
if (!strcasecmp(sys_signame[signum], name))
break;
case SIGTTIN:
case SIGTTOU:
if ((jobflags & PRUNNING) == 0) {
case SIGTTIN:
case SIGTTOU:
if ((jobflags & PRUNNING) == 0) {
- (void) fprintf(csherr, "%s: Already suspended\n",
+ (void) fprintf(csherr, "%s: Already suspended\n",
short2str(cp));
err1++;
goto cont;
short2str(cp));
err1++;
goto cont;
goto cont;
}
if (killpg((pid_t) pp->p_jobid, signum) < 0) {
goto cont;
}
if (killpg((pid_t) pp->p_jobid, signum) < 0) {
- (void) fprintf(csherr, "%s: %s\n", short2str(cp),
+ (void) fprintf(csherr, "%s: %s\n", short2str(cp),
strerror(errno));
err1++;
}
strerror(errno));
err1++;
}
-static char sccsid[] = "@(#)set.c 5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)set.c 5.16 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
static Char *getinx __P((Char *, int *));
static void asx __P((Char *, int, Char *));
static Char *getinx __P((Char *, int *));
static void asx __P((Char *, int, Char *));
*getvx __P((Char *, int));
static Char *xset __P((Char *, Char ***));
static Char *operate __P((int, Char *, Char *));
static void putn1 __P((int));
*getvx __P((Char *, int));
static Char *xset __P((Char *, Char ***));
static Char *operate __P((int, Char *, Char *));
static void putn1 __P((int));
*madrof __P((Char *, struct varent *));
static void unsetv1 __P((struct varent *));
static void exportpath __P((Char **));
*madrof __P((Char *, struct varent *));
static void unsetv1 __P((struct varent *));
static void exportpath __P((Char **));
else if (p->v_left == 0)
c = p->v_right;
else {
else if (p->v_left == 0)
c = p->v_right;
else {
- for (c = p->v_left; c->v_right; c = c->v_right);
+ for (c = p->v_left; c->v_right; c = c->v_right)
+ continue;
p->v_name = c->v_name;
p->vec = c->vec;
p = c;
p->v_name = c->v_name;
p->vec = c->vec;
p = c;
-static char sccsid[] = "@(#)str.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)str.c 5.9 (Berkeley) %G%";
#endif /* not lint */
#define MALLOC_INCR 128
/*
* tc.str.c: Short string package
#endif /* not lint */
#define MALLOC_INCR 128
/*
* tc.str.c: Short string package
- * This has been a lesson of how to write buggy code!
+ * This has been a lesson of how to write buggy code!
- for (n = 0; src[n] != NULL; n++);
+ for (n = 0; src[n] != NULL; n++)
+ continue;
sdst = dst = (Char **) xmalloc((size_t) ((n + 1) * sizeof(Char *)));
for (; *src != NULL; src++)
sdst = dst = (Char **) xmalloc((size_t) ((n + 1) * sizeof(Char *)));
for (; *src != NULL; src++)
- for (n = 0; src[n] != NULL; n++);
+ for (n = 0; src[n] != NULL; n++)
+ continue;
sdst = dst = (char **) xmalloc((size_t) ((n + 1) * sizeof(char *)));
for (; *src != NULL; src++)
sdst = dst = (char **) xmalloc((size_t) ((n + 1) * sizeof(char *)));
for (; *src != NULL; src++)
register Char *sdst;
sdst = dst;
register Char *sdst;
sdst = dst;
- while (*dst++ = *src++);
+ while (*dst++ = *src++)
+ continue;
if ((*dst++ = *src++) == '\0') {
while (--n != 0)
*dst++ = '\0';
if ((*dst++ = *src++) == '\0') {
while (--n != 0)
*dst++ = '\0';
register short *sdst;
sdst = dst;
register short *sdst;
sdst = dst;
+ while (*dst++)
+ continue;
- while (*dst++ = *src++);
+ while (*dst++ = *src++)
+ continue;
return (dst);
sdst = dst;
return (dst);
sdst = dst;
+ while (*dst++)
+ continue;
if ((*dst++ = *src++) == '\0')
return(sdst);
if ((*dst++ = *src++) == '\0')
return(sdst);
+ while (--n != 0)
+ continue;
*dst = '\0';
return (sdst);
*dst = '\0';
return (sdst);
- for (n = 0; *str++; n++);
+ for (n = 0; *str++; n++)
+ continue;
s_strcmp(str1, str2)
register Char *str1, *str2;
{
s_strcmp(str1, str2)
register Char *str1, *str2;
{
- for (; *str1 && *str1 == *str2; str1++, str2++);
+ for (; *str1 && *str1 == *str2; str1++, str2++)
+ continue;
/*
* The following case analysis is necessary so that characters which look
* negative collate low against normal characters but high against the
/*
* The following case analysis is necessary so that characters which look
* negative collate low against normal characters but high against the
do {
if (*str1 != *str2) {
/*
do {
if (*str1 != *str2) {
/*
- * The following case analysis is necessary so that characters
+ * The following case analysis is necessary so that characters
* which look negative collate low against normal characters
* but high against the end-of-string NUL.
*/
* which look negative collate low against normal characters
* but high against the end-of-string NUL.
*/
+ for (p = s; *p++;)
+ continue;
n = p = (Char *) xmalloc((size_t) ((p - s) * sizeof(Char)));
n = p = (Char *) xmalloc((size_t) ((p - s) * sizeof(Char)));
+ while (*p++ = *s++)
+ continue;
cp = STRNULL;
if (!dp)
dp = STRNULL;
cp = STRNULL;
if (!dp)
dp = STRNULL;
- for (p = cp; *p++;);
- for (q = dp; *q++;);
+ for (p = cp; *p++;)
+ continue;
+ for (q = dp; *q++;)
+ continue;
ep = (Char *) xmalloc((size_t)
(((p - cp) + (q - dp) - 1) * sizeof(Char)));
ep = (Char *) xmalloc((size_t)
(((p - cp) + (q - dp) - 1) * sizeof(Char)));
- for (p = ep, q = cp; *p++ = *q++;);
- for (p--, q = dp; *p++ = *q++;);
+ for (p = ep, q = cp; *p++ = *q++;)
+ continue;
+ for (p--, q = dp; *p++ = *q++;)
+ continue;