summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}