From a80481a5e7c53064733cd04949ab397a8af71b42 Mon Sep 17 00:00:00 2001 From: warwick Date: Thu, 11 Sep 2003 04:22:55 +0000 Subject: [PATCH] Avoid unixisms. On MacOSX, we cannot assume that the user will use a command-line option to set their name. Normally they will type a name if asked - but they won't be asked if we pull their username as a name. --- sys/unix/unixmain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 6d65b27bb..79cb24ba8 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -478,6 +478,10 @@ whoami() { */ register char *s; +#if defined(__APPLE__) + /* Unixisms just confuse the user */ + (void) strncpy(plname, "player", sizeof(plname)-1); +#else if (*plname) return FALSE; if(/* !*plname && */ (s = nh_getenv("USER"))) (void) strncpy(plname, s, sizeof(plname)-1); @@ -485,6 +489,7 @@ whoami() { (void) strncpy(plname, s, sizeof(plname)-1); if(!*plname && (s = getlogin())) (void) strncpy(plname, s, sizeof(plname)-1); +#endif return TRUE; } -- 2.40.0