070b5d
diff -up swig-2.0.7/Source/Swig/naming.c.setools swig-2.0.7/Source/Swig/naming.c
070b5d
--- swig-2.0.7/Source/Swig/naming.c.setools	2011-12-11 17:29:51.000000000 +0100
070b5d
+++ swig-2.0.7/Source/Swig/naming.c	2012-06-27 16:21:21.248375130 +0200
070b5d
@@ -215,11 +215,11 @@ String *Swig_name_member(const_String_or
070b5d
     Append(r, f);
070b5d
   }
070b5d
   cname = Char(rclassname);
070b5d
-  if ((strncmp(cname, "struct ", 7) == 0) || ((strncmp(cname, "class ", 6) == 0)) || ((strncmp(cname, "union ", 6) == 0))) {
070b5d
-    cname = strchr(cname, ' ') + 1;
070b5d
-  }
070b5d
   replace_nspace(r, nspace);
070b5d
   Replace(r, "%c", cname, DOH_REPLACE_ANY);
070b5d
+  if ((strncmp(cname, "struct ", 7) == 0) || ((strncmp(cname, "class ", 6) == 0)) || ((strncmp(cname, "union ", 6) == 0))) {
070b5d
+    Replace(r, " ", "_", DOH_REPLACE_FIRST);
070b5d
+  }
070b5d
   Replace(r, "%m", membername, DOH_REPLACE_ANY);
070b5d
   /*  name_mangle(r); */
070b5d
   Delete(rclassname);