static char *sccsid
= "@(#)misc.c 4.3 %G%";
return (c
>= 'a' && c
<= 'z' || c
>= 'A' && c
<= 'Z' || c
== '_');
return (c
>= '0' && c
<= '9');
return (letter(c
) || digit(c
));
static char *av
[2] = {0, 0};
printf("i=%d, j=%d: ", i
/j
, j
);
printf("Out of memory\n");
chdir("/usr/bill/cshcore");
register char **av
= oav
;
register char **av
= av0
;
register int len
= blklen(v
) + 1;
register char **newv
= (char **) calloc(len
, sizeof (char **));
register char *ep
= calloc(1, strlen(cp
) + strlen(dp
) + 1);
register char **up
, **vp
;
register char **wp
= (char **) calloc(blklen(up
) + blklen(vp
) + 1, sizeof (char **));
* This routine is called after an error to close up
* any units which may have been left open accidentally.
for (f
= 0; f
< NOFILE
; f
++)
if (f
!= SHIN
&& f
!= SHOUT
&& f
!= SHDIAG
&& f
!= OLDSTD
&&
* Close files before executing a file.
* We could be MUCH more intelligent, since (on a version 7 system)
* we need only close files here during a source, the other
* shell fd's being in units 16-19 which are closed automatically!
SHIN
= 0; SHOUT
= 1; SHDIAG
= 2; OLDSTD
= 0;
for (f
= 3; f
< NOFILE
; f
++)
close(0), close(1), close(2);
* Move descriptor i to j.
* If j is -1 then we just want to get i to a safe place,
* i.e. to a unit > 2. This also happens in dcopy.
if (i
== j
|| i
< 0 || j
< 0 && i
> 2)
register char *to
, *from
;
* Left shift a command argument list, discarding
* the first c arguments. Used in "shift" commands
* as well as by commands like "repeat".
while (*cp
&& digit(*cp
))
register char **nv
= (char **) calloc(blklen(v
) + 1, sizeof (char **));
bferr("Undefined variable");
register char *sub
, *str
;