emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wrong GCPRO in openp ()


From: Eli Zaretskii
Subject: Re: wrong GCPRO in openp ()
Date: Mon, 06 Feb 2006 20:49:17 +0200

> From: Kenichi Handa <address@hidden>
> 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  <address@hidden>
> [...]
>       * 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]