Browse Source

don't allow leading digits in group names

David Rose 24 years ago
parent
commit
a4c59b67e8
1 changed files with 6 additions and 0 deletions
  1. 6 0
      pandatool/src/xfile/xFileMaker.cxx

+ 6 - 0
pandatool/src/xfile/xFileMaker.cxx

@@ -437,6 +437,12 @@ make_nice_name(const string &str) {
     }
   }
 
+  if (!str.empty() && isdigit(str[0])) {
+    // If the name begins with a digit, we must make it begin with
+    // something else, like for instance an underscore.
+    result = '_' + result;
+  }
+
   return result;
 }