🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1602

Minor bug in sysdep.c for VMS

#1602
From: Darin Johnson
Date: Tue, 18 Apr 1989 00:44
18 lines
1553 bytes
I recently copied over Gnu Emacs 18.52 from my Unix systems to update
what we have on VMS.  In the file sysdep.c, the routine sys_getenv
does some special processing to get an environment variable.  What
has changed since version 18.50, is that the routine now explicitly
checks for logical names before calling VAXC's builtin getenv.  This
is good, since it lets the user override the TERM environment variable.
However, when translating logical names, the code puts the translation
into a static variable, and returns a pointer to that.  Later, when
sys_getenv is called again, this static area gets overwritten, changing
previous getenv()s.  Since this static area is only used part of the time,
the problem may not have shown up in all cases.  It did fail however,
when TERM was defined as a logical name, causing getenv("TERMCAP") in
tgetent() to overwrite it (I am also using shared libraries, if that
makes a difference).  The fix that I used was to change the line that
reads "return buf;" so that a new string was malloc()ed, buf copied
into it, and the new string returned.

Darin Johnson (leadsv!laic!darin@pyramid.pyramid.com)
Technical Details
Message-ID: <8904180044.AA02484@laic.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!UCBVAX.BERKELEY.EDU!decwrl!laic!darin

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!UCBVAX.BERKELEY.EDU!decwrl!laic!darin
From: decwrl!laic!darin@UCBVAX.BERKELEY.EDU (Darin Johnson)
Newsgroups: gnu.emacs.bug
Subject: Minor bug in sysdep.c for VMS
Message-ID: <8904180044.AA02484@laic.com>
Date: 18 Apr 89 00:44:24 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 18