Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idlpp: Fix that prevents more characters than specified to be trimmed from file name. #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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