Jelajahi Sumber

don't allow leading digits in group names

David Rose 24 tahun lalu
induk
melakukan
a4c59b67e8
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  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;
   return result;
 }
 }