count = SPECPDL_INDEX ();
record_unwind_protect_ptr (fclose_ptr_unwind, &fp);
- specbind (Qfile_name_handler_alist, Qnil);
- fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false);
- fp = fd < 0 ? 0 : fdopen (fd, "r");
- if (!fp)
- {
- int open_errno = errno;
- emacs_close (fd);
- report_file_errno ("Loading charset map", mapfile, open_errno);
- }
- unbind_to (count + 1, Qnil);
+ {
+ ptrdiff_t count1 = SPECPDL_INDEX ();
+ specbind (Qfile_name_handler_alist, Qnil);
+ fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false);
+ fp = fd < 0 ? 0 : fdopen (fd, "r");
+ if (!fp)
+ {
+ int open_errno = errno;
+ emacs_close (fd);
+ report_file_errno ("Loading charset map", mapfile, open_errno);
+ }
+ unbind_to (count1, Qnil);
+ }
/* Use record, as `charset_map_entries' is large (larger than
MAX_ALLOCA). */