MacOS is also a unix that doesn't define __unix__/unix

While here, rewrite this part of the function to not modify that
string, but rather take a copy of it and them modify is, all this just
to pacify gcc


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14739 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-04-04 18:16:00 +00:00
parent 2629865bf9
commit a9cb9acffa

View File

@@ -142,7 +142,7 @@ setpeer(int argc, char **argv)
if (autologin)
login(argv[1]);
#if (defined(unix) || defined(__unix__) || defined(__unix) || defined(_AIX) || defined(_CRAY) || defined(__NetBSD__)) && NBBY == 8
#if (defined(unix) || defined(__unix__) || defined(__unix) || defined(_AIX) || defined(_CRAY) || defined(__NetBSD__) || defined(__APPLE__)) && NBBY == 8
/*
* this ifdef is to keep someone form "porting" this to an incompatible
* system and not checking this out. This way they have to think about it.
@@ -150,22 +150,23 @@ setpeer(int argc, char **argv)
overbose = verbose;
if (debug == 0)
verbose = -1;
if (command("SYST") == COMPLETE && overbose) {
char *cp, c;
cp = strchr(reply_string+4, ' ');
if (command("SYST") == COMPLETE && overbose && strlen(reply_string) > 4) {
char *cp, *p;
cp = strdup(reply_string + 4);
if (cp == NULL)
cp = strchr(reply_string+4, '\r');
if (cp) {
if (cp[-1] == '.')
cp--;
c = *cp;
*cp = '\0';
errx(1, "strdup: out of memory");
p = strchr(cp, ' ');
if (p == NULL)
p = strchr(cp, '\r');
if (p) {
if (p[-1] == '.')
p--;
*p = '\0';
}
printf("Remote system type is %s.\n",
reply_string+4);
if (cp)
*cp = c;
printf("Remote system type is %s.\n", cp);
free(cp);
}
if (!strncmp(reply_string, "215 UNIX Type: L8", 17)) {
if (proxy)