| 1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* Get additional command arguments from file or environment. |
| 6 |
+ |
* |
| 7 |
+ |
* External symbols declared in rtio.h |
| 8 |
|
*/ |
| 9 |
|
|
| 10 |
< |
#include "standard.h" |
| 10 |
> |
#include "copyright.h" |
| 11 |
|
|
| 12 |
+ |
#include <errno.h> |
| 13 |
+ |
#include <string.h> |
| 14 |
+ |
|
| 15 |
+ |
#include "rtio.h" |
| 16 |
+ |
#include "rtmisc.h" |
| 17 |
+ |
|
| 18 |
+ |
|
| 19 |
|
#define MAXARGEXP 512 /* maximum argument expansion */ |
| 20 |
|
|
| 21 |
|
/* set the following to suit, -1 to disable */ |
| 23 |
|
int filexpchr = '@'; /* file expansion character */ |
| 24 |
|
|
| 25 |
|
|
| 26 |
+ |
int |
| 27 |
|
expandarg(acp, avp, n) /* expand list at argument n */ |
| 28 |
|
int *acp; |
| 29 |
|
register char ***avp; |
| 51 |
|
if (newav == NULL) |
| 52 |
|
return(-1); |
| 53 |
|
/* copy preceeding arguments */ |
| 54 |
< |
bcopy((char *)*avp, (char *)newav, n*sizeof(char *)); |
| 54 |
> |
memcpy((void *)newav, (void *)*avp, n*sizeof(char *)); |
| 55 |
|
/* copy expanded argument */ |
| 56 |
< |
bcopy((char *)ave, (char *)(newav+n), ace*sizeof(char *)); |
| 56 |
> |
memcpy((void *)(newav+n), (void *)ave, ace*sizeof(char *)); |
| 57 |
|
/* copy trailing arguments + NULL */ |
| 58 |
< |
bcopy((char *)(*avp+n+1), (char *)(newav+n+ace), (*acp-n)*sizeof(char *)); |
| 58 |
> |
memcpy((void *)(newav+n+ace), (void *)(*avp+n+1), (*acp-n)*sizeof(char *)); |
| 59 |
|
/* free old list */ |
| 60 |
|
bfree((char *)*avp, (*acp+1)*sizeof(char *)); |
| 61 |
|
/* assign new list */ |