comparison src/misc1.c @ 115:2201ea50555e

updated for version 7.0041
author vimboss
date Mon, 17 Jan 2005 22:18:45 +0000
parents f529edb9bab3
children b5fc81a825a1
comparison
equal deleted inserted replaced
114:f6e567606d47 115:2201ea50555e
3729 { 3729 {
3730 vim_setenv((char_u *)"VIMRUNTIME", p); 3730 vim_setenv((char_u *)"VIMRUNTIME", p);
3731 didset_vimruntime = TRUE; 3731 didset_vimruntime = TRUE;
3732 #ifdef FEAT_GETTEXT 3732 #ifdef FEAT_GETTEXT
3733 { 3733 {
3734 char_u *buf = alloc((unsigned int)STRLEN(p) + 6); 3734 char_u *buf = concat_str(p, (char_u *)"/lang");
3735 3735
3736 if (buf != NULL) 3736 if (buf != NULL)
3737 { 3737 {
3738 STRCPY(buf, p);
3739 STRCAT(buf, "/lang");
3740 bindtextdomain(VIMPACKAGE, (char *)buf); 3738 bindtextdomain(VIMPACKAGE, (char *)buf);
3741 vim_free(buf); 3739 vim_free(buf);
3742 } 3740 }
3743 } 3741 }
3744 #endif 3742 #endif
4300 add_pathsep(dest); 4298 add_pathsep(dest);
4301 STRCAT(dest, fname2); 4299 STRCAT(dest, fname2);
4302 } 4300 }
4303 return dest; 4301 return dest;
4304 } 4302 }
4303
4304 #if defined(FEAT_EVAL) || defined(FEAT_GETTEXT) || defined(PROTO)
4305 /*
4306 * Concatenate two strings and return the result in allocated memory.
4307 * Returns NULL when out of memory.
4308 */
4309 char_u *
4310 concat_str(str1, str2)
4311 char_u *str1;
4312 char_u *str2;
4313 {
4314 char_u *dest;
4315 size_t l = STRLEN(str1);
4316
4317 dest = alloc((unsigned)(l + STRLEN(str2) + 1L));
4318 if (dest != NULL)
4319 {
4320 STRCPY(dest, str1);
4321 STRCPY(dest + l, str2);
4322 }
4323 return dest;
4324 }
4325 #endif
4305 4326
4306 /* 4327 /*
4307 * Add a path separator to a file name, unless it already ends in a path 4328 * Add a path separator to a file name, unless it already ends in a path
4308 * separator. 4329 * separator.
4309 */ 4330 */