diff options
author | Matthew DeVore <matvore@google.com> | 2015-09-08 17:42:27 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2015-09-08 22:27:45 +0000 |
commit | 475a1344e16337d053dbb5d8a48379cd87bea042 (patch) | |
tree | d9b642e4d99581f101e7ce28734ddc5444125a80 /third_party/java/dd_plist | |
parent | 79e40acafe09bc7cbb09556fd6d6b389d5b77d5c (diff) |
RELNOTES: Support empty plist files
--
MOS_MIGRATED_REVID=102570037
Diffstat (limited to 'third_party/java/dd_plist')
-rw-r--r-- | third_party/java/dd_plist/README | 1 | ||||
-rw-r--r-- | third_party/java/dd_plist/java/com/dd/plist/PropertyListParser.java | 2 |
2 files changed, 2 insertions, 1 deletions
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))); |