aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@src.gnome.org>2000-06-03 04:47:56 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-03 04:47:56 +0800
commit87b3974c99c4c98c3a545f15ce579b8ae438228c (patch)
tree09c37eac7a68a0847cc09578ceb718412e4af42f /camel
parentd507f4b5015f3889b5f1e9f1f1e8441fdbe196b8 (diff)
downloadgsoc2013-evolution-87b3974c99c4c98c3a545f15ce579b8ae438228c.tar
gsoc2013-evolution-87b3974c99c4c98c3a545f15ce579b8ae438228c.tar.gz
gsoc2013-evolution-87b3974c99c4c98c3a545f15ce579b8ae438228c.tar.bz2
gsoc2013-evolution-87b3974c99c4c98c3a545f15ce579b8ae438228c.tar.lz
gsoc2013-evolution-87b3974c99c4c98c3a545f15ce579b8ae438228c.tar.xz
gsoc2013-evolution-87b3974c99c4c98c3a545f15ce579b8ae438228c.tar.zst
gsoc2013-evolution-87b3974c99c4c98c3a545f15ce579b8ae438228c.zip
Jeffrey Stedfast <fejj@helixcode.com>
* camel-mime-filter-smtp.c (filter): Fixed the filter so that it wouldn't insert garbage under certain conditions. svn path=/trunk/; revision=3405
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-mime-filter-smtp.c20
2 files changed, 15 insertions, 10 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index c2961e5853..a3b614049f 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-02 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * camel-mime-filter-smtp.c (filter): Fixed the filter so that it wouldn't
+ insert garbage under certain conditions.
+
2000-06-02 Christopher James Lahey <clahey@helixcode.com>
* camel-session.c: Don't ref the services in the cache.
diff --git a/camel/camel-mime-filter-smtp.c b/camel/camel-mime-filter-smtp.c
index fca4b1684d..2b769fde72 100644
--- a/camel/camel-mime-filter-smtp.c
+++ b/camel/camel-mime-filter-smtp.c
@@ -108,9 +108,9 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
if (c == '\n' || !midline) {
/* if there isn't already a carriage-return before the line-feed, count it */
- if (*(inptr-1) == '\n' && *(inptr-2) != '\r') {
+ if (c == '\n') {
linecount++;
- node = alloca(sizeof(*node));
+ node = alloca (sizeof (*node));
node->type = EOLN_NODE;
node->pointer = inptr - 1;
node->next = NULL;
@@ -121,7 +121,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
left = inend - inptr;
if (left < 2) {
if (*inptr == '.') {
- camel_mime_filter_backup(mf, inptr, left);
+ camel_mime_filter_backup (mf, inptr, left);
midline = FALSE;
inend = inptr;
break;
@@ -131,7 +131,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
if (left > 0 && *inptr == '.' && *(inptr+1) != '.') {
midline = TRUE;
dotcount++;
- node = alloca(sizeof(*node));
+ node = alloca (sizeof (*node));
node->type = DOT_NODE;
node->pointer = inptr;
node->next = NULL;
@@ -151,18 +151,18 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
f->midline = midline;
if (dotcount > 0 || linecount > 0) {
- camel_mime_filter_set_size(mf, len + dotcount + linecount, FALSE);
+ camel_mime_filter_set_size (mf, len + dotcount + linecount, FALSE);
node = head;
inptr = in;
outptr = mf->outbuf;
while (node) {
if (node->type == EOLN_NODE) {
- memcpy(outptr, inptr, node->pointer - inptr);
+ memcpy (outptr, inptr, node->pointer - inptr);
outptr += node->pointer - inptr;
*outptr++ = '\r';
} else {
if (node->type == DOT_NODE) {
- memcpy(outptr, inptr, node->pointer - inptr);
+ memcpy (outptr, inptr, node->pointer - inptr);
outptr += node->pointer - inptr;
*outptr++ = '.';
}
@@ -170,19 +170,19 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
inptr = node->pointer;
node = node->next;
}
- memcpy(outptr, inptr, inend - inptr);
+ memcpy (outptr, inptr, inend - inptr);
outptr += inend - inptr;
*out = mf->outbuf;
*outlen = outptr - mf->outbuf;
*outprespace = mf->outbuf - mf->outreal;
- d(printf("Filtered '%.*s'\n", *outlen, *out));
+ d(printf ("Filtered '%.*s'\n", *outlen, *out));
} else {
*out = in;
*outlen = inend - in;
*outprespace = prespace;
- d(printf("Filtered '%.*s'\n", *outlen, *out));
+ d(printf ("Filtered '%.*s'\n", *outlen, *out));
}
}