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) if (autologin)
login(argv[1]); 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 * 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. * 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; overbose = verbose;
if (debug == 0) if (debug == 0)
verbose = -1; verbose = -1;
if (command("SYST") == COMPLETE && overbose) { if (command("SYST") == COMPLETE && overbose && strlen(reply_string) > 4) {
char *cp, c; char *cp, *p;
cp = strchr(reply_string+4, ' ');
cp = strdup(reply_string + 4);
if (cp == NULL) if (cp == NULL)
cp = strchr(reply_string+4, '\r'); errx(1, "strdup: out of memory");
if (cp) { p = strchr(cp, ' ');
if (cp[-1] == '.') if (p == NULL)
cp--; p = strchr(cp, '\r');
c = *cp; if (p) {
*cp = '\0'; if (p[-1] == '.')
p--;
*p = '\0';
} }
printf("Remote system type is %s.\n", printf("Remote system type is %s.\n", cp);
reply_string+4); free(cp);
if (cp)
*cp = c;
} }
if (!strncmp(reply_string, "215 UNIX Type: L8", 17)) { if (!strncmp(reply_string, "215 UNIX Type: L8", 17)) {
if (proxy) if (proxy)