diff options
3 files changed, 2 insertions, 2 deletions
diff --git a/src/objc_tools/plmerge/java/com/google/devtools/build/xcode/plmerge/PlistMerging.java b/src/objc_tools/plmerge/java/com/google/devtools/build/xcode/plmerge/PlistMerging.java index f9f20bf00b..e505a0d087 100644 --- a/src/objc_tools/plmerge/java/com/google/devtools/build/xcode/plmerge/PlistMerging.java +++ b/src/objc_tools/plmerge/java/com/google/devtools/build/xcode/plmerge/PlistMerging.java @@ -302,7 +302,6 @@ public class PlistMerging extends Value<PlistMerging> { byte[] buffer = new byte[UTF8_BOM.length]; int read = stream.read(buffer); stream.reset(); - buffer = Arrays.copyOf(buffer, read); if (UTF8_BOM.length == read && Arrays.equals(buffer, UTF8_BOM)) { stream.skip(UTF8_BOM.length); diff --git a/third_party/java/dd_plist/README b/third_party/java/dd_plist/README index 72539f9c6a..cd24c554a0 100644 --- a/third_party/java/dd_plist/README +++ b/third_party/java/dd_plist/README @@ -32,3 +32,4 @@ Local Modifications: ASCIIPropertyListParser.java. - Allow \ escaping of characters that need not be escaped in ASCIIPropertyListParser.java. +- Make PropertyListParser.determineType handle an empty bytes array properly. diff --git a/third_party/java/dd_plist/java/com/dd/plist/PropertyListParser.java b/third_party/java/dd_plist/java/com/dd/plist/PropertyListParser.java index 66cac14c98..4e681446b8 100644 --- a/third_party/java/dd_plist/java/com/dd/plist/PropertyListParser.java +++ b/third_party/java/dd_plist/java/com/dd/plist/PropertyListParser.java @@ -88,7 +88,7 @@ public class PropertyListParser { private static int determineType(byte[] bytes) { //Skip any possible whitespace at the beginning of the file int offset = 0; - while(offset < bytes.length && bytes[offset] == ' ' || bytes[offset] == '\t' || bytes[offset] == '\r' || bytes[offset] == '\n' || bytes[offset] == '\f') { + while(offset < bytes.length && (bytes[offset] == ' ' || bytes[offset] == '\t' || bytes[offset] == '\r' || bytes[offset] == '\n' || bytes[offset] == '\f')) { offset++; } return determineType(new String(bytes, offset, Math.min(8, bytes.length - offset))); |