diff options
author | midipix <writeonce@midipix.org> | 2016-04-21 18:29:34 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-04-21 18:29:34 -0400 |
commit | 9bf2c5132c9c28db0639c29278d56e60dab48509 (patch) | |
tree | 6ab1f8a241fcf19bd9b28504a58df03713ce57d1 | |
parent | f38ea1296c687f30e15f3540046f7278f95fc600 (diff) | |
download | slibtool-9bf2c5132c9c28db0639c29278d56e60dab48509.tar.bz2 slibtool-9bf2c5132c9c28db0639c29278d56e60dab48509.tar.xz |
slbt_copy_file(): restore execution context program at exit.
-rw-r--r-- | src/helper/slbt_copy_file.c | 5 |
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; } |