X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=installer%2Futils.c;fp=installer%2Futils.c;h=cce762ea23d4d581290483236b34454abb28bcd3;hb=8f162ec7490711395802db77da8615cad6c977ff;hp=0000000000000000000000000000000000000000;hpb=d00163a2595edca7be325627ef487502bd94934c;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; +} +