diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2000-08-27 02:44:33 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2000-08-27 02:44:33 +0000 |
commit | d451ac61eb4d87793f98171b11a11f88a0792ef1 (patch) | |
tree | 933d88a5cd2dc22aa8fbd7eabcc26a129ea7f49f /net-im/icb | |
parent | be3d0e365e65c595ead97a2df79e31a043af2913 (diff) | |
download | ports-d451ac61eb4d87793f98171b11a11f88a0792ef1.tar.gz ports-d451ac61eb4d87793f98171b11a11f88a0792ef1.zip |
Notes
Diffstat (limited to 'net-im/icb')
-rw-r--r-- | net-im/icb/files/patch-serverlist.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/net-im/icb/files/patch-serverlist.c b/net-im/icb/files/patch-serverlist.c new file mode 100644 index 000000000000..914c877d9993 --- /dev/null +++ b/net-im/icb/files/patch-serverlist.c @@ -0,0 +1,54 @@ +$NetBSD: patch-ai,v 1.2 1999/11/26 22:12:37 hubertf Exp $ + +diff -x *.orig -urN ./icb/serverlist.c /usr/pkgsrc/net/icb/work.i386.unpatched/icb-5.0.9/icb/serverlist.c +--- ./icb/serverlist.c Fri Feb 24 22:20:29 1995 ++++ /usr/pkgsrc/net/icb/work.i386.unpatched/icb-5.0.9/icb/serverlist.c Fri Nov 26 22:56:29 1999 +@@ -1,4 +1,6 @@ + #include <stdio.h> ++#include <stdlib.h> ++#include <pwd.h> + #include <sys/types.h> + #include <sys/stat.h> + #include "icb.h" +@@ -14,15 +16,14 @@ + FILE *openserverfile() + { + struct stat statbuf; +- char *personalsl; +- char command[256]; +- char pwd[256]; ++ char *personalsl, *home; ++ char pwd[MAXPATHLEN+1]; + FILE *ret; + + #ifdef sgi + #undef SYSV + #endif +-#ifndef SYSV ++#if !defined(SYSV) && !(defined(BSD) && BSD >= 199306) && !defined(__linux__) + getwd(pwd); + #else /* SYSV */ + getcwd(pwd, MAXPATHLEN+1); +@@ -30,11 +31,20 @@ + #ifdef sgi + #define SYSV + #endif +- chdir(getenv("HOME")); ++ if ((home = getenv("HOME")) == NULL) { ++ struct passwd *pw; ++ if ((pw = getpwuid(getuid())) == NULL) ++ home = "."; ++ home = pw->pw_dir; ++ } ++ chdir(home); + if (!stat(PERSONALSL,&statbuf)) + { +- sprintf(command,"/bin/cat %s %s\n", PERSONALSL, SERVERLIST); ++ char *command = malloc(strlen("/bin/cat \n") + ++ strlen(PERSONALSL) + strlen(SERVERLIST) + 1); ++ sprintf(command, "/bin/cat %s %s\n", PERSONALSL, SERVERLIST); + ret= popen(command,"r"); ++ free(command); + } + else + ret= fopen(SERVERLIST,"r"); |