sh.misc.c (tcsh-6.22.02) | : | sh.misc.c (tcsh-6.22.03) | ||
---|---|---|---|---|
skipping to change at line 533 | skipping to change at line 533 | |||
return (0); | return (0); | |||
} | } | |||
} | } | |||
#ifndef WINNT_NATIVE | #ifndef WINNT_NATIVE | |||
char * | char * | |||
areadlink(const char *path) | areadlink(const char *path) | |||
{ | { | |||
char *buf; | char *buf; | |||
size_t size; | size_t size; | |||
ssize_t res; | ssize_t res; | |||
#ifdef __IBMC__ | ||||
/* | ||||
* Prevent infinite recursion. Someone should tell me how to expand | ||||
* these... | ||||
*/ | ||||
size_t i; | ||||
static const char *vars[] = { | ||||
"/$VERSION", | ||||
"/$SYSNAME", | ||||
"/$SYSSYMR", | ||||
"/$SYSSYMA", | ||||
}; | ||||
for (i = 0; i < sizeof(vars) / sizeof(vars[0]); i++) { | ||||
if (strcmp(vars[i], path) == 0) { | ||||
return NULL; | ||||
} | ||||
} | ||||
#endif | ||||
size = MAXPATHLEN + 1; | size = MAXPATHLEN + 1; | |||
buf = xmalloc(size); | buf = xmalloc(size); | |||
while ((size_t)(res = readlink(path, buf, size)) == size) { | while ((size_t)(res = readlink(path, buf, size)) == size) { | |||
size *= 2; | size *= 2; | |||
buf = xrealloc(buf, size); | buf = xrealloc(buf, size); | |||
} | } | |||
if (res == -1) { | if (res == -1) { | |||
int err; | int err; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 18 lines changed or added |