projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update for the 4.4BSD manuals
[unix-history]
/
usr
/
src
/
bin
/
csh
/
misc.c
diff --git
a/usr/src/bin/csh/misc.c
b/usr/src/bin/csh/misc.c
index
13232d0
..
f5f92ec
100644
(file)
--- a/
usr/src/bin/csh/misc.c
+++ b/
usr/src/bin/csh/misc.c
@@
-1,12
+1,12
@@
/*-
/*-
- * Copyright (c) 1980, 1991
The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1991
, 1993
+ *
The Regents of the University of California.
All rights reserved.
*
* %sccs.include.redist.c%
*/
#ifndef lint
*
* %sccs.include.redist.c%
*/
#ifndef lint
-static char sccsid[] = "@(#)misc.c
5.14
(Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c
8.1
(Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
@@
-56,9
+56,11
@@
strsave(s)
if (s == NULL)
s = "";
if (s == NULL)
s = "";
- for (p = s; *p++;);
+ 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++);
+ while ((*p++ = *s++) != '\0')
+ continue;
return (n);
}
return (n);
}
@@
-80,7
+82,7
@@
blkpr(fp, av)
{
for (; *av; av++) {
{
for (; *av; av++) {
- (void) fprintf(fp, "%s",
short2
str(*av));
+ (void) fprintf(fp, "%s",
vis_
str(*av));
if (av[1])
(void) fprintf(fp, " ");
}
if (av[1])
(void) fprintf(fp, " ");
}
@@
-104,7
+106,7
@@
blkcpy(oav, bv)
{
register Char **av = oav;
{
register Char **av = oav;
- while (
*av++ = *bv++
)
+ while (
(*av++ = *bv++) != NULL
)
continue;
return (oav);
}
continue;
return (oav);
}
@@
-175,11
+177,15
@@
strspl(cp, dp)
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;
return (ep);
}
return (ep);
}
@@
-265,7
+271,7
@@
dcopy(i, j)
register int i, j;
{
register int i, j;
{
- if (i == j || i < 0 ||
j < 0 && i > 2
)
+ if (i == j || i < 0 ||
(j < 0 && i > 2)
)
return (i);
if (j >= 0) {
(void) dup2(i, j);
return (i);
if (j >= 0) {
(void) dup2(i, j);
@@
-303,10
+309,10
@@
lshift(v, c)
register Char **v;
register int c;
{
register Char **v;
register int c;
{
- register Char **u
= v
;
+ register Char **u;
-
while (*u && --c >= 0
)
- xfree((ptr_t) *
u++
);
+
for (u = v; *u && --c >= 0; u++
)
+ xfree((ptr_t) *
u
);
(void) blkcpy(v, u);
}
(void) blkcpy(v, u);
}
@@
-348,7
+354,7
@@
strend(cp)
return (cp);
}
return (cp);
}
-#endif
/* SHORT_STRINGS */
+#endif /* SHORT_STRINGS */
Char *
strip(cp)
Char *
strip(cp)
@@
-358,7
+364,7
@@
strip(cp)
if (!cp)
return (cp);
if (!cp)
return (cp);
- while (
*dp++ &= TRIM
)
+ while (
(*dp++ &= TRIM) != '\0'
)
continue;
return (cp);
}
continue;
return (cp);
}
@@
-368,7
+374,7
@@
udvar(name)
Char *name;
{
Char *name;
{
- setname(
short2
str(name));
+ setname(
vis_
str(name));
stderror(ERR_NAME | ERR_UNDVAR);
}
stderror(ERR_NAME | ERR_UNDVAR);
}