diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-03-16 15:13:07 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-03-16 15:13:07 +0000 |
commit | e967e0cc978d647040ac5616d389e9007d593464 (patch) | |
tree | 1f33ce27a77473b2e90b549d42399b73d4123497 /Build/source/texk/kpathsea/concat3.c | |
parent | 49f1fb6887627cdb7cf524aaef9b92108c894381 (diff) |
new reentrant kpathsea API (from Taco)
git-svn-id: svn://tug.org/texlive/trunk@12401 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/concat3.c')
-rw-r--r-- | Build/source/texk/kpathsea/concat3.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Build/source/texk/kpathsea/concat3.c b/Build/source/texk/kpathsea/concat3.c index c2349de97d0..6e98a13dac6 100644 --- a/Build/source/texk/kpathsea/concat3.c +++ b/Build/source/texk/kpathsea/concat3.c @@ -19,13 +19,15 @@ string -concat3 P3C(const_string, s1, const_string, s2, const_string, s3) +concat3 (const_string s1, const_string s2, const_string s3) { + int s2l = s2 ? strlen (s2) : 0; + int s3l = s3 ? strlen (s3) : 0; string answer - = (string) xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1); + = (string) xmalloc (strlen(s1) + s2l + s3l + 1); strcpy (answer, s1); - strcat (answer, s2); - strcat (answer, s3); + if (s2) strcat (answer, s2); + if (s3) strcat (answer, s3); return answer; } |