diff options
author | Lucas Rocha <lucasr@gnome.org> | 2008-10-11 14:42:32 +0000 |
---|---|---|
committer | Lucas Almeida Rocha <lucasr@src.gnome.org> | 2008-10-11 14:42:32 +0000 |
commit | f1be097d3be66639374c160225f01cfd42275953 (patch) | |
tree | 8025cb7d80642b03a2ca7b18dcd6970113ee993b /giscanner/utils.py | |
parent | c8eb431a039832d2034f0d012563008af43d80c0 (diff) | |
download | gobject-introspection-f1be097d3be66639374c160225f01cfd42275953.tar.gz |
Bug 552376: scanner generates wrong names for enum members when there's no
2008-10-11 Lucas Rocha <lucasr@gnome.org>
Bug 552376: scanner generates wrong names for enum members when
there's no defined gtype.
* giscanner/utils.py (strip_common_prefix): Always strip common
prefix exactly up to the last "_", and not beyond.
* tests/scanner/foo.h (FooEnumNoType): add FOO_ENUM_NEUF. The point
here is that the first character after the last '_' should should be
the same as the character in the same position on the type name.
* tests/scanner/foo-expected.gir: test that
svn path=/trunk/; revision=664
Diffstat (limited to 'giscanner/utils.py')
-rw-r--r-- | giscanner/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/utils.py b/giscanner/utils.py index 959ed830..d03465e3 100644 --- a/giscanner/utils.py +++ b/giscanner/utils.py @@ -56,8 +56,11 @@ def extract_libtool(libname): def strip_common_prefix(first, second): + max_index = second.rfind('_') + second_len = len(second) second = second.replace('_', '') + max_index -= second_len - len(second) - 1 for i, c in enumerate(first.upper()): - if i >= len(second) or c != second[i]: + if i >= len(second) or c != second[i] or i == max_index: return second[i:] return second[i + 1:] |