aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-filter-from.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@src.gnome.org>2000-05-23 02:14:39 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-05-23 02:14:39 +0800
commitd88be436d908708bb62a95ee06fbf8a104c36e1d (patch)
tree83b03c790f595d4ebc4265cf3fceec2d8ee97648 /camel/camel-mime-filter-from.c
parent36c4f96edf9defe046fb21d1afc8b5997f49c7d8 (diff)
downloadgsoc2013-evolution-d88be436d908708bb62a95ee06fbf8a104c36e1d.tar.gz
gsoc2013-evolution-d88be436d908708bb62a95ee06fbf8a104c36e1d.tar.zst
gsoc2013-evolution-d88be436d908708bb62a95ee06fbf8a104c36e1d.zip
added camel-mime-filter-smtp.[c,h] and made mods to camel-mime-filter-from.c
svn path=/trunk/; revision=3163
Diffstat (limited to 'camel/camel-mime-filter-from.c')
-rw-r--r--camel/camel-mime-filter-from.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/camel/camel-mime-filter-from.c b/camel/camel-mime-filter-from.c
index 065b15e656..271a97505f 100644
--- a/camel/camel-mime-filter-from.c
+++ b/camel/camel-mime-filter-from.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2000 Helix Code Inc.
*
@@ -85,7 +86,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
int left;
int midline = f->midline;
int fromcount = 0;
- struct fromnode *head= NULL, *tail = (struct fromnode *)&head, *node;
+ struct fromnode *head = NULL, *tail = (struct fromnode *)&head, *node;
char *outptr;
inptr = in;
@@ -95,25 +96,25 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
/* first, see if we need to escape any from's */
while (inptr<inend) {
- register int c=-1;
+ register int c = -1;
if (midline)
- while (inptr<inend && (c=*inptr++) != '\n')
+ while (inptr < inend && (c = *inptr++) != '\n')
;
- if (c=='\n' || !midline) {
+ if (c == '\n' || !midline) {
left = inend-inptr;
if (left > 0) {
midline = TRUE;
- if (left<5) {
- if (inptr[0]=='F') {
+ if (left < 5) {
+ if (inptr[0] == 'F' || inptr[0] == 'f') {
camel_mime_filter_backup(mf, inptr, left);
midline = FALSE;
inend = inptr;
break;
}
} else {
- if (!strncmp(inptr, "From ", 5)) {
+ if (!g_strncasecmp(inptr, "From ", 5)) {
fromcount++;
/* yes, we do alloc them on the stack ... at most we're going to get
len / 7 of them anyway */
@@ -122,7 +123,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
node->next = NULL;
tail->next = node;
tail = node;
- inptr+=5;
+ inptr += 5;
}
}
} else {
@@ -140,17 +141,17 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
inptr = in;
outptr = mf->outbuf;
while (node) {
- memcpy(outptr, inptr, node->pointer-inptr);
- outptr+=node->pointer-inptr;
- *outptr++='>';
+ memcpy(outptr, inptr, node->pointer - inptr);
+ outptr += node->pointer - inptr;
+ *outptr++ = '>';
inptr = node->pointer;
node = node->next;
}
- memcpy(outptr, inptr, inend-inptr);
- outptr += inend-inptr;
+ memcpy(outptr, inptr, inend - inptr);
+ outptr += inend - inptr;
*out = mf->outbuf;
- *outlen = outptr-mf->outbuf;
- *outprespace = mf->outbuf-mf->outreal;
+ *outlen = outptr - mf->outbuf;
+ *outprespace = mf->outbuf - mf->outreal;
d(printf("Filtered '%.*s'\n", *outlen, *out));
} else {
@@ -231,7 +232,7 @@ int main(int argc, char **argv)
printf("output = '%.*s'\n", len, buffer);
buffer = "";
len = 0;
- prespace =0;
+ prespace = 0;
camel_mime_filter_complete(f, buffer, len, prespace, &buffer, &len, &prespace);
printf("complete = '%.*s'\n", len, buffer);