diff --git a/src/idlcxx/src/generator.c b/src/idlcxx/src/generator.c index 24b541a7..a3118366 100644 --- a/src/idlcxx/src/generator.c +++ b/src/idlcxx/src/generator.c @@ -766,7 +766,12 @@ idl_retcode_t generate(const idl_pstate_t *pstate) } file = sep ? sep + 1 : path; - if (idl_isabsolute(path) || !sep) + if (pstate->outdir) { + if (!(dir = idl_strdup(pstate->outdir))) { + goto err_dir; + } + } + else if (idl_isabsolute(path) || !sep) dir = empty; else if (!(dir = idl_strndup(path, (size_t)(sep-path)))) goto err_dir;