head	1.3;
access;
symbols
	pkgsrc-2013Q2:1.3.0.54
	pkgsrc-2013Q2-base:1.3
	pkgsrc-2012Q4:1.3.0.52
	pkgsrc-2012Q4-base:1.3
	pkgsrc-2011Q4:1.3.0.50
	pkgsrc-2011Q4-base:1.3
	pkgsrc-2011Q2:1.3.0.48
	pkgsrc-2011Q2-base:1.3
	pkgsrc-2009Q4:1.3.0.46
	pkgsrc-2009Q4-base:1.3
	pkgsrc-2008Q4:1.3.0.44
	pkgsrc-2008Q4-base:1.3
	pkgsrc-2008Q3:1.3.0.42
	pkgsrc-2008Q3-base:1.3
	cube-native-xorg:1.3.0.40
	cube-native-xorg-base:1.3
	pkgsrc-2008Q2:1.3.0.38
	pkgsrc-2008Q2-base:1.3
	pkgsrc-2008Q1:1.3.0.36
	pkgsrc-2008Q1-base:1.3
	pkgsrc-2007Q4:1.3.0.34
	pkgsrc-2007Q4-base:1.3
	pkgsrc-2007Q3:1.3.0.32
	pkgsrc-2007Q3-base:1.3
	pkgsrc-2007Q2:1.3.0.30
	pkgsrc-2007Q2-base:1.3
	pkgsrc-2007Q1:1.3.0.28
	pkgsrc-2007Q1-base:1.3
	pkgsrc-2006Q4:1.3.0.26
	pkgsrc-2006Q4-base:1.3
	pkgsrc-2006Q3:1.3.0.24
	pkgsrc-2006Q3-base:1.3
	pkgsrc-2006Q2:1.3.0.22
	pkgsrc-2006Q2-base:1.3
	pkgsrc-2006Q1:1.3.0.20
	pkgsrc-2006Q1-base:1.3
	pkgsrc-2005Q4:1.3.0.18
	pkgsrc-2005Q4-base:1.3
	pkgsrc-2005Q3:1.3.0.16
	pkgsrc-2005Q3-base:1.3
	pkgsrc-2005Q2:1.3.0.14
	pkgsrc-2005Q2-base:1.3
	pkgsrc-2005Q1:1.3.0.12
	pkgsrc-2005Q1-base:1.3
	pkgsrc-2004Q4:1.3.0.10
	pkgsrc-2004Q4-base:1.3
	pkgsrc-2004Q3:1.3.0.8
	pkgsrc-2004Q3-base:1.3
	pkgsrc-2004Q2:1.3.0.6
	pkgsrc-2004Q2-base:1.3
	pkgsrc-2004Q1:1.3.0.4
	pkgsrc-2004Q1-base:1.3
	pkgsrc-2003Q4:1.3.0.2
	pkgsrc-2003Q4-base:1.3
	buildlink2-base:1.3
	netbsd-1-5-RELEASE:1.2
	netbsd-1-4-PATCH003:1.2
	netbsd-1-4-PATCH002:1.2
	comdex-fall-1999:1.1;
locks; strict;
comment	@# @;


1.3
date	2000.12.15.00.41.05;	author wiz;	state dead;
branches;
next	1.2;

1.2
date	99.11.26.22.12.37;	author hubertf;	state Exp;
branches;
next	1.1;

1.1
date	99.09.29.00.41.52;	author christos;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Move packages from 'net' into new 'chat' category. Add chat to main Makefile.
@
text
@$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");
@


1.2
log
@Split patches and add code to print time in front of each line.
Needs to be switched on from .icbrc: oset printtime true.
Bump version to 5.0.9pl1 for that.
@
text
@d1 1
a1 1
$NetBSD$
@


1.1
log
@oops forgot one lunix patch
@
text
@d3 52
a54 76
*** icb/serverlist.c.orig	Tue Sep 28 19:14:47 1999
--- icb/serverlist.c	Tue Sep 28 19:15:09 1999
***************
*** 23,29 ****
  #ifdef sgi
  #undef SYSV
  #endif
! #if !defined(SYSV) && !(defined(BSD) && BSD >= 199306)
  	getwd(pwd);
  #else /* SYSV */
  	getcwd(pwd, MAXPATHLEN+1);
--- 23,29 ----
  #ifdef sgi
  #undef SYSV
  #endif
! #if !defined(SYSV) && !(defined(BSD) && BSD >= 199306) && !defined(__linux__)
  	getwd(pwd);
  #else /* SYSV */
  	getcwd(pwd, MAXPATHLEN+1);
*** icb/unix.c.orig	Tue Sep 28 19:14:47 1999
--- icb/unix.c	Tue Sep 28 19:15:42 1999
***************
*** 4,9 ****
--- 4,11 ----
  /* This file contains routines that are unix dependent. */
  /* Eventually, most unixisms should be moved here. */
  
+ #include <sys/types.h>
+ #include <sys/param.h>
  #include <stdio.h>
  #include "icb.h"
  #include "externs.h"
***************
*** 13,18 ****
--- 15,28 ----
  #undef stty
  #undef gtty
  
+ #if defined(__linux__)
+ #include <termios.h>
+ #include <sys/ioctl.h>
+ #define TTYSTRUCT termios
+ #define stty(fd,buf) tcgetattr((fd), (buf))
+ #define gtty(fd,buf) tcsetattr((fd), TCSANOW, (buf))
+ #define SYSV
+ #else 
  #ifndef SYSV
  
  #ifdef linux
***************
*** 30,35 ****
--- 40,46 ----
  #define stty(fd,buf) ioctl((fd),TCSETA,(buf))
  #define gtty(fd,buf) ioctl((fd),TCGETA,(buf))
  #endif /* SYSV */
+ #endif /* __linux__ */
  
  char *getlogin();
  
***************
*** 183,189 ****
  
  getwinsize()
  {
! #ifndef NOWINSIZE
  	struct winsize win;
  
  	/* get tty settings */
--- 194,200 ----
  
  getwinsize()
  {
! #ifdef TIOCGWINSZ
  	struct winsize win;
  
  	/* get tty settings */
@

