diff options
Diffstat (limited to 'lib/String.cc')
-rw-r--r-- | lib/String.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/String.cc b/lib/String.cc index 83adad7..60ca6df 100644 --- a/lib/String.cc +++ b/lib/String.cc @@ -181,12 +181,14 @@ ostream & operator<<(ostream & os, const String & s) { } istream & operator>>(istream & is, String & s) { - char c; + char c = 0; s.set(""); while (!is.eof()) { - is >> c; + c = is.get(); + if (c == '\n') return is; + if (c == '\r') continue; s += c; } |