*BSD News Article 8569


Return to BSD News archive

Xref: sserve comp.unix.bsd:8625 alt.security.pgp:75
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!uunet!mcsun!fuug!kiae!demos!newsserv
From: "Andrew A. Chernov, Black Mage" <ache@astral.msk.su>
Newsgroups: comp.unix.bsd,alt.security.pgp
Subject: [386bsd] right patch for pgp port
Date: Mon, 07 Dec 92 00:44:55 +0300
Distribution: world
Organization: Ha-oh-lahm Yetzirah
Message-ID: <LHNHd8h0MT@astral.msk.su>
Sender: news-service@newcom.kiae.su
Reply-To: ache@astral.msk.su
Lines: 101

Hi.
Recently I see in news some patch for pgp port to 386bsd.
I check it and shure that it is only partial and non-elegant solution.
Main problem are that 386bsd's ctype.h incorrect define tolower
and toupper. This is not for pgp only but for other programs too,
so we need to correct ctype.h instead of pgp in this case.

This patch touch:
	/usr/include/ctype.h (386bsd bug fix)
	fileio.c
	makefile.unx
Last two file fixes also different with previously posted patch.

*** /usr/include/ctype.h.was	Sat Feb 29 03:13:14 1992
--- /usr/include/ctype.h	Sun Dec  6 23:49:03 1992
***************
*** 59,66 ****
  #define	isgraph(c)	((_ctype_ + 1)[c] & (_P|_U|_L|_N))
  #define	iscntrl(c)	((_ctype_ + 1)[c] & _C)
  #define	isascii(c)	((unsigned)(c) <= 0177)
! #define	toupper(c)	((c) - 'a' + 'A')
! #define	tolower(c)	((c) - 'A' + 'a')
  #define	toascii(c)	((c) & 0177)
  
  #endif /* !_CTYPE_H_ */
--- 59,68 ----
  #define	isgraph(c)	((_ctype_ + 1)[c] & (_P|_U|_L|_N))
  #define	iscntrl(c)	((_ctype_ + 1)[c] & _C)
  #define	isascii(c)	((unsigned)(c) <= 0177)
! #define _toupper(c)     ((c) - 'a' + 'A')
! #define _tolower(c)     ((c) - 'A' + 'a')
! #define toupper(c)      (islower(c) ? _toupper(c) : (c))
! #define tolower(c)      (isupper(c) ? _tolower(c) : (c))
  #define	toascii(c)	((c) & 0177)
  
  #endif /* !_CTYPE_H_ */
*** fileio.c.was	Mon Aug 31 05:02:46 1992
--- fileio.c	Sun Dec  6 23:59:49 1992
***************
*** 250,257 ****
--- 250,261 ----
  #ifndef MAX_NAMELEN
  #if defined(AMIGA) || defined(NeXT)
  #define	MAX_NAMELEN	255
+ #else
+ #ifdef FILENAME_MAX
+ #define MAX_NAMELEN     FILENAME_MAX
  #endif
  #endif
+ #endif
  
  void truncate_name(char *path, int ext_len)
  {	/* truncate the filename so that an extension can be tacked on. */
***************
*** 260,266 ****
  	int namemax;
  
  #ifdef MAX_NAMELEN	/* overrides the use of pathconf() */
! 	namemax = MAX_NAMELEN
  #else
  #ifdef _PC_NAME_MAX
  	strcpy(dir, path);
--- 264,270 ----
  	int namemax;
  
  #ifdef MAX_NAMELEN	/* overrides the use of pathconf() */
! 	namemax = MAX_NAMELEN;
  #else
  #ifdef _PC_NAME_MAX
  	strcpy(dir, path);
*** makefile.unx.was	Thu Sep  3 00:27:00 1992
--- makefile.unx	Mon Dec  7 00:01:52 1992
***************
*** 60,65 ****
--- 60,66 ----
  	@echo "  \"make sysv_386\" for SVR4 386 with asm primitives"
  	@echo "  \"make x286\"     for XENIX/286 with asm primitives and unproto"
  	@echo "  \"make ultrix\"   for DEC 4.2BSD Ultrix"
+ 	@echo "  \"make 386bsd\"   for Public Domain 386bsd"
  	@echo "  \"make rs6000\"   for RS6000 AIX"
  
  
***************
*** 93,98 ****
--- 94,103 ----
  linux:
  	$(MAKE) all CC=gcc LD=gcc OBJS_EXT=80386.o \
  	CFLAGS="-O -DUNIX -DUNIT32"
+ 
+ 386bsd:
+ 	$(MAKE) all LDFLAGS=-s OBJS_EXT=80386.o \
+ 	CFLAGS="-pipe -fstrength-reduce -O -DUNIX -DUSE_SELECT -DUNIT32"
  
  sunspc:
  	$(MAKE) all CC="ccspc -B/1.8.6/sun4 -ansi -w -I/usr/include" \
-- 
In-This-Life:  Andrew A. Chernov    |  "Hay mas dicha, mas contento
Internet:      ache@astral.msk.su   |  "Que adorar una hermosura
Organization:  The RELCOM Corp.,    |  "Brujuleada entre los lejos
               Moscow, Russia       |  "De lo imposible?!"  (Calderon)