From 61a9379c9c1347d4e01a34108b76bdc8adbb6d51 Mon Sep 17 00:00:00 2001 From: theraven Date: Sat, 12 Feb 2011 11:18:11 +0000 Subject: [PATCH] Encodings of structures in ivars include the encoding of the field names (this is actually really nice: we could - in theory - expose structure field members via KVC, as an extension). This case was not correctly handled by libobjc2. --- encoding2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/encoding2.c b/encoding2.c index fff4398..37723d5 100644 --- a/encoding2.c +++ b/encoding2.c @@ -95,6 +95,22 @@ static void parse_struct_or_union(const char **type, type_parser callback, void while (**type != endchar) { + // Structure elements sometimes have their names in front of each + // element, as in {NSPoint="x"f"y"f} - We need to skip the type name + // here. + // + // TODO: In a future version we should provide a callback that lets + // users of this code get the field name + if ('"'== **type) + { + + do + { + (*type)++; + } while ('"' != **type); + // Skip the closing " + (*type)++; + } *type = callback(*type, context); } // skip }