Index: cam.c =================================================================== --- cam.c (revision 18321) +++ cam.c (revision 18322) @@ -30,6 +30,7 @@ #include #include +#include #include "hid_cam.h" #include "hid_attrib.h" @@ -53,6 +54,8 @@ char *args; /* strdup'd argument string from the last plugin command - already split up */ char *argv[128]; /* [0] and [1] are for --cam; the rest point into args */ int argc; + + gds_t tmp; } cam_ctx_t; static void cam_init_inst(cam_ctx_t *ctx) @@ -64,6 +67,7 @@ { free(ctx->prefix); free(ctx->args); + gds_uninit(&ctx->tmp); } static int cam_exec_inst(void *ctx_, char *cmd, char *arg) @@ -84,8 +88,14 @@ return -1; } + /* build the --cam args using the prefix */ ctx->argv[0] = "--cam"; - ctx->argv[1] = arg; + gds_truncate(&ctx->tmp, 0); + if (ctx->prefix != NULL) + gds_append_str(&ctx->tmp, ctx->prefix); + gds_append_str(&ctx->tmp, arg); + ctx->argv[1] = ctx->tmp.array; + if (ctx->exporter->parse_arguments(&argc, &argv) != 0) { pcb_message(PCB_MSG_ERROR, "cam: exporter '%s' refused the arguments\n", arg); return -1; Index: cam.conf =================================================================== --- cam.conf (revision 18321) +++ cam.conf (revision 18322) @@ -5,6 +5,7 @@ li:jobs { doc_png { plugin png --dpi 600 + prefix pina write top.png=top-copper,top-silk write bottom.png=bottom-copper,bottom-silk }