Index: org/jruby/lexer/yacc/LexerSource.java =================================================================== --- org/jruby/lexer/yacc/LexerSource.java (revision 3095) +++ org/jruby/lexer/yacc/LexerSource.java (working copy) @@ -253,25 +253,16 @@ * @return the current char or EOF (at EOF or on error) */ private char wrappedRead() throws IOException { - int c = reader.read(); - - // If \r\n then just pass along \n (windows) - // If \r[^\n] then pass along \n (MAC) - if (c == '\r') { - if ((c = reader.read()) != '\n') { - unread((char)c); - c = '\n'; - } else { - // Position within source must reflect the actual offset and column. Since - // we ate an extra character here (this accounting is normally done in read - // ), we should update position info. - offset++; - column++; - } - } - - return c != -1 ? (char) c : '\0'; - + int c = reader.read(); + + // If \r[^\n] then pass along \n (MAC) + if (c == '\r') { + if(!peek('\n')) { + c = '\n'; + } + } + + return c != -1 ? (char) c : '\0'; } /**