Raymond Toy <toy(a)rtp.ericsson.se> writes:
Could there be a GC bug in file_truename or some process I/O stuff?
I read some filelock related codes and found one GC bug. I
removed call to compute-buffer-file-name because its return
value is just discarded. If you set it to buffer filename
there, you'll get /full/path/to/.emacs when you find-file
~/.emacs instead of .emacs
2000-11-09 Yoshiki Hayashi <yoshiki(a)xemacs.org>
* fileio.c (Finsert_file_contents_internal): UNGCPRO before return.
Remove unused call to compute-buffer-file-name.
Index: fileio.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/fileio.c,v
retrieving revision 1.51.2.30
diff -u -r1.51.2.30 fileio.c
--- fileio.c 2000/11/06 05:43:29 1.51.2.30
+++ fileio.c 2000/11/09 07:41:36
@@ -2680,7 +2680,6 @@
(filename, visit, start, end, replace, codesys, used_codesys))
{
/* This function can call lisp */
- /* #### dmoore - this function hasn't been checked for gc recently */
struct stat st;
int fd;
int saverrno = 0;
@@ -2763,9 +2762,10 @@
{
end_multiple_change (buf, mc_count);
- return Fsignal (Qfile_error,
- list2 (build_translated_string("not a regular file"),
- filename));
+ RETURN_UNGCPRO
+ (Fsignal (Qfile_error,
+ list2 (build_translated_string("not a regular file"),
+ filename)));
}
}
#endif /* S_IFREG */
@@ -3027,13 +3027,6 @@
{
buf->modtime = st.st_mtime;
buf->filename = filename;
- /* XEmacs addition: */
- /* This function used to be in C, ostensibly so that
- it could be called here. But that's just silly.
- There's no reason C code can't call out to Lisp
- code, and it's a lot cleaner this way. */
- if (!NILP (Ffboundp (Qcompute_buffer_file_truename)))
- call1 (Qcompute_buffer_file_truename, make_buffer (buf));
}
BUF_SAVE_MODIFF (buf) = BUF_MODIFF (buf);
buf->auto_save_modified = BUF_MODIFF (buf);
--
Yoshiki Hayashi