fixed compile error
[swftools.git] / installer / utils.c
blobcce762ea23d4d581290483236b34454abb28bcd3
1 char* concatPaths(const char*base, const char*add)
3 int l1 = strlen(base);
4 int l2 = strlen(add);
5 int pos = 0;
6 char*n = 0;
7 while(l1 && base[l1-1] == '\\')
8 l1--;
9 while(pos < l2 && add[pos] == '\\')
10 pos++;
12 n = (char*)malloc(l1 + (l2-pos) + 2);
13 memcpy(n,base,l1);
14 n[l1]='\\';
15 strcpy(&n[l1+1],&add[pos]);
16 return n;