diff options
author | Kenny Root <kroot@android.com> | 2010-06-01 22:56:39 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2010-06-01 22:56:39 -0700 |
commit | e99c012503bbd205cbaa9f16f9894ca5ffeaaf76 (patch) | |
tree | 1bfad156d0fd9517b31111fbf3555325c59771e5 /core/java/android/text/util | |
parent | ef367529f9c7a538d74599b37b49ac309d0a8d8c (diff) | |
parent | 9694f9056a86081aadc1d7caab82d340847b3884 (diff) | |
download | frameworks_base-e99c012503bbd205cbaa9f16f9894ca5ffeaaf76.zip frameworks_base-e99c012503bbd205cbaa9f16f9894ca5ffeaaf76.tar.gz frameworks_base-e99c012503bbd205cbaa9f16f9894ca5ffeaaf76.tar.bz2 |
Merge "Improved error-handling in Rfc822Tokenizer"
Diffstat (limited to 'core/java/android/text/util')
-rw-r--r-- | core/java/android/text/util/Rfc822Tokenizer.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/text/util/Rfc822Tokenizer.java b/core/java/android/text/util/Rfc822Tokenizer.java index cb39f7d..3a67e20 100644 --- a/core/java/android/text/util/Rfc822Tokenizer.java +++ b/core/java/android/text/util/Rfc822Tokenizer.java @@ -86,7 +86,9 @@ public class Rfc822Tokenizer implements MultiAutoCompleteTextView.Tokenizer { i++; break; } else if (c == '\\') { - name.append(text.charAt(i + 1)); + if (i + 1 < cursor) { + name.append(text.charAt(i + 1)); + } i += 2; } else { name.append(c); @@ -112,7 +114,9 @@ public class Rfc822Tokenizer implements MultiAutoCompleteTextView.Tokenizer { level++; i++; } else if (c == '\\') { - comment.append(text.charAt(i + 1)); + if (i + 1 < cursor) { + comment.append(text.charAt(i + 1)); + } i += 2; } else { comment.append(c); |