There were 3 different bugs conspiring for this:
* lisp/packages.el (package-suppress): the value for filename
added to load-suppress-alist contained the load-file-name instead
of using it as a basis for the directory of the file to exclude.
* src/lread.c (suppressedp_loop): No file was ever being
considered for exclusion because the check for CONSP was being
made against the acons function pointer instead of the _acons_
iteration variable.
* src/lread.c (locate_file_in_directory_mapper): When a file was
suppressed, the value of fd in the closure was left as is. This
not only leaked file descriptors but also made the search end
because in the end this is was the value considered to whether
there was a valid file to load or not, because closure.fd is the
return value of locate_file_in_directory.
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
When SXEmacs searches for a file in the load path, it will ignore FILE
if FORM evaluates to non-nil."
(setq load-suppress-alist
- (acons (expand-file-name file load-file-name) form
+ (acons (expand-file-name file (file-dirname load-file-name)) form
load-suppress-alist)))
(defun package-require (name version)
suppressedp_loop(int len, char *nonreloc, Lisp_Object reloc)
{
EXTERNAL_LIST_LOOP_2(_acons_, Vload_suppress_alist) {
- if (CONSP(acons) && STRINGP(XCAR(_acons_))) {
+ if (CONSP(_acons_) && STRINGP(XCAR(_acons_))) {
Lisp_Object name = XCAR(_acons_);
if (XSTRING_LENGTH(name) == len &&
!memcmp(XSTRING_DATA(name), nonreloc, len)) {
F_SETFD, FD_CLOEXEC);
return 1;
+ } else {
+ close(closure->fd);
+ closure->fd=-1;
}
}
}