summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorAlon Albert <aalbert@google.com>2011-02-22 10:31:26 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-22 10:31:26 -0800
commitccc802e12be64248c2c6822eb36a957435a06ef2 (patch)
tree4613c0b14766d490f1eb5191a7aa52a054f4a4b3 /core/java
parent99cca89f41e500f8b39fd75eb17f337422c4ac90 (diff)
parent06912bddc6b9db4fd01ed689ca4a8e16b0790244 (diff)
Merge "Support quoted parameters" into gingerbread
Diffstat (limited to 'core/java')
-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;
}