aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-01-12 15:04:09 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-01-12 15:04:09 +0000
commitf3fe35899c9749e4eb8000ccebb8e1348def28d6 (patch)
tree69c72f6bf4b73035ac528e15e625d466059c3d95
parent9262f78cb77ed82db9b96c577a6701100f3a4919 (diff)
downloadmailfromd-f3fe35899c9749e4eb8000ccebb8e1348def28d6.tar.gz
mailfromd-f3fe35899c9749e4eb8000ccebb8e1348def28d6.tar.bz2
Fix header deletion.
* src/gram.y (DELETE string): Initialize hdr.value. * src/drivers.c (code_type_header): Value can be NULL. git-svn-id: file:///svnroot/mailfromd/branches/gmach@1556 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--ChangeLog3
-rw-r--r--src/drivers.c9
-rw-r--r--src/gram.y1
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8433c282..1af4fd53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2008-01-12 Sergey Poznyakoff <gray@gnu.org.ua>
+ * src/gram.y (DELETE string): Initialize hdr.value.
+ * src/drivers.c (code_type_header): Value can be NULL.
+
* pmult/pmult.c: Implement most of the SMTP functionality.
* src/mailfromd.h, lib/libmf.h (dict_init, dict_install)
diff --git a/src/drivers.c b/src/drivers.c
index 278dbb60..56290b80 100644
--- a/src/drivers.c
+++ b/src/drivers.c
@@ -1,5 +1,5 @@
/* This file is part of mailfromd.
- Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff
+ Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -977,7 +977,12 @@ void
code_type_header(NODE *node, struct locus **old_locus)
{
MARK_LOCUS();
- code_node(node->v.hdr.value);
+ if (node->v.hdr.value)
+ code_node(node->v.hdr.value);
+ else {
+ code_op(opcode_push);
+ code_immediate(0);
+ }
code_op(opcode_header);
code_immediate((void*)node->v.hdr.opcode);
code_immediate((void*)node->v.hdr.name->off);
diff --git a/src/gram.y b/src/gram.y
index 965b7224..a3bbac19 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -860,6 +860,7 @@ header_action:
$$ = alloc_node(node_type_header, &$1);
$$->v.hdr.opcode = header_delete;
$$->v.hdr.name = $2;
+ $$->v.hdr.value = NULL;
}
;

Return to:

Send suggestions and report system problems to the System administrator.