Browse Source

fix trim_blanks bug

cxgeorge 24 years ago
parent
commit
8f30e44234
1 changed files with 3 additions and 0 deletions
  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) {
 trim_blanks(const string &str) {
   size_t first, last;
   size_t first, last;
 
 
+  if(str.empty())
+      return str;
+
   first = 0;
   first = 0;
   while (first < str.length() && isspace(str[first])) {
   while (first < str.length() && isspace(str[first])) {
     first++;
     first++;