diff --git a/simgear/environment/metar.cxx b/simgear/environment/metar.cxx index 898f76d4..9d9c944f 100644 --- a/simgear/environment/metar.cxx +++ b/simgear/environment/metar.cxx @@ -203,6 +203,14 @@ std::ostream& operator << (std::ostream& out, const Tab& t) std::ostringstream& out2 = *(std::ostringstream*) &out; std::string s = out2.str(); + + if (t._stops < 0) { + if (!s.size() || s[s.size()-1] != ' ') { + out << ' '; + } + return out; + } + auto nl = s.rfind('\n'); if (nl < 0) nl = 0; int column = 0; diff --git a/simgear/environment/metar.hxx b/simgear/environment/metar.hxx index 3b08602b..a92bf1a5 100644 --- a/simgear/environment/metar.hxx +++ b/simgear/environment/metar.hxx @@ -236,8 +236,8 @@ public: inline const std::vector getWeather2() const { return _weather2; } /* Returns human-readable description. If tabtops is 0, we use tab - characters, otherwise we use spaces to pad to multiple of . - */ + characters. If +ve we use spaces to pad to multiple of . If + -1 all sequences of tabs are represented by a single space. */ std::string getDescription(int tabstops) const; protected: