summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-08 11:34:47 -0500
committermidipix <writeonce@midipix.org>2016-03-10 08:32:39 -0500
commita288c4f46e5e7d9c3e643a13572cda4c601d76dd (patch)
tree3a0509a568c9abbc5f0dfc61f7fc0c2f985ef2c6
parent595190b44d92930a703d0fcb3afba6a179e80c2b (diff)
downloadslibtool-a288c4f46e5e7d9c3e643a13572cda4c601d76dd.tar.bz2
slibtool-a288c4f46e5e7d9c3e643a13572cda4c601d76dd.tar.xz
interface: add the split argument vectors to struct slbt_common_ctx.
-rw-r--r--include/slibtool/slibtool.h2
-rw-r--r--src/driver/slbt_driver_ctx.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index a05b95f..312c7cd 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -84,6 +84,8 @@ struct slbt_common_ctx {
enum slbt_tag tag;
enum slbt_warning_level warnings;
const char * output;
+ char ** targv;
+ char ** cargv;
};
struct slbt_driver_ctx {
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 8d4e861..74fbd9a 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -187,9 +187,13 @@ static int slbt_split_argv(
if (argv[i][0] != '-')
*cargv++ = argv[i];
- else if (argv[i][1] == 'o')
+ else if (argv[i][1] == 'o') {
*targv++ = argv[i];
+ if (argv[i][2] == '\0')
+ *targv++ = argv[++i];
+ }
+
else if ((argv[i][1] == 'W') && (argv[i][2] == 'c'))
*cargv++ = argv[i];
@@ -353,6 +357,9 @@ int slbt_get_driver_ctx(
ctx->targv = sargv.targv;
ctx->cargv = sargv.cargv;
+ ctx->cctx.targv = sargv.targv;
+ ctx->cctx.cargv = sargv.cargv;
+
*pctx = &ctx->ctx;
return SLBT_OK;
}