src/eval.cc
// Strip leading spaces and trailing spaces and colons.
Strip leading spaces and trailing spaces and colons.
Strip leading spaces and trailing spaces and colons .
static string FormatRuleError(const string& before_term) {
  if (before_term.size() == 0) {
    return before_term;
  }
  size_t size = before_term.size();
  size_t start = 0;
  while (start < size && isspace(before_term[start])) {
    start++;
  }
  size_t end = size;  
  while (end > start &&
         (isspace(before_term[end - 1]) || before_term[end - 1] == ':')) {
    end--;
  }
  return before_term.substr(start, end - start);
}
static string FormatRuleError ( const string & before_term ) { if ( before_term . size ( ) == 0 ) { return before_term ; } size_t size = before_term . size ( ) ; size_t start = 0 ; while ( start < size && isspace ( before_term [ start ] ) ) { start ++ ; } size_t end = size ; while ( end > start && ( isspace ( before_term [ end - 1 ] ) || before_term [ end - 1 ] == ' ' ) ) { end -- ; } return before_term . substr ( start , end - start ) ; }
Strip leading spaces and trailing spaces and colons.
Strip leading spaces and trailing spaces and colons .
// we already handled length == 0