From: Junio C Hamano Date: Fri, 20 Mar 2015 20:11:48 +0000 (-0700) Subject: Merge branch 'km/bsd-shells' X-Git-Tag: v2.4.0-rc0~35 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ec0465ade87996214959a393239eec520daf92ea?ds=inline;hp=-c Merge branch 'km/bsd-shells' Portability fixes and workarounds for shell scripts have been added to help BSD-derived systems. * km/bsd-shells: t5528: do not fail with FreeBSD shell help.c: use SHELL_PATH instead of hard-coded "/bin/sh" git-compat-util.h: move SHELL_PATH default into header git-instaweb: use @SHELL_PATH@ instead of /bin/sh git-instaweb: allow running in a working tree subdirectory --- ec0465ade87996214959a393239eec520daf92ea diff --combined builtin/help.c index 6133fe496b,7082c23b7a..2ae8a1e985 --- a/builtin/help.c +++ b/builtin/help.c @@@ -49,7 -49,7 +49,7 @@@ static struct option builtin_help_optio }; static const char * const builtin_help_usage[] = { - N_("git help [--all] [--guides] [--man|--web|--info] [command]"), + N_("git help [--all] [--guides] [--man | --web | --info] []"), NULL }; @@@ -171,7 -171,7 +171,7 @@@ static void exec_man_cmd(const char *cm { struct strbuf shell_cmd = STRBUF_INIT; strbuf_addf(&shell_cmd, "%s %s", cmd, page); - execl("/bin/sh", "sh", "-c", shell_cmd.buf, (char *)NULL); + execl(SHELL_PATH, SHELL_PATH, "-c", shell_cmd.buf, (char *)NULL); warning(_("failed to exec '%s': %s"), cmd, strerror(errno)); } diff --combined git-compat-util.h index a3095be962,f55234dd27..fbfd10dadc --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -688,7 -688,7 +688,7 @@@ static inline size_t xsize_t(off_t len } /* in ctype.c, for kwset users */ -extern const char tolower_trans_tbl[256]; +extern const unsigned char tolower_trans_tbl[256]; /* Sane ctype - no locale, and works with signed chars */ #undef isascii @@@ -872,8 -872,8 +872,12 @@@ struct tm *git_gmtime_r(const time_t * #define gmtime_r git_gmtime_r #endif +#if !defined(USE_PARENS_AROUND_GETTEXT_N) && defined(__GNUC__) +#define USE_PARENS_AROUND_GETTEXT_N 1 +#endif + + #ifndef SHELL_PATH + # define SHELL_PATH "/bin/sh" + #endif + #endif