summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-14 21:19:00 -0400
committerJune McEnroe <june@causal.agency>2020-04-14 21:19:00 -0400
commit80191306f44ab262c83b354d2e4442e807249aeb (patch)
tree4dbb0dd3102461a3ad728cd07fb80b0ab5d497ef
parentFind text content for Atom in multipart/mixed and /alternative (diff)
downloadbubger-80191306f44ab262c83b354d2e4442e807249aeb.tar.gz
bubger-80191306f44ab262c83b354d2e4442e807249aeb.zip
Parse . as an atom on its own
-rw-r--r--export.c2
-rw-r--r--imap.c2
-rw-r--r--imap.h3
3 files changed, 4 insertions, 3 deletions
diff --git a/export.c b/export.c
index 5647086..644055c 100644
--- a/export.c
+++ b/export.c
@@ -170,7 +170,7 @@ bool exportData(FILE *imap, enum Atom tag, struct List items) {
 
 		if (section.ptr[0].type == Atom) {
 			name = section.ptr[0].atom;
-			if (name == AtomHeaderFields) {
+			if (name == AtomHeader) {
 				bodyHeader = data;
 			} else if (name == AtomText) {
 				bodyText = data;
diff --git a/imap.c b/imap.c
index 9743ac8..b47a520 100644
--- a/imap.c
+++ b/imap.c
@@ -97,7 +97,7 @@ static void imapLine(FILE *imap) {
 }
 
 static struct Data parseAtom(void) {
-	size_t len = strcspn(ptr, " ()[]{\"");
+	size_t len = (*ptr == '.' ? 1 : strcspn(ptr, " .()[]{\""));
 	struct Data data = {
 		.type = Atom,
 		.atom = atomn(ptr, len),
diff --git a/imap.h b/imap.h
index a2c13bd..0aa5636 100644
--- a/imap.h
+++ b/imap.h
@@ -57,8 +57,9 @@
 	X(AtomEnvelope, "ENVELOPE") \
 	X(AtomBodyStructure, "BODYSTRUCTURE") \
 	X(AtomBody, "BODY") \
-	X(AtomHeaderFields, "HEADER.FIELDS") \
+	X(AtomHeader, "HEADER") \
 	X(AtomText, "TEXT") \
+	X(AtomDot, ".") \
 	X(AtomUntagged, "*")
 
 enum Atom {
palaver/rc.d/pounce_palaver.in?h=2.4&id=7b15b724f982d7cc9f9bd05706f83fbf1892382a&follow=1'>contrib/palaver: Remove rc scriptJune McEnroe 2020-08-27contrib/palaver: Fix database search and creationJune McEnroe 2020-08-27contrib/palaver: Use pounce's XDG directoryJune McEnroe 2020-08-27contrib/palaver: Only allow HTTPSJune McEnroe 2020-08-25Support the pounce_env rc variableJune McEnroe 2020-08-25Remove deprecated option namesJune McEnroe 2020-08-25Document configuration and data file searchJune McEnroe 2020-08-24Use dataOpen for save fileJune McEnroe 2020-08-24Use configOpen to load localCAJune McEnroe 2020-08-24Use configPath to load client cert/privJune McEnroe 2020-08-24Use configOpen in getopt_configJune McEnroe 2020-08-24Import xdg.c from catgirlJune McEnroe 2020-08-23Replace “RAND_bytes” by “getentropy”Issam E. Maghni 2020-08-16contrib/palaver: Add no message preview flagsJune McEnroe 2020-08-13contrib/palaver: Don't set channel for PMsJune McEnroe 2020-08-13Fix unintended interception of NICK after registrationJune McEnroe 2020-08-12Add Additional Components section to READMEJune McEnroe 2020-08-12Document -L / palaver optionJune McEnroe 2020-08-11contrib/palaver: Document service configurationJune McEnroe 2020-08-11contrib/palaver: Add install target and rc scriptJune McEnroe 2020-08-11contrib/palaver: Implement command and notificationsJune McEnroe