Merge branch 'factor-elide-middle' of git://github.com/polrop/ninja
authorEvan Martin <martine@danga.com>
Wed, 1 Aug 2012 23:12:55 +0000 (16:12 -0700)
committerEvan Martin <martine@danga.com>
Wed, 1 Aug 2012 23:12:55 +0000 (16:12 -0700)
Conflicts:
src/util.cc

1  2 
src/util.cc
src/util.h

diff --cc src/util.cc
@@@ -330,3 -302,25 +330,15 @@@ double GetLoadAverage() 
    return loadavg[0];
  }
  #endif // _WIN32
 -double GetLoadAverage()
 -{
 -#ifdef _WIN32
 -  return GetLoadAverage_win32();
 -#else
 -  return GetLoadAverage_unix();
 -#endif // _WIN32
 -}
 -
 -string ElideMiddle(const string& str, size_t width)
 -{
++string ElideMiddle(const string& str, size_t width) {
+   const int kMargin = 3;  // Space for "...".
+   string result = str;
+   if (result.size() + kMargin > width) {
+     int elide_size = (width - kMargin) / 2;
+     result = result.substr(0, elide_size)
+       + "..."
+       + result.substr(result.size() - elide_size, elide_size);
+   }
+   return result;
+ }
diff --cc src/util.h
Simple merge