summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2001-09-15 02:59:54 +0000
committerJames Henstridge <jamesh@src.gnome.org>2001-09-15 02:59:54 +0000
commita8e9f647aa464b8423f32195602540009cc461e7 (patch)
tree85ac470e757131eb0e65fa3483efffa3088cd07e
parentd7349b5905548799554bb351634a31513843e415 (diff)
downloadpygobject-a8e9f647aa464b8423f32195602540009cc461e7.tar.gz
pygobject-a8e9f647aa464b8423f32195602540009cc461e7.tar.xz
pygobject-a8e9f647aa464b8423f32195602540009cc461e7.zip
allow '_' as start of constant name. (pyg_flags_add_constants): same here.
2001-09-15 James Henstridge <james@daa.com.au> * gobjectmodule.c (pyg_enum_add_constants): allow '_' as start of constant name. (pyg_flags_add_constants): same here.
-rw-r--r--gobject/gobjectmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 32c31c7..646dded 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -2143,7 +2143,7 @@ pyg_enum_add_constants(PyObject *module, GType enum_type,
/* strip off prefix from value name, while keeping it a valid
* identifier */
for (j = prefix_len; j >= 0; j--) {
- if (g_ascii_isalpha(name[j])) {
+ if (g_ascii_isalpha(name[j]) || name[j] == '_') {
name = &name[j];
break;
}
@@ -2179,7 +2179,7 @@ pyg_flags_add_constants(PyObject *module, GType flags_type,
/* strip off prefix from value name, while keeping it a valid
* identifier */
for (j = prefix_len; j >= 0; j--) {
- if (g_ascii_isalpha(name[j])) {
+ if (g_ascii_isalpha(name[j]) || name[j] == '_') {
name = &name[j];
break;
}