repo.or.cz
/
swftools.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fixed compile error
[swftools.git]
/
installer
/
utils.c
blob
cce762ea23d4d581290483236b34454abb28bcd3
1
char
*
concatPaths
(
const char
*
base
,
const char
*
add
)
2
{
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
++;
11
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
;
17
}
18