aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-08-10 10:02:58 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-08-10 10:02:58 +0000
commitf1e49e11293fd417f83b36901bc319e0d7bd390d (patch)
tree74165d3e0ccbe55343eed00d11ba7b726a653424 /src
parent52140b22af73ac5ae4c6bbbb40217a609614e03f (diff)
downloadmailfromd-f1e49e11293fd417f83b36901bc319e0d7bd390d.tar.gz
mailfromd-f1e49e11293fd417f83b36901bc319e0d7bd390d.tar.bz2
* src/gram.y (on_cond): Fix coredump if target address is not
specified. (vardecl): Signal error if an auto variable is doubly defined. * tests/testsuite.at (EX_OK--EX_CONFIG): New defines (MF_CHECK_TEXT): New macro Add poll04.at and ashadow.at * tests/ashadow.at, tests/poll04.at: New files * doc/mailfromd.texi: Minor fixes git-svn-id: file:///svnroot/mailfromd/trunk@1499 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src')
-rw-r--r--src/gram.y18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gram.y b/src/gram.y
index 35ba5574..cbb763a5 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -1771,6 +1771,10 @@ on_cond : on pollstmt do branches DONE
if ($2.client_addr) {
head = tail = $2.client_addr;
tail = $2.email;
+ if (!tail) {
+ parse_error(_("recipient address not specified in `on poll' construct"));
+ YYERROR;
+ }
tail->next = NULL;
head->next = tail;
} else
@@ -3479,6 +3483,17 @@ vardecl(const char *name, data_type_t type, storage_class_t sc,
} else {
switch (sc) {
case storage_extern:
+ if (var->type != type) {
+ parse_error(_("Redeclaring `%s' as different "
+ "data type"),
+ name);
+ parse_error_locus(&var->locus,
+ _("This is the location of the "
+ "previous definition"));
+ return NULL;
+ }
+ break;
+
case storage_auto:
if (var->type != type) {
parse_error(_("Redeclaring `%s' as different "
@@ -3488,6 +3503,9 @@ vardecl(const char *name, data_type_t type, storage_class_t sc,
_("This is the location of the "
"previous definition"));
return NULL;
+ } else {
+ parse_error(_("Duplicate variable: %s"), name);
+ return NULL;
}
break;

Return to:

Send suggestions and report system problems to the System administrator.