Merge branch 'jc/maint-log-grep-all-match'
[git.git] / gettext.h
index 57ba8bb02e39d59752a5b2fbf016bc6fe49d27c1..7671d09d04bb87541b11209b5cdbddbb9e4e59b8 100644 (file)
--- a/gettext.h
+++ b/gettext.h
 
 #ifndef NO_GETTEXT
 extern void git_setup_gettext(void);
+extern int gettext_width(const char *s);
 #else
 static inline void git_setup_gettext(void)
 {
 }
+static inline int gettext_width(const char *s)
+{
+       return strlen(s);
+}
 #endif
 
 #ifdef GETTEXT_POISON
@@ -44,6 +49,8 @@ extern int use_gettext_poison(void);
 
 static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
+       if (!*msgid)
+               return "";
        return use_gettext_poison() ? "# GETTEXT POISON #" : gettext(msgid);
 }