From 114630226d8dc66b9e3f0e73ab17abf19b1197b8 Mon Sep 17 00:00:00 2001 From: Juerg Billeter Date: Sun, 23 Mar 2008 10:22:35 +0000 Subject: [PATCH] fix vapigen crash 2008-03-23 Juerg Billeter * vala/valanamespace.vala: fix vapigen crash svn path=/trunk/; revision=1154 --- ChangeLog | 4 ++++ vala/valanamespace.vala | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94e3c45..ddcb3ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-03-23 Jürg Billeter + * vala/valanamespace.vala: fix vapigen crash + +2008-03-23 Jürg Billeter + * vapi/glib-2.0.vapi: enhance GIOChannel binding, based on patch by Nicolas Joseph, fixes bug 523876 diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala index 9fd827f..c136523 100644 --- a/vala/valanamespace.vala +++ b/vala/valanamespace.vala @@ -260,7 +260,13 @@ public class Vala.Namespace : Symbol { if (cprefixes.size > 0) { return cprefixes[0]; } else if (null != name) { - return parent_symbol.get_cprefix () + name; + string parent_prefix; + if (parent_symbol == null) { + parent_prefix = ""; + } else { + parent_prefix = parent_symbol.get_cprefix (); + } + return parent_prefix + name; } else { return ""; } @@ -295,7 +301,13 @@ public class Vala.Namespace : Symbol { if (name == null) { lower_case_cprefix = ""; } else { - lower_case_cprefix = "%s%s_".printf (parent_symbol.get_lower_case_cprefix (), camel_case_to_lower_case (name)); + string parent_prefix; + if (parent_symbol == null) { + parent_prefix = ""; + } else { + parent_prefix = parent_symbol.get_lower_case_cprefix (); + } + lower_case_cprefix = "%s%s_".printf (parent_prefix, camel_case_to_lower_case (name)); } } return lower_case_cprefix; -- 2.7.4