summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alon Albert <aalbert@google.com> 2011-02-22 21:56:23 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2011-02-22 21:56:23 -0800
commit5df34ac754564aa5aa8e21e7f73c3cd84fe0081e (patch)
tree57c9aa175e72e88103aca528e24660ad6406af32
parent74f0f0e7eb21d4824dd9d7519de18610703058db (diff)
parenta0946d6399431d3cc86ef06d44695251ab04933b (diff)
am a0946d63: am 1aba843d: am ccc802e1: Merge "Support quoted parameters" into gingerbread
* commit 'a0946d6399431d3cc86ef06d44695251ab04933b': Support quoted parameters
-rw-r--r--core/java/android/pim/ICalendar.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/pim/ICalendar.java b/core/java/android/pim/ICalendar.java
index cc0f45ee2402..9c4eaf4f5765 100644
--- a/core/java/android/pim/ICalendar.java
+++ b/core/java/android/pim/ICalendar.java
@@ -578,6 +578,23 @@ public class ICalendar {
+ text);
}
parameter.name = text.substring(startIndex + 1, equalIndex);
+ } else if (c == '"') {
+ if (parameter == null) {
+ throw new FormatException("Expected parameter before '\"' in " + text);
+ }
+ if (equalIndex == -1) {
+ throw new FormatException("Expected '=' within parameter in " + text);
+ }
+ if (state.index > equalIndex + 1) {
+ throw new FormatException("Parameter value cannot contain a '\"' in " + text);
+ }
+ final int endQuote = text.indexOf('"', state.index + 1);
+ if (endQuote < 0) {
+ throw new FormatException("Expected closing '\"' in " + text);
+ }
+ parameter.value = text.substring(state.index + 1, endQuote);
+ state.index = endQuote + 1;
+ return parameter;
}
++state.index;
}