Subject: Patch to 19.22: Termcap is not always in /etc
To: None <gnu-emacs-sources@prep.ai.mit.edu, netbsd-users@sun-lamp.cs.berkeley.edu>
From: Mike Long <mike.long@analog.com>
List: netbsd-users
Date: 12/17/1993 09:12:59
This patch may be useful for people who use systems that keep the
termcap database some place other than in /etc.  I made the change
because I use NetBSD, and it keeps its termcap database in
/usr/share/misc/termcap.  Previously, in order to get Emacs to work
you had to either create a link for /etc/termcap, or have anyone who
uses Emacs set their TERMCAP environment variable to the correct
location.  I also took the opportunity to generalize a bit of
VMS-specific code.

Patch follows, between the lines:
----------------------------------------------------------------------
*** ChangeLog.orig	Sat Nov 27 04:41:26 1993
--- ChangeLog	Fri Dec 17 02:32:27 1993
***************
*** 1,3 ****
--- 1,12 ----
+ Fri Dec 17 00:22:43 1993  Mike Long  (mike.long@analog.com)
+ 
+ 	* termcap.c (tgetent): Replaced literal filenames for termcap
+ 	database with preprocessor symbol TERMCAP_NAME.  Moved
+ 	VMS-specific code to s/vms.h.  Default TERMCAP_NAME set to
+ 	"/etc/termcap".
+ 	* s/vms.h (TERMCAP_NAME): Defined to be value from termcap.c.
+ 	* s/netbsd.h (TERMCAP_NAME): Defined.
+ 
  Sat Nov 27 04:41:22 1993  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
  
  	* Version 19.22 released.
*** termcap.c.orig	Fri Sep 10 00:35:03 1993
--- termcap.c	Fri Dec 17 01:58:02 1993
*************** int bufsize = 128;
*** 63,68 ****
--- 63,72 ----
  #endif
  #endif
  
+ #ifndef TERMCAP_NAME
+ #define TERMCAP_NAME "/etc/termcap"
+ #endif
+ 
  #ifndef emacs
  static void
  memory_out ()
*************** tgetent (bp, name)
*** 419,429 ****
      }
  
    if (!termcap_name || !filep)
! #ifdef VMS
!     termcap_name = "emacs_library:[etc]termcap.dat";
! #else
!     termcap_name = "/etc/termcap";
! #endif
  
    /* Here we know we must search a file and termcap_name has its name.  */
  
--- 423,429 ----
      }
  
    if (!termcap_name || !filep)
!     termcap_name = TERMCAP_NAME;
  
    /* Here we know we must search a file and termcap_name has its name.  */
  
*** s/vms.h.orig	Sat Jun 12 18:01:32 1993
--- s/vms.h	Fri Dec 17 01:56:18 1993
***************
*** 249,254 ****
--- 249,256 ----
  
  #define NULL_DEVICE "NLA0:"
  
+ #define TERMCAP_NAME "emacs_library:[etc]termcap.dat"
+ 
  #define EXEC_SUFFIXES ".exe:.com"
  
  /* Case conflict with Xlib XFree () */
*** s/netbsd.h.orig	Fri Sep 10 01:02:45 1993
--- s/netbsd.h	Fri Dec 17 02:00:22 1993
***************
*** 28,30 ****
--- 28,32 ----
  
  /* For mem-limits.h.  */
  #define BSD4_2
+ 
+ #define TERMCAP_NAME "/usr/share/misc/termcap"

----------------------------------------------------------------------
-- 
Mike Long                                         Mike.Long@Analog.com
VLSI Design Engineer                              voice: (617)461-4030
Analog Devices, SPD Div.                            FAX: (617)461-3010
Norwood, MA 02062                            *this = !opinion(Analog);

------------------------------------------------------------------------------