| version 1.26, 1999/03/16 18:13:45 |
version 1.27, 1999/03/22 03:28:09 |
|
|
| cgetset(ent) |
cgetset(ent) |
| const char *ent; |
const char *ent; |
| { |
{ |
| |
const char *source, *check; |
| |
char *dest; |
| |
|
| if (ent == NULL) { |
if (ent == NULL) { |
| if (toprec) |
if (toprec) |
| free(toprec); |
free(toprec); |
|
|
| return (-1); |
return (-1); |
| } |
} |
| gottoprec = 0; |
gottoprec = 0; |
| (void)strcpy(toprec, ent); /* XXX: strcpy is safe */ |
|
| |
source=ent; |
| |
dest=toprec; |
| |
while (*source) { /* Strip whitespace */ |
| |
*dest++ = *source++; /* Do not check first field */ |
| |
while (*source == ':') { |
| |
check=source+1; |
| |
while (*check && isspace(*check) || |
| |
(*check=='\\' && isspace(check[1]))) |
| |
++check; |
| |
if( *check == ':' ) |
| |
source=check; |
| |
else |
| |
break; |
| |
|
| |
} |
| |
} |
| |
*dest=0; |
| |
|
| return (0); |
return (0); |
| } |
} |
| |
|