I'll resume mumbling to myself...
I definitely should have read the documentation for the pertaining
libc functions earlier.
The patch below makes (file-regular-p "/symlink") return nil on glibc2
systems, however I don't know about compatibility with other
libc's. Can anybody tell?
*** src/fileio.c 1999/02/03 23:24:46 1.1
--- src/fileio.c 1999/02/04 00:01:22
***************
*** 2495,2501 ****
if (!NILP (handler))
return call2 (handler, Qfile_regular_p, abspath);
! if (stat ((char *) XSTRING_DATA (abspath), &st) < 0)
return Qnil;
return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil;
}
--- 2495,2501 ----
if (!NILP (handler))
return call2 (handler, Qfile_regular_p, abspath);
! if (lstat ((char *) XSTRING_DATA (abspath), &st) < 0)
return Qnil;
return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil;
}