Browse Source

bugzilla report 39635: bugs in readerinputstream

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@441945 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 19 years ago
parent
commit
02139b25d0
4 changed files with 13 additions and 8 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +1
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +7
    -8
      src/main/org/apache/tools/ant/util/ReaderInputStream.java

+ 1
- 0
CONTRIBUTORS View File

@@ -230,6 +230,7 @@ Steve Morin
Steven E. Newton Steven E. Newton
Takashi Okamoto Takashi Okamoto
Tariq Master Tariq Master
Trejkaz Xaoza
Thomas Butz Thomas Butz
Thomas Christen Thomas Christen
Thomas Christensen Thomas Christensen


+ 1
- 0
WHATSNEW View File

@@ -18,6 +18,7 @@ Fixed bugs:
* Exception reporting in <copy> was broken. Bugzilla report 40300. * Exception reporting in <copy> was broken. Bugzilla report 40300.
* Handling of corrupt tar files, TarInputStream.read() never returns EOF. * Handling of corrupt tar files, TarInputStream.read() never returns EOF.
Bugzilla report 39924. Bugzilla report 39924.
* Some bugs in ReaderInputStream. Bugzilla report 39635.


Other changes: Other changes:
-------------- --------------


+ 4
- 0
contributors.xml View File

@@ -958,6 +958,10 @@
<first>Tom</first> <first>Tom</first>
<last>Eugelink</last> <last>Eugelink</last>
</name> </name>
<name>
<first>Trejkaz</first>
<last>Xaoz</last>
</name>
<name> <name>
<first>Ulrich</first> <first>Ulrich</first>
<last>Schmidt</last> <last>Schmidt</last>


+ 7
- 8
src/main/org/apache/tools/ant/util/ReaderInputStream.java View File

@@ -85,16 +85,13 @@ public class ReaderInputStream extends InputStream {
} else { } else {
byte[] buf = new byte[1]; byte[] buf = new byte[1];
if (read(buf, 0, 1) <= 0) { if (read(buf, 0, 1) <= 0) {
result = -1;
return -1;
} else {
result = buf[0];
} }
result = buf[0];
}

if (result < -1) {
result += 256;
} }


return result;
return result & 0xFF;
} }


/** /**
@@ -112,7 +109,9 @@ public class ReaderInputStream extends InputStream {
if (in == null) { if (in == null) {
throw new IOException("Stream Closed"); throw new IOException("Stream Closed");
} }

if (len == 0) {
return 0;
}
while (slack == null) { while (slack == null) {
char[] buf = new char[len]; // might read too much char[] buf = new char[len]; // might read too much
int n = in.read(buf); int n = in.read(buf);


Loading…
Cancel
Save