summaryrefslogtreecommitdiffhomepage
path: root/src/internal/slibtool_symlink_impl.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-10 18:32:30 -0400
committermidipix <writeonce@midipix.org>2016-04-11 14:00:18 -0400
commite0a0450b8764d54303d927e18aee1f038bcf66f7 (patch)
treeab5ba6f2b4ed70880d254b44602a6b4455d1f33a /src/internal/slibtool_symlink_impl.c
parentf22545d4ff7c89eb4e310373bc832aa48120df35 (diff)
downloadslibtool-e0a0450b8764d54303d927e18aee1f038bcf66f7.tar.bz2
slibtool-e0a0450b8764d54303d927e18aee1f038bcf66f7.tar.xz
slbt_create_symlink(): make the type of lnkname more convenient to callers.
Diffstat (limited to 'src/internal/slibtool_symlink_impl.c')
-rw-r--r--src/internal/slibtool_symlink_impl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/internal/slibtool_symlink_impl.c b/src/internal/slibtool_symlink_impl.c
index 50b2387..91fff1a 100644
--- a/src/internal/slibtool_symlink_impl.c
+++ b/src/internal/slibtool_symlink_impl.c
@@ -15,13 +15,14 @@ int slbt_create_symlink(
const struct slbt_driver_ctx * dctx,
struct slbt_exec_ctx * ectx,
const char * target,
- char * lnkname,
+ const char * lnkname,
bool flawrapper)
{
const char * slash;
char * ln[5];
char * dotdot;
char tmplnk [PATH_MAX];
+ char lnkarg [PATH_MAX];
char atarget[PATH_MAX];
/* atarget */
@@ -41,11 +42,14 @@ int slbt_create_symlink(
lnkname) >= sizeof(tmplnk))
return -1;
+ /* lnkarg */
+ strcpy(lnkarg,lnkname);
+
/* ln argv (fake) */
ln[0] = "ln";
ln[1] = "-s";
ln[2] = atarget;
- ln[3] = lnkname;
+ ln[3] = lnkarg;
ln[4] = 0;
ectx->argv = ln;