$NetBSD: patch-ac,v 1.6 2006/11/16 02:28:58 markd Exp $ --- f_util.c.orig 2004-01-07 08:46:08.000000000 +1300 +++ f_util.c @@ -111,15 +111,15 @@ change_directory(path) get_directory(direct) char *direct; { -#if defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) +#if defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__NetBSD__) extern char *getcwd(); #else extern char *getwd(); -#endif /* defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) */ +#endif /* defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__NetBSD__) */ -#if defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) +#if defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__NetBSD__) if (getcwd(direct, PATH_MAX) == NULL) { /* get current working dir */ file_msg("Can't get current directory"); beep(); @@ -127,7 +127,7 @@ get_directory(direct) if (getwd(direct) == NULL) { /* get current working dir */ file_msg("%s", direct); /* err msg is in direct var */ beep(); -#endif /* defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) */ +#endif /* defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__NetBSD__) */ *direct = '\0'; return 0; } @@ -782,7 +782,7 @@ uncompress_file(name) else strcpy(dirname, "."); if (access(dirname, W_OK) == 0) { /* OK - the directory is writable */ - sprintf(unc, "gunzip -q %s", name); + sprintf(unc, "gunzip -q -- %s", name); if (system(unc) != 0) file_msg("Couldn't uncompress the file: \"%s\"", unc); strcpy(name, plainname); @@ -793,7 +793,7 @@ uncompress_file(name) sprintf(tmpfile, "%s%s", TMPDIR, c); else sprintf(tmpfile, "%s/%s", TMPDIR, plainname); - sprintf(unc, "gunzip -q -c %s > %s", name, tmpfile); + sprintf(unc, "gunzip -q -c -- %s > %s", name, tmpfile); if (system(unc) != 0) file_msg("Couldn't uncompress the file: \"%s\"", unc); file_msg ("Uncompressing file %s in %s because it is in a read-only directory",