Index: trunk/src_plugins/cam/cam.c =================================================================== --- trunk/src_plugins/cam/cam.c (revision 31834) +++ trunk/src_plugins/cam/cam.c (revision 31835) @@ -110,10 +110,10 @@ return -1; } -static int cam_parse_opt_outfile(cam_ctx_t *ctx, const char *optval) +static int cam_parse_opt_outfile(cam_ctx_t *ctx, const char *optval, rnd_bool nomkdir) { char *fn, *tmp = rnd_strdup(optval); - int dirlen = prefix_mkdir(tmp, &fn); + int dirlen = prefix_mkdir(tmp, &fn, nomkdir); free(ctx->prefix); if (dirlen > 0) { @@ -145,7 +145,7 @@ static int cam_parse_opt(cam_ctx_t *ctx, const char *opt) { if (strncmp(opt, "outfile=", 8) == 0) - return cam_parse_opt_outfile(ctx, opt+8); + return cam_parse_opt_outfile(ctx, opt+8, 0); else return cam_parse_set_var(ctx, opt); @@ -241,7 +241,7 @@ char *opt = (*argv)[s]; if (strcmp(opt, "--outfile") == 0) { s++; (*argc)--; - cam_parse_opt_outfile(&cam_export_ctx, (*argv)[s]); + cam_parse_opt_outfile(&cam_export_ctx, (*argv)[s], 0); cam_export_has_outfile = 1; } else if (strcmp(opt, "-o") == 0) { Index: trunk/src_plugins/cam/cam_compile.c =================================================================== --- trunk/src_plugins/cam/cam_compile.c (revision 31834) +++ trunk/src_plugins/cam/cam_compile.c (revision 31835) @@ -37,7 +37,7 @@ /* mkdir -p on arg - changes the string in arg */ -static int prefix_mkdir(char *arg, char **filename) +static int prefix_mkdir(char *arg, char **filename, rnd_bool nomkdir) { char *curr, *next, *end; int res; @@ -59,7 +59,8 @@ next = strrchr(curr, RND_DIR_SEPARATOR_C); if (next != NULL) *next = '\0'; - rnd_mkdir(&PCB->hidlib, arg, 0755); + if (!nomkdir) + rnd_mkdir(&PCB->hidlib, arg, 0755); if (next != NULL) { *next = RND_DIR_SEPARATOR_C; next++; Index: trunk/src_plugins/cam/cam_gui.c =================================================================== --- trunk/src_plugins/cam/cam_gui.c (revision 31834) +++ trunk/src_plugins/cam/cam_gui.c (revision 31835) @@ -137,7 +137,7 @@ rnd_hid_row_t *r; char *cell[3], *cursor_path = NULL; - cam_parse_opt_outfile(&ctx->cam, ctx->dlg[ctx->woutfile].val.str); + cam_parse_opt_outfile(&ctx->cam, ctx->dlg[ctx->woutfile].val.str, 1); hv.str = ctx->cam.prefix == NULL ? "" : ctx->cam.prefix; rnd_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wprefix, &hv);