updated for version 7.0041
diff --git a/src/misc1.c b/src/misc1.c
index 0bdcce8..4c2b55e 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3731,12 +3731,10 @@
didset_vimruntime = TRUE;
#ifdef FEAT_GETTEXT
{
- char_u *buf = alloc((unsigned int)STRLEN(p) + 6);
+ char_u *buf = concat_str(p, (char_u *)"/lang");
if (buf != NULL)
{
- STRCPY(buf, p);
- STRCAT(buf, "/lang");
bindtextdomain(VIMPACKAGE, (char *)buf);
vim_free(buf);
}
@@ -4303,6 +4301,29 @@
return dest;
}
+#if defined(FEAT_EVAL) || defined(FEAT_GETTEXT) || defined(PROTO)
+/*
+ * Concatenate two strings and return the result in allocated memory.
+ * Returns NULL when out of memory.
+ */
+ char_u *
+concat_str(str1, str2)
+ char_u *str1;
+ char_u *str2;
+{
+ char_u *dest;
+ size_t l = STRLEN(str1);
+
+ dest = alloc((unsigned)(l + STRLEN(str2) + 1L));
+ if (dest != NULL)
+ {
+ STRCPY(dest, str1);
+ STRCPY(dest + l, str2);
+ }
+ return dest;
+}
+#endif
+
/*
* Add a path separator to a file name, unless it already ends in a path
* separator.