From 1ab23b133ad9b48b9f67117f150026ff48daa927 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 2 Oct 2008 13:15:09 +0000 Subject: Bug 554521: scanner generates wrong names for enum members with full type name prefix * giscanner/utils.py (strip_common_prefix): Fix this to strip the right amount when the entire "first" string is a prefix of "second" * tests/scanner/foo.h (FooEnumFullname): * tests/scanner/foo-expected.gir: test that svn path=/trunk/; revision=640 --- ChangeLog | 12 ++++++++++++ giscanner/utils.py | 4 ++-- tests/scanner/foo-expected.gir | 5 +++++ tests/scanner/foo.h | 7 +++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1905c72b..c75133a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-09-30 Dan Winship + + Bug 554521: scanner generates wrong names for enum members with + full type name prefix + + * giscanner/utils.py (strip_common_prefix): Fix this to strip the + right amount when the entire "first" string is a prefix of + "second" + + * tests/scanner/foo.h (FooEnumFullname): + * tests/scanner/foo-expected.gir: test that + 2008-09-29 Colin Walters Bug 552380: Array parameters should be marked in the gir diff --git a/giscanner/utils.py b/giscanner/utils.py index c2f6e5d8..959ed830 100644 --- a/giscanner/utils.py +++ b/giscanner/utils.py @@ -59,5 +59,5 @@ def strip_common_prefix(first, second): second = second.replace('_', '') for i, c in enumerate(first.upper()): if i >= len(second) or c != second[i]: - break - return second[i:] + return second[i:] + return second[i + 1:] diff --git a/tests/scanner/foo-expected.gir b/tests/scanner/foo-expected.gir index 057c3a70..81158550 100644 --- a/tests/scanner/foo-expected.gir +++ b/tests/scanner/foo-expected.gir @@ -245,6 +245,11 @@ + + + + +