Re: [PATCH] refactor of git_setup_gettext method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dima, welcome to Git mailing list!

diff --git a/gettext.c b/gettext.c
index af2413b47e85..e75c7bfdb1a8 100644
--- a/gettext.c
+++ b/gettext.c
@@ -109,17 +109,14 @@ void git_setup_gettext(void)
  	if (!podir)
  		podir = p = system_path(GIT_LOCALE_PATH);
- if (!is_directory(podir)) {
-		free(p);
-		return;
+	if (is_directory(podir)) {
+		bindtextdomain("git", podir);
+		setlocale(LC_MESSAGES, "");
+		setlocale(LC_TIME, "");
+		init_gettext_charset("git");
+		textdomain("git");
  	}
- bindtextdomain("git", podir);
-	setlocale(LC_MESSAGES, "");
-	setlocale(LC_TIME, "");
-	init_gettext_charset("git");
-	textdomain("git");
-

It seems like you move gettext initialization into if body, so the patch title should be better say "move gettext initialization to if body".

  	free(p);
  }

Thanks for review.

--
An old man doll... just what I always wanted! - Clara



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux