Commit cdbd1b25 authored by Peter Stephenson's avatar Peter Stephenson

36378: skip directories when looking for files to autoload

parent dde07f74
2015-09-02 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 36378: Src/exec.c: skip directories when looking for autoload
files.
2015-09-02 Peter Stephenson <p.stephenson@samsung.com>
* 36399: Src/text.c, Test/A04redirect.ztst: shell code with
......
......@@ -5392,7 +5392,9 @@ getfpfunc(char *s, int *ksh, char **fname)
}
unmetafy(buf, NULL);
if (!access(buf, R_OK) && (fd = open(buf, O_RDONLY | O_NOCTTY)) != -1) {
if ((len = lseek(fd, 0, 2)) != -1) {
struct stat st;
if (!fstat(fd, &st) && S_ISREG(st.st_mode) &&
(len = lseek(fd, 0, 2)) != -1) {
d = (char *) zalloc(len + 1);
lseek(fd, 0, 0);
if ((rlen = read(fd, d, len)) >= 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment