From: Junio C Hamano Date: Fri, 24 Mar 2017 20:07:34 +0000 (-0700) Subject: Merge branch 'jk/execv-dashed-external' X-Git-Tag: v2.13.0-rc0~81 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6756b58ebc213a786adaccf3f0f07c56c8a2744a?ds=inline;hp=-c Merge branch 'jk/execv-dashed-external' Fix for NO_PTHREADS build. * jk/execv-dashed-external: run-command: fix segfault when cleaning forked async process --- 6756b58ebc213a786adaccf3f0f07c56c8a2744a diff --combined run-command.c index 5227f78aea,7dc8a8e70e..574b81d3e8 --- a/run-command.c +++ b/run-command.c @@@ -48,7 -48,7 +48,7 @@@ static void cleanup_children(int sig, i kill(p->pid, sig); - if (p->process->wait_after_clean) { + if (p->process && p->process->wait_after_clean) { p->next = children_to_wait_for; children_to_wait_for = p; } else { @@@ -871,14 -871,8 +871,14 @@@ const char *find_hook(const char *name strbuf_reset(&path); strbuf_git_path(&path, "hooks/%s", name); - if (access(path.buf, X_OK) < 0) + if (access(path.buf, X_OK) < 0) { +#ifdef STRIP_EXTENSION + strbuf_addstr(&path, STRIP_EXTENSION); + if (access(path.buf, X_OK) >= 0) + return path.buf; +#endif return NULL; + } return path.buf; }