diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2015-11-25 18:51:00 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2015-11-25 18:51:00 +0100 |
commit | 317ec32cb1cbd15b31e17bcb07f09c52cd37c44a (patch) | |
tree | 88a02c853dfafd82a2d551d862d8dfb056b1bee6 /Src/parse.c | |
parent | 1637291aaea12ddcfd549d50d49c480185995c1a (diff) | |
parent | cce4261a3c6f4bf78b483db61623c80e3c98d10b (diff) | |
download | zsh-317ec32cb1cbd15b31e17bcb07f09c52cd37c44a.tar.gz zsh-317ec32cb1cbd15b31e17bcb07f09c52cd37c44a.zip |
Merge tag 'zsh-5.1.1-test-1' into debian
Diffstat (limited to 'Src/parse.c')
-rw-r--r-- | Src/parse.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/parse.c b/Src/parse.c index 7c2d20250..83ba396b0 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -530,7 +530,7 @@ empty_eprog(Eprog p) } static void -clear_hdocs() +clear_hdocs(void) { struct heredocs *p, *n; @@ -3227,6 +3227,8 @@ build_dump(char *nam, char *dump, char **files, int ali, int map, int flags) noaliases = ali; for (hlen = FD_PRELEN, tlen = 0; *files; files++) { + struct stat st; + if (!strcmp(*files, "-k")) { flags = (flags & ~(FDHF_KSHLOAD | FDHF_ZSHLOAD)) | FDHF_KSHLOAD; continue; @@ -3235,6 +3237,7 @@ build_dump(char *nam, char *dump, char **files, int ali, int map, int flags) continue; } if ((fd = open(*files, O_RDONLY)) < 0 || + fstat(fd, &st) != 0 || !S_ISREG(st.st_mode) || (flen = lseek(fd, 0, 2)) == -1) { if (fd >= 0) close(fd); |