aboutsummaryrefslogtreecommitdiff
path: root/src/gram.y
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-05-16 15:32:45 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2013-05-16 15:32:45 +0000
commit979486e1b46a894fc9de2abe6eb8985536a5013c (patch)
treee9e61bcfd9d1945c612a54e080d4fdc2e87cbad5 /src/gram.y
parente5fccca3abee9093f4d1e50823addca8e6c778a6 (diff)
downloadgdbm-979486e1b46a894fc9de2abe6eb8985536a5013c.tar.gz
gdbm-979486e1b46a894fc9de2abe6eb8985536a5013c.tar.bz2
Improve handling of the variables.
* src/gdbmtool.c (opendb): Allow for unset variables. * src/gram.y: Improve error detection. * src/lex.l: Handle multiline strings. (pe_file_name): file_name can be NULL. * src/var.c (VARF_PROT): New flag. Protects the variable from being unset. (vartab): Use VARF_PROT if needed. (s2b): Fix return values. (variable_set, variable_unset): Return error if attempting to unset a variable marked with VARF_PROT. * doc/gdbm.info: Update. * doc/gdbmtool.1: Update.
Diffstat (limited to 'src/gram.y')
-rw-r--r--src/gram.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gram.y b/src/gram.y
index b939d8e..fde98a2 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -280,6 +280,9 @@ asgn : T_IDENT
case VAR_ERR_BADTYPE:
lerror (&@1, _("%s is not a boolean variable"), varname);
break;
+
+ default:
+ lerror (&@1, _("unexpected error setting %s: %d"), $1, rc);
}
free($1);
}
@@ -302,8 +305,11 @@ asgn : T_IDENT
case VAR_ERR_BADVALUE:
lerror (&@1, _("%s: value %s is not allowed"), $1, $3);
break;
+
+ default:
+ lerror (&@1, _("unexpected error setting %s: %d"), $1, rc);
}
- free($1);
+ free ($1);
free ($3);
}
;

Return to:

Send suggestions and report system problems to the System administrator.