X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=installer%2Futils.c;fp=installer%2Futils.c;h=cce762ea23d4d581290483236b34454abb28bcd3;hb=61fc99e1cb873d81d5badc053e9f6903e22db2d2;hp=0000000000000000000000000000000000000000;hpb=919883167e14fe359febf63ce0bba74fed5c0aac;p=swftools.git diff --git a/installer/utils.c b/installer/utils.c new file mode 100644 index 0000000..cce762e --- /dev/null +++ b/installer/utils.c @@ -0,0 +1,18 @@ +char* concatPaths(const char*base, const char*add) +{ + int l1 = strlen(base); + int l2 = strlen(add); + int pos = 0; + char*n = 0; + while(l1 && base[l1-1] == '\\') + l1--; + while(pos < l2 && add[pos] == '\\') + pos++; + + n = (char*)malloc(l1 + (l2-pos) + 2); + memcpy(n,base,l1); + n[l1]='\\'; + strcpy(&n[l1+1],&add[pos]); + return n; +} +