diff options
author | Eric Fischer <enf@google.com> | 2010-02-16 10:37:45 -0800 |
---|---|---|
committer | Eric Fischer <enf@google.com> | 2010-02-16 14:34:32 -0800 |
commit | a877c034421143932c25daaca5f92a48ef6c3b81 (patch) | |
tree | d7f4905471ca60f080ce3677367edf91e040ec2a /core/java/android/text/util | |
parent | 9d4b57545300c6de1722094404ae09bf0f6be937 (diff) | |
download | frameworks_base-a877c034421143932c25daaca5f92a48ef6c3b81.zip frameworks_base-a877c034421143932c25daaca5f92a48ef6c3b81.tar.gz frameworks_base-a877c034421143932c25daaca5f92a48ef6c3b81.tar.bz2 |
Keep Rfc822Tokenizer from crashing when the string ends with a backslash.
Bug 2442537
Diffstat (limited to 'core/java/android/text/util')
-rw-r--r-- | core/java/android/text/util/Rfc822Tokenizer.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/text/util/Rfc822Tokenizer.java b/core/java/android/text/util/Rfc822Tokenizer.java index 9d8bfd9..69d745d 100644 --- a/core/java/android/text/util/Rfc822Tokenizer.java +++ b/core/java/android/text/util/Rfc822Tokenizer.java @@ -84,7 +84,7 @@ public class Rfc822Tokenizer implements MultiAutoCompleteTextView.Tokenizer { if (c == '"') { i++; break; - } else if (c == '\\') { + } else if (c == '\\' && i + 1 < cursor) { name.append(text.charAt(i + 1)); i += 2; } else { @@ -110,7 +110,7 @@ public class Rfc822Tokenizer implements MultiAutoCompleteTextView.Tokenizer { comment.append(c); level++; i++; - } else if (c == '\\') { + } else if (c == '\\' && i + 1 < cursor) { comment.append(text.charAt(i + 1)); i += 2; } else { |