diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2018-12-24 04:40:22 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2018-12-24 04:40:22 +0100 |
commit | bf8b7f713a5b04a191f4596fb86bbbfca0a855ce (patch) | |
tree | b647a8dc990c8c845b8a8eca7bf92fbbf17e1fb5 /Src/utils.c | |
parent | 06946d431a4426c6e5dffec1d7edb17c1dbd467c (diff) | |
parent | 9dbde9e9c7d22ee0d301e4a2fecf97906d1ddce9 (diff) | |
download | zsh-bf8b7f713a5b04a191f4596fb86bbbfca0a855ce.tar.gz zsh-bf8b7f713a5b04a191f4596fb86bbbfca0a855ce.zip |
New upstream release candidate 5.6.2-test-2
Merge branch 'upstream' at 'zsh-5.6.2-test-2' into branch debian
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/Src/utils.c b/Src/utils.c index 075d27241..e43a3cdb4 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -3820,6 +3820,14 @@ wordcount(char *s, char *sep, int mul) return r; } +/* + * 's' is a NULL-terminated array of strings. + * 'sep' is a string. + * + * Return a string consisting of the elements of 's' joined by 'sep', + * allocated on the heap iff 'heap'. + */ + /**/ mod_export char * sepjoin(char **s, char *sep, int heap) @@ -4670,6 +4678,10 @@ attachtty(pid_t pgrp) ep = 1; } } + else + { + last_attached_pgrp = pgrp; + } } } @@ -7447,19 +7459,28 @@ mailstat(char *path, struct stat *st) /* See if cur/ is present */ dir = appstr(ztrdup(path), "/cur"); - if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; + if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { + zsfree(dir); + return 0; + } st_ret.st_atime = st_tmp.st_atime; /* See if tmp/ is present */ dir[plen] = 0; dir = appstr(dir, "/tmp"); - if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; + if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { + zsfree(dir); + return 0; + } st_ret.st_mtime = st_tmp.st_mtime; /* And new/ */ dir[plen] = 0; dir = appstr(dir, "/new"); - if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; + if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { + zsfree(dir); + return 0; + } st_ret.st_mtime = st_tmp.st_mtime; #if THERE_IS_EXACTLY_ONE_MAILDIR_IN_MAILPATH @@ -7471,6 +7492,7 @@ mailstat(char *path, struct stat *st) st_tmp.st_atime == st_new_last.st_atime && st_tmp.st_mtime == st_new_last.st_mtime) { *st = st_ret_last; + zsfree(dir); return 0; } st_new_last = st_tmp; |