1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 03:02:22 -05:00

Caldav: From John Ahern, workaround for ICS with empty last line

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@421 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-05 10:24:58 +00:00
parent d9610efd27
commit 07db3c685e

View File

@ -19,13 +19,14 @@ public class ICSBufferedReader extends BufferedReader {
@Override
public String readLine() throws IOException {
if (nextLine == null) {
// empty line means end of ICS
if (nextLine == null || nextLine.length() == 0) {
return null;
} else {
currentLine.setLength(0);
currentLine.append(nextLine);
nextLine = super.readLine();
while (nextLine != null && nextLine.charAt(0) == ' ') {
while (nextLine != null && !(nextLine.length() == 0) && nextLine.charAt(0) == ' ') {
currentLine.append(nextLine.substring(1));
nextLine = super.readLine();
}