Merge branch 'km/bsd-shells'
authorJunio C Hamano <gitster@pobox.com>
Fri, 20 Mar 2015 20:11:48 +0000 (13:11 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Mar 2015 20:11:48 +0000 (13:11 -0700)
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

1  2 
builtin/help.c
git-compat-util.h
diff --combined builtin/help.c
index 6133fe496b00e30a33d03c2d49b22a6ff81f9c77,7082c23b7a86c2ee440b8b9a31844ba2b0136ba0..2ae8a1e9857f78cb46b7238519df1627ac98ae81
@@@ -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] [<command>]"),
        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 a3095be962c04d5b55c54ec39c6c3e6989372c36,f55234dd27f6720a36730dc1660a10108dee55d5..fbfd10dadc0352b5699eaab164959d68a52c9aa6
@@@ -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