From: <mie...@us...> - 2008-06-20 14:29:28
|
Revision: 2559 http://oorexx.svn.sourceforge.net/oorexx/?rev=2559&view=rev Author: miesfeld Date: 2008-06-20 07:29:35 -0700 (Fri, 20 Jun 2008) Log Message: ----------- If StreamInfo::setPosition() fails, raise the not ready condition. Revert StreamInfo::checkEof() to the original code (misunderstood its purpose.) Modified Paths: -------------- sandbox/rick/opt/kernel/streamLibrary/StreamNative.cpp Modified: sandbox/rick/opt/kernel/streamLibrary/StreamNative.cpp =================================================================== --- sandbox/rick/opt/kernel/streamLibrary/StreamNative.cpp 2008-06-20 04:38:17 UTC (rev 2558) +++ sandbox/rick/opt/kernel/streamLibrary/StreamNative.cpp 2008-06-20 14:29:35 UTC (rev 2559) @@ -367,18 +367,24 @@ } /** - * Check for an eof condition, and raise the appropriate not - * ready condition if it is true. + * Raise the appropriate not ready condition, checking first for an eof + * condition. * * @param result A result object to be passed with the Notready condition. */ void StreamInfo::checkEof() { - // if this is an eof condition, raise that not ready - if (fileInfo.atEof() && !fileInfo.hasBufferedInput()) + // if this is an eof condition, raise the eof not ready + if (fileInfo.atEof()) { eof(); } + else + { + // must be an error, so raise the error not ready using the file error + // information + notreadyError(); + } } @@ -1016,11 +1022,12 @@ */ void StreamInfo::setPosition(int64_t position, int64_t &newPosition) { - // seek to the target position, if possible. The request position + // Seek to the target position, if possible. The request position // is a 1-based character number. We need to convert this into // a zero-based one before moving. - if (fileInfo.seek(position - 1, SEEK_SET, newPosition)) + if (!fileInfo.seek(position - 1, SEEK_SET, newPosition)) { + // Failed, raise a not ready condition. checkEof(); } // convert the target position back to 1-based. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |