summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-07-21 00:40:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-07-21 00:40:01 +0000
commit145eddd8a91777721d90fbc33111d6f6d55dcf54 (patch)
treed4bc5cb59af0f34d970ead8fa1cd74d2f494ce71
parenta7d779786d27f1a5b1f8f74d1b6b0bd24a1b8bc8 (diff)
string concat, ie.
a=a b c=$a $a
-rw-r--r--sbin/pfctl/parse.y17
1 files changed, 14 insertions, 3 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 96508d85aeb..46feeb37c73 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.129 2002/07/20 23:43:52 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.130 2002/07/21 00:40:00 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -239,7 +239,7 @@ typedef struct {
%type <v.gid> gids gid_list gid_item
%type <v.route> route
%type <v.redirection> redirection
-%type <v.string> label
+%type <v.string> label string
%type <v.keep_state> keep
%type <v.state_opt> state_opt_spec state_opt_list state_opt_item
%type <v.timeout_spec> timeout_spec timeout_list
@@ -284,7 +284,18 @@ option : SET OPTIMIZATION STRING {
}
;
-varset : STRING PORTUNARY STRING {
+string : string STRING {
+ if (asprintf(&$$, "%s %s", $1, $2) == -1) {
+ yyerror("malloc failed");
+ YYERROR;
+ }
+ free($1);
+ free($2);
+ }
+ | STRING
+ ;
+
+varset : STRING PORTUNARY string {
if (pf->opts & PF_OPT_VERBOSE)
printf("%s = %s\n", $1, $3);
if (symset($1, $3) == -1) {