martinc 01/06/13 18:11:29 Modified: src/share/org/apache/struts/upload Tag: STRUTS_1_0_BRANCH MultipartIterator.java Log: Fixed a bug which could cause corruption of an uploaded file. If the file contained the sequence \r\n\n, it would be transformed to \r\n\r\n on upload. Patch supplied by Markus Pallo - thanks! Revision Changes Path No revision No revision 1.13.2.1 +1 -3 jakarta-struts/src/share/org/apache/struts/upload/MultipartIterator.java Index: MultipartIterator.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/upload/MultipartIterator.java,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -r1.13 -r1.13.2.1 --- MultipartIterator.java 2001/05/10 00:56:54 1.13 +++ MultipartIterator.java 2001/06/14 01:11:28 1.13.2.1 @@ -497,13 +497,11 @@ if (cutNewline) { fos.write('\n'); } + cutCarriage = false; if (bytesRead > 0) { if (lineBuffer[bytesRead-1] == '\r') { bytesRead--; cutCarriage = true; - } - else { - cutCarriage = false; } } cutNewline = true;