From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: wrong GCPRO in openp () Date: Mon, 06 Feb 2006 20:49:17 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1139251869 19107 80.91.229.2 (6 Feb 2006 18:51:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2006 18:51:09 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 19:51:06 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F6BRO-0000p7-Os for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2006 19:50:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6BUi-0006q7-6c for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2006 13:53:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6BUU-0006nj-5j for emacs-devel@gnu.org; Mon, 06 Feb 2006 13:53:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6BUR-0006nP-Gk for emacs-devel@gnu.org; Mon, 06 Feb 2006 13:53:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6BUR-0006nM-Dw for emacs-devel@gnu.org; Mon, 06 Feb 2006 13:53:31 -0500 Original-Received: from [192.114.186.17] (helo=gandalf.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6BU2-0001Vd-9L for emacs-devel@gnu.org; Mon, 06 Feb 2006 13:53:06 -0500 Original-Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HUI31012; Mon, 6 Feb 2006 20:49:19 +0200 (IST) Original-Received: from HOME-C4E4A596F7 (IGLD-84-228-241-54.inter.net.il [84.228.241.54]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id CQG86736 (AUTH halo1); Mon, 6 Feb 2006 20:49:17 +0200 (IST) Original-To: Kenichi Handa In-reply-to: (message from Kenichi Handa on Mon, 06 Feb 2006 21:43:04 +0900) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50112 Archived-At: > From: Kenichi Handa > Date: Mon, 06 Feb 2006 21:43:04 +0900 > > But, the variable encoded_fn is used as this: > > [...] > else > { > const char *pfn; > > encoded_fn = ENCODE_FILE (string); > pfn = SDATA (encoded_fn); > exists = (stat (pfn, &st) >= 0 > && (st.st_mode & S_IFMT) != S_IFDIR); > if (exists) > { > /* Check that we can access or open it. */ > if (NATNUMP (predicate)) > fd = (access (pfn, XFASTINT (predicate)) == 0) ? 1 : -1; > else > fd = emacs_open (pfn, O_RDONLY, 0); > [...] > > So, I think there's no need of GCPRO for encoded_fn. Eli, > it seems that you are the last one who changed the code > around here. > > 2002-03-29 Eli Zaretskii > [...] > * lread.c (openp, Fload): Encode the file name before passing it > to `stat', `access', and `emacs_open'. > (openp): GCPRO the encoded file name. Don't recompute Lisp > strings unnecessarily. > > Do you remember why you did this change? Sorry, no. Most probably because Richard (or someone else) asked me to, but that's a guess.