summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-16 06:55:11 -0400
committermidipix <writeonce@midipix.org>2016-04-16 08:03:26 -0400
commit660491af34cf794d71cf84a94f56dd310cdb034a (patch)
tree9e8c37c172f925570652b578a842278e274e1607 /src
parent69bc4af3f33eb27516f85b22d53060c0ec8b0f52 (diff)
downloadslibtool-660491af34cf794d71cf84a94f56dd310cdb034a.tar.bz2
slibtool-660491af34cf794d71cf84a94f56dd310cdb034a.tar.xz
slbt_create_symlink(): restore execution context argument vector at exit.
Diffstat (limited to 'src')
-rw-r--r--src/internal/slibtool_symlink_impl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/internal/slibtool_symlink_impl.c b/src/internal/slibtool_symlink_impl.c
index 91fff1a..db72feb 100644
--- a/src/internal/slibtool_symlink_impl.c
+++ b/src/internal/slibtool_symlink_impl.c
@@ -18,6 +18,7 @@ int slbt_create_symlink(
const char * lnkname,
bool flawrapper)
{
+ char ** oargv;
const char * slash;
char * ln[5];
char * dotdot;
@@ -51,19 +52,28 @@ int slbt_create_symlink(
ln[2] = atarget;
ln[3] = lnkarg;
ln[4] = 0;
+
+ oargv = ectx->argv;
ectx->argv = ln;
/* step output */
if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT)) {
if (dctx->cctx->mode == SLBT_MODE_LINK) {
- if (slbt_output_link(dctx,ectx))
+ if (slbt_output_link(dctx,ectx)) {
+ ectx->argv = oargv;
return -1;
+ }
} else {
- if (slbt_output_install(dctx,ectx))
+ if (slbt_output_install(dctx,ectx)) {
+ ectx->argv = oargv;
return -1;
+ }
}
}
+ /* restore execution context */
+ ectx->argv = oargv;
+
/* create symlink */
if (symlink(atarget,tmplnk))
return -1;