From 99d150ae230ba3d0b187eaa1d21a44143071795c Mon Sep 17 00:00:00 2001 From: Alexis Potvin Date: Wed, 23 Oct 2024 14:59:04 -0400 Subject: [PATCH] Remove absolute path in implementation header include --- src/idlcxx/src/generator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/idlcxx/src/generator.c b/src/idlcxx/src/generator.c index 090199d7..dc11ec7d 100644 --- a/src/idlcxx/src/generator.c +++ b/src/idlcxx/src/generator.c @@ -654,9 +654,13 @@ print_header(FILE *fh, const char *in, const char *out) static idl_retcode_t print_impl_header(FILE *fh, const char *in, const char *out, const char *hdr) { + const char *sep = hdr; + for (const char *ptr = sep; *ptr; ptr++) + if (idl_isseparator((unsigned char)*ptr)) + sep = ptr+1; const char *fmt = "#include \"%s\"\n\n"; if (print_header(fh, in, out) - || idl_fprintf(fh, fmt, hdr) < 0) + || idl_fprintf(fh, fmt, sep) < 0) return IDL_RETCODE_NO_MEMORY; return IDL_RETCODE_OK; }