Skip to content

Conversation

@FreeBugs
Copy link

We have noticed that malformed includes are generated for isoc++2 in some cases when using -o maintain-include-namespace.
Steps to reproduce:

  1. Create two files:

main.idl

include <ospl.idl>
struct foo {
  bar baz;
}

ospl.idl

typedef octet bar;
  1. Execute idlpp -l isocpp2 -o maintain-include-namespace main.idl

  2. Notice that the trailing letter l (lower case L) has been stripped of the included file:
    main.h

...
#include "osp.h"
...

The implementation of trimming of the file name extension .idl is implemented as "remove any of the characters '.idl' until none of them is left at the end of the string". This results in the behavior described above.

Therefore I propose a simple fix that limits the number of characters removed to the length of the string passed to the os_str_rtrim function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant