head	1.4;
access;
symbols
	RELEASE_4_9_0:1.3
	RELEASE_5_1_0:1.2
	RELEASE_4_8_0:1.2
	RELEASE_5_0_0:1.2
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1
	RELEASE_4_3_0:1.1
	RELEASE_4_2_0:1.1
	RELEASE_4_1_1:1.1
	RELEASE_4_1_0:1.1
	RELEASE_3_5_0:1.1
	RELEASE_4_0_0:1.1;
locks; strict;
comment	@# @;


1.4
date	2003.09.24.15.03.39;	author krion;	state dead;
branches;
next	1.3;

1.3
date	2003.08.07.17.26.45;	author oliver;	state Exp;
branches;
next	1.2;

1.2
date	2002.10.21.19.54.41;	author wollman;	state Exp;
branches;
next	1.1;

1.1
date	99.12.23.18.50.23;	author steve;	state Exp;
branches;
next	;


desc
@@


1.4
log
@- Update to version 3.99.4

PR:		57094
Submitted by:	Ports Fury
@
text
@--- src/print.c.orig	Thu Apr  4 15:25:04 1996
+++ src/print.c	Thu Aug  7 18:42:43 2003
@@@@ -5,7 +5,8 @@@@
 
 #include <errno.h>
 #include <ctype.h>
-#include <varargs.h>
+#include <string.h>
+#include <stdarg.h>
 
 #ifdef FLUSH_TIOCFLUSH
 #  include <sys/ioctl.h>
@@@@ -95,15 +96,11 @@@@
 #endif
 
 /*VARARGS0*/
-Printf (va_alist) va_dcl {
+Printf (Object port, char *fmt, ...) {
     va_list args;
-    Object port;
-    char *fmt;
     char buf[1024];
 
-    va_start (args);
-    port = va_arg (args, Object);
-    fmt = va_arg (args, char *);
+    va_start (args, fmt);
     if (PORT(port)->flags & P_STRING) {
 	vsprintf (buf, fmt, args);
 	Print_String (port, buf, strlen (buf));
@@@@ -555,10 +552,6 @@@@
     char *p;
     register c;
     char buf[256];
-    extern sys_nerr;
-#ifndef __bsdi__
-    extern char *sys_errlist[];
-#endif
     GC_Node;
     Alloca_Begin;
 
@@@@ -573,13 +566,13 @@@@
 	    } else if (c == '%') {
 		Print_Char (port, '\n');
 	    } else if (c == 'e' || c == 'E') {
-		if (Saved_Errno > 0 && Saved_Errno < sys_nerr) {
-		    s = sys_errlist[Saved_Errno];
-		    sprintf (buf, "%c%s", isupper (*s) ? tolower (*s) :
-			*s, s+1);
-		} else {
-		    sprintf (buf, "error %d", Saved_Errno);
+		if (strerror_r(Saved_Errno, buf, sizeof(buf)) != 0) {
+			snprintf(buf, sizeof(buf) - 1, "unknown error: %d",
+				Saved_Errno);
+			buf[sizeof(buf) - 1] = '\0';
 		}
+		if (isupper(buf[0]))
+			buf[0] = tolower(buf[0]);
 		Print_Object (Make_String (buf, strlen (buf)), port,
 		    c == 'E', 0, 0);
 	    } else {
@


1.3
log
@fix build on CURRENT
 - s|varargs.h|stdarg.h|
 - s|void va_start(va_list ap);|void va_start(va_list ap, last);|g
@
text
@@


1.2
log
@Use strerror_r() rather than trying to hack our own.  This avoids
dealing with the nonstandardized types of sys_nerr and sys_errlst[]
and works for both -current and recent (>=4.5) values of -stable.
The previous implementation knew too much about sys_nerr for its own
good.
@
text
@d1 3
a3 3
--- ../../work.orig/elk-3.0/src/print.c	Thu Apr  4 08:25:04 1996
+++ src/print.c	Mon Oct 21 15:48:05 2002
@@@@ -5,6 +5,7 @@@@
d7 1
d9 1
a9 1
 #include <varargs.h>
d12 20
a31 1
@@@@ -555,10 +556,6 @@@@
d42 1
a42 1
@@@@ -573,13 +570,13 @@@@
@


1.1
log
@Allow the value of CC to be overridden.

PR:		15397
Submitted by:	James Andariese <james@@ja.ath.cx>
@
text
@d1 4
a4 3
--- src/print.c.orig	Thu Apr  4 07:25:04 1996
+++ src/print.c	Sun Dec 12 16:29:07 1999
@@@@ -6,6 +6,7 @@@@
d7 1
a8 1
+#include <sys/param.h>
d11 2
a12 2
 #  include <sys/ioctl.h>
@@@@ -556,7 +557,7 @@@@
d15 1
a15 1
     extern sys_nerr;
d17 2
a18 3
+#if !(defined(BSD) && (BSD >= 199306))
     extern char *sys_errlist[];
 #endif
d20 22
@

