static Direntry_t *
my_readdir(DIR *d)
{
+#ifndef NETWARE
return PerlDir_read(d);
+#else
+ return (DIR *)PerlDir_read(d);
+#endif
}
#else
-#define my_readdir readdir
+
+/* ReliantUNIX (OS formerly known as SINIX) defines readdir
+ * in LFS-mode to be a 64-bit version of readdir. */
+
+# ifdef sinix
+static Direntry_t * my_readdir(DIR*);
+
+static Direntry_t *
+my_readdir(DIR *d)
+{
+ return readdir(d);
+}
+# else
+
+# define my_readdir readdir
+
+# endif
+
#endif
#ifdef MACOS_TRADITIONAL
#ifndef MACOS_TRADITIONAL
patnext = (U8 *) pattern;
#endif
+ /* TODO: GLOB_APPEND / GLOB_DOOFFS aren't supported yet */
+#if 0
if (!(flags & GLOB_APPEND)) {
pglob->gl_pathc = 0;
pglob->gl_pathv = NULL;
if (!(flags & GLOB_DOOFFS))
pglob->gl_offs = 0;
}
+#else
+ pglob->gl_pathc = 0;
+ pglob->gl_pathv = NULL;
+ pglob->gl_offs = 0;
+#endif
pglob->gl_flags = flags & ~GLOB_MAGCHAR;
pglob->gl_errfunc = errfunc;
pglob->gl_matchc = 0;
/* We operate on a copy of the pattern */
len = strlen(pattern);
- New(0, new_pat, len + 1, char);
+ Newx(new_pat, len + 1, char);
if (new_pat == NULL)
return (GLOB_NOSPACE);
static const Char *
globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
{
- struct passwd *pwd;
char *h;
const Char *p;
Char *b, *eb;
/* Copy up to the end of the string or / */
eb = &patbuf[patbuf_len - 1];
for (p = pattern + 1, h = (char *) patbuf;
- h < (char*)eb && *p && *p != BG_SLASH; *h++ = *p++)
+ h < (char*)eb && *p && *p != BG_SLASH; *h++ = (char)*p++)
;
*h = BG_EOS;
*/
if ((h = getenv("HOME")) == NULL) {
#ifdef HAS_PASSWD
+ struct passwd *pwd;
if ((pwd = getpwuid(getuid())) == NULL)
return pattern;
else
* Expand a ~user
*/
#ifdef HAS_PASSWD
+ struct passwd *pwd;
if ((pwd = getpwnam((char*) patbuf)) == NULL)
return pattern;
else
if (pglob->gl_pathv)
pathv = Renew(pglob->gl_pathv,newsize,char*);
else
- New(0,pathv,newsize,char*);
+ Newx(pathv,newsize,char*);
if (pathv == NULL) {
if (pglob->gl_pathv) {
Safefree(pglob->gl_pathv);
;
len = (STRLEN)(p - path);
*limitp += len;
- New(0, copy, p-path, char);
+ Newx(copy, p-path, char);
if (copy != NULL) {
if (g_Ctoc(path, copy, len)) {
Safefree(copy);
g_Ctoc(register const Char *str, char *buf, STRLEN len)
{
while (len--) {
- if ((*buf++ = *str++) == BG_EOS)
+ if ((*buf++ = (char)*str++) == BG_EOS)
return (0);
}
return (1);
#ifdef MACOS_TRADITIONAL
-/* Replace the last occurence of the pattern ":[^:]+::", e.g. ":lib::",
+/* Replace the last occurrence of the pattern ":[^:]+::", e.g. ":lib::",
with a single ':', if possible. It is not an error, if the pattern
doesn't match (we return -1), but if there are two consecutive colons
'::', there must be a preceding ':[^:]+'. Hence, a volume path like