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

Fix DoubleDotInputStream

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1734 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-07-14 22:15:54 +00:00
parent 876deaf969
commit 921070b3d1
2 changed files with 3 additions and 6 deletions

View File

@ -67,11 +67,8 @@ public class DoubleDotInputStream extends PushbackInputStream {
} }
// \r\n.. // \r\n..
} else if (buffer[index] == '.') { } else if (buffer[index] == '.') {
// \r\n..\r
if ((readNextByte()) == '\r') {
// replace double dot // replace double dot
buffer[--index] = '\r'; index--;
}
} }
} }
} }

View File

@ -101,7 +101,7 @@ public class TestDoubleDotInputStream extends TestCase {
public void testAnotherTest() throws IOException { public void testAnotherTest() throws IOException {
String value = "foo\r\n..bar"; String value = "foo\r\n..bar";
assertEquals(value, doubleDotRead(value)); assertEquals(value.replaceAll("\\.\\.", "."), doubleDotRead(value));
} }
} }