🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98988

(none)

#98988
From: Bill Bailey
Date: Tue, 18 Dec 1990 03:07
33 lines
1602 bytes
Today, I made my first ever personal code modification to the emacs
source.  I wanted csh-like cdpath functionality from the 'cd function.
Implementing this required changing the openp() routine in lread.c.
While studying the unmodified source, I discovered what I believe to
be a bug:

              /* Check that we can access or open it.  */
              if (exec_only)
                fd = !access (fn, X_OK);
              else
                fd = open (fn, 0, 0);

              if (fd >= 0)
                {
                  /* We succeeded; return this descriptor and filename.  */
                  if (storeptr)
                    *storeptr = build_string (fn);
                  return fd;
                }

The access() function returns 0 or -1.  So (fd >= 0) will always
evaluate to be true which means openp() will always return success.
I believe:

		fd = access (fn, X_OK);

is what was intended.

-- 
William Bailey
Oracle Corp.
400 Oracle Parkway
Redwood City CA 94065
Technical Details
Message-ID: <1990Dec18.030743.27004@oracle.com>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!oracle.com!wbailey

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,d6c67e98fdf4956,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-12-17 19:07:43 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!oracle.com!wbailey
From: wbailey@oracle.com (Bill Bailey)
Newsgroups: gnu.emacs.bug
Subject: (none)
Message-ID: <1990Dec18.030743.27004@oracle.com>
Date: 18 Dec 90 03:07:43 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: wbailey@oracle.com
Distribution: gnu
Organization: Oracle Corp
Lines: 33
Approved: bug-gnu-emacs@prep.ai.mit.edu