Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 51176 invoked from network); 8 Nov 2007 15:32:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2007 15:32:46 -0000 Received: (qmail 78312 invoked by uid 500); 8 Nov 2007 15:32:34 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 78298 invoked by uid 500); 8 Nov 2007 15:32:34 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 78289 invoked by uid 99); 8 Nov 2007 15:32:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 07:32:34 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 15:33:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A6F541A983A; Thu, 8 Nov 2007 07:32:23 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r593201 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java Date: Thu, 08 Nov 2007 15:32:23 -0000 To: commits@harmony.apache.org From: odeakin@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071108153223.A6F541A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: odeakin Date: Thu Nov 8 07:32:22 2007 New Revision: 593201 URL: http://svn.apache.org/viewvc?rev=593201&view=rev Log: Handle the EBCDIC 'NEL' (new line) character in BufferedReader.readLine(). Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java?rev=593201&r1=593200&r2=593201&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java Thu Nov 8 07:32:22 2007 @@ -299,8 +299,10 @@ * Answers a String representing the next line of text * available in this BufferedReader. A line is represented by 0 or more * characters followed by '\n', '\r', - * '\r\n' or end of stream. The String does - * not include the newline sequence. + * '\r\n' or end of stream. The String does not + * include the newline sequence. + * In EBCDIC systems, a new line can also be represented by the + * '\u0085' (NEL) character. * * @return the contents of the line or null if no characters were read * before end of stream. @@ -335,6 +337,11 @@ pos++; } return res; + } else if (ch == '\u0085') { + /* Also handle the EBCDIC NEL character */ + String res = new String(buf, pos, charPos - pos); + pos = charPos + 1; + return res; } } @@ -359,7 +366,7 @@ } for (int charPos = pos; charPos < count; charPos++) { if (eol == '\0') { - if ((buf[charPos] == '\n' || buf[charPos] == '\r')) { + if ((buf[charPos] == '\n' || buf[charPos] == '\r') || (buf[charPos] == '\u0085')) { eol = buf[charPos]; } } else if (eol == '\r' && (buf[charPos] == '\n')) {