Mon May 13 12:03:03 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+ * posix/glob.c [_AMIGA]: Don't include <pwd.h>.
+ (glob): Remove bogus & in call to globfree.
+ [_AMIGA]: Use AmigaDOS file name conventions.
+
* time/Makefile (zonenames): Target removed.
(extra-objs): Remove it from here.
Include the z.* files directly instead of including zonenames; use
#endif
#endif
+#ifndef _AMIGA
#include <pwd.h>
+#endif
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
extern int errno;
#ifdef __GNUC__
__inline
#endif
+#ifndef __SASC
static char *
my_realloc (p, n)
char *p;
return (char *) realloc (p, n);
}
#define realloc my_realloc
-#endif
+#endif /* __SASC */
+#endif /* __GNU_LIBRARY__ */
#if !defined(__alloca) && !defined(__GNU_LIBRARY__)
if (onealt == NULL)
{
if (!(flags & GLOB_APPEND))
- globfree (&pglob);
+ globfree (pglob);
return GLOB_NOSPACE;
}
#endif
if (filename == NULL)
{
filename = pattern;
+#ifdef _AMIGA
+ dirname = (char *) "";
+#else
dirname = (char *) ".";
+#endif
dirlen = 0;
}
else if (filename == pattern)
{
/* Look up home directory. */
dirname = getenv ("HOME");
+#ifdef _AMIGA
+ if (dirname == NULL || dirname[0] == '\0')
+ dirname = "SYS:";
+#else
if (dirname == NULL || dirname[0] == '\0')
{
extern char *getlogin __P ((void));
}
if (dirname == NULL || dirname[0] == '\0')
dirname = (char *) "~"; /* No luck. */
+#endif
}
else
{
+#ifdef _AMIGA
+ if (dirname == NULL || dirname[0] == '\0')
+ dirname = "SYS:";
+#else
/* Look up specific user's home directory. */
struct passwd *p = getpwnam (dirname + 1);
if (p != NULL)
dirname = p->pw_dir;
+#endif
}
}
if (fnmatch (pattern, name,
(!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) |
- ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0)
+ ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
+#ifdef _AMIGA
+ | FNM_CASEFOLD
+#endif
+ ) == 0)
{
struct globlink *new
= (struct globlink *) __alloca (sizeof (struct globlink));