[thrift] stupid case bug in Erlang codegen
authorChristopher Piro <cpiro@apache.org>
Tue, 24 Jul 2007 06:20:47 +0000 (06:20 +0000)
committerChristopher Piro <cpiro@apache.org>
Tue, 24 Jul 2007 06:20:47 +0000 (06:20 +0000)
Summary: stop generating files/modules in titlecase

Notes: somehow we access service_name_ before the constructor downcases it ... burnsauce

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665170 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_erl_generator.cc

index f069b76..ba66247 100644 (file)
@@ -494,6 +494,10 @@ void t_erl_generator::generate_erl_struct_writer(ostream& out,
  * @param tservice The service definition
  */
 void t_erl_generator::generate_service(t_service* tservice) {
+  // somehow this point is reached before the constructor and it's not downcased yet
+  // ...awesome
+  service_name_[0] = tolower(service_name_[0]);
+
   string f_service_hrl_name = string(T_ERL_DIR)+"/"+service_name_+".hrl";
   string f_service_name = string(T_ERL_DIR)+"/"+service_name_+".erl";
   f_service_file_.open(f_service_name.c_str());