summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-21 18:29:34 -0400
committermidipix <writeonce@midipix.org>2016-04-21 18:29:34 -0400
commit9bf2c5132c9c28db0639c29278d56e60dab48509 (patch)
tree6ab1f8a241fcf19bd9b28504a58df03713ce57d1 /src/helper
parentf38ea1296c687f30e15f3540046f7278f95fc600 (diff)
downloadslibtool-9bf2c5132c9c28db0639c29278d56e60dab48509.tar.bz2
slibtool-9bf2c5132c9c28db0639c29278d56e60dab48509.tar.xz
slbt_copy_file(): restore execution context program at exit.
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/slbt_copy_file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/helper/slbt_copy_file.c b/src/helper/slbt_copy_file.c
index 158a760..94b2cd0 100644
--- a/src/helper/slbt_copy_file.c
+++ b/src/helper/slbt_copy_file.c
@@ -14,6 +14,7 @@ int slbt_copy_file(
char * dst)
{
char ** oargv;
+ char * oprogram;
char * cp[4];
int ret;
@@ -24,6 +25,7 @@ int slbt_copy_file(
cp[3] = 0;
/* alternate argument vector */
+ oprogram = ectx->program;
oargv = ectx->argv;
ectx->argv = cp;
ectx->program = "cp";
@@ -33,11 +35,13 @@ int slbt_copy_file(
if (dctx->cctx->mode == SLBT_MODE_LINK) {
if (slbt_output_link(dctx,ectx)) {
ectx->argv = oargv;
+ ectx->program = oprogram;
return -1;
}
} else {
if (slbt_output_install(dctx,ectx)) {
ectx->argv = oargv;
+ ectx->program = oprogram;
return -1;
}
}
@@ -48,5 +52,6 @@ int slbt_copy_file(
? -1 : 0;
ectx->argv = oargv;
+ ectx->program = oprogram;
return ret;
}