Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Brian Bull" To: cygwin AT cygwin DOT com Date: Fri, 11 Jan 2002 17:16:17 +1300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: funny strstream bug (yes I know it's deprecated) Message-ID: <3C3F1DE1.27170.AB0B7BB@localhost> X-mailer: Pegasus Mail for Win32 (v3.12c) People probably don't care about strstream any more but I still thought this was an interesting one. Self contained bug example follows: --------------------------------------- #include #include int main(){ std::string fred = " some_spaces_precede_a_single_exceedingly_long_word 1 "; istrstream arguments((fred+" ").c_str()); std::string base; arguments >> base; int L; arguments >> L; cerr << "L " << L << '\n'; } // Expected output: L 1 // Actual output on my system: L 0 (??!!) ---------------------------------------- Puzzlingly, the code can be made to work by replacing the words 'exceedingly long' by 'short' in std::string fred. I'm running today's download of Cygwin and gcc on Win2000. Any enlightenment welcome. Yours Brian Bull -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/