ソースを参照

fix trim_blanks bug

cxgeorge 24 年 前
コミット
8f30e44234
1 ファイル変更3 行追加0 行削除
  1. 3 0
      dtool/src/cppparser/cppPreprocessor.cxx

+ 3 - 0
dtool/src/cppparser/cppPreprocessor.cxx

@@ -63,6 +63,9 @@ static string
 trim_blanks(const string &str) {
   size_t first, last;
 
+  if(str.empty())
+      return str;
+
   first = 0;
   while (first < str.length() && isspace(str[first])) {
     first++;