extern int errno;
#endif
-#if defined(USG) || defined(STDC_HEADERS)
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
+#ifndef index
#define index strchr
+#endif
#else
#include <strings.h>
#endif
slash = dirpath;
while (*slash == '/')
slash++;
- while (slash = index (slash, '/'))
+ while ((slash = index (slash, '/')))
{
*slash = '\0';
if (stat (dirpath, &stats))