summaryrefslogtreecommitdiff
path: root/src/driver/pe_driver_ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver/pe_driver_ctx.c')
-rw-r--r--src/driver/pe_driver_ctx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index 8214f86..77a51d9 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -337,6 +337,7 @@ int pe_lib_get_driver_ctx(
char ** pargcap;
char ** cmdargv;
char * cmdmark;
+ char stckarg[64];
struct argv_ctx actx = {ARGV_VERBOSITY_NONE,
ARGV_MODE_SCAN,
0,0,0,0,0,0,0,0};
@@ -366,6 +367,17 @@ int pe_lib_get_driver_ctx(
program,0,
optv,0,0,cctx.cmd);
+ /* historic ar usage (vector will be cloned, so stack var is fine) */
+ if (cctx.cmd == PERK_CMD_AR) {
+ if (argv && argv[0] && argv[1] && (argv[1][0] != '-')) {
+ if (strlen(argv[1]) < (sizeof(stckarg) - 1)) {
+ stckarg[0] = '-';
+ strcpy(&stckarg[1],argv[1]);
+ argv[1] = stckarg;
+ }
+ }
+ }
+
/* initial argv scan: ... --cmd=xxx ... */
argv_scan(argv,optv,&actx,0);