grep: change non-ASCII -i test to stop using --debug
[gitweb.git] / run-command.c
index 73bfba7ef94e678afa830550199f14b6f5ca5ad0..574b81d3e82bbe6de31b141c3951ab408daad5e6 100644 (file)
@@ -48,7 +48,7 @@ static void cleanup_children(int sig, int in_signal)
 
                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,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;
 }