Merge branch 'ms/core-icase-doc'
[gitweb.git] / gettext.c
index 6b64d5c2e8a5cc2a194ba1486de05437dd8051c6..7272771c8e445da194ea608443d8bc9c891b6b33 100644 (file)
--- a/gettext.c
+++ b/gettext.c
@@ -3,7 +3,7 @@
  */
 
 #include "cache.h"
-#include "exec_cmd.h"
+#include "exec-cmd.h"
 #include "gettext.h"
 #include "strbuf.h"
 #include "utf8.h"
@@ -159,15 +159,23 @@ static void init_gettext_charset(const char *domain)
 void git_setup_gettext(void)
 {
        const char *podir = getenv(GIT_TEXT_DOMAIN_DIR_ENVIRONMENT);
+       char *p = NULL;
 
        if (!podir)
-               podir = system_path(GIT_LOCALE_PATH);
+               podir = p = system_path(GIT_LOCALE_PATH);
+
+       if (!is_directory(podir)) {
+               free(p);
+               return;
+       }
 
        bindtextdomain("git", podir);
        setlocale(LC_MESSAGES, "");
        setlocale(LC_TIME, "");
        init_gettext_charset("git");
        textdomain("git");
+
+       free(p);
 }
 
 /* return the number of columns of string 's' in current locale */