aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-04-01 01:19:49 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-04-01 01:19:49 +0000
commit9f80862c6df819de7b89909e3a4dadd40a607054 (patch)
treee37f68b11034fab73db30e0e66ad0938ec6a0241
parentb872ee5453cf58546c473c0419787b566098a98e (diff)
downloadmailfromd-9f80862c6df819de7b89909e3a4dadd40a607054.tar.gz
mailfromd-9f80862c6df819de7b89909e3a4dadd40a607054.tar.bz2
Minor changes
git-svn-id: file:///svnroot/mailfromd/trunk@1335 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--NEWS2
-rw-r--r--src/drivers.c6
-rw-r--r--src/gram.y2
-rw-r--r--src/mailfromd.h3
-rw-r--r--src/prog.c15
5 files changed, 14 insertions, 14 deletions
diff --git a/NEWS b/NEWS
index 2d71ec38..c6205d06 100644
--- a/NEWS
+++ b/NEWS
@@ -81,7 +81,7 @@ regex settings. E.g.:
* Optional arguments in user-defined functions
-User-defined functions can take optional arguments. In declaration,
+User-defined functions can take optional arguments. In a declaration,
optional arguments are separated from the mandatory ones by a
semicolon. For example:
diff --git a/src/drivers.c b/src/drivers.c
index e3d22635..440626da 100644
--- a/src/drivers.c
+++ b/src/drivers.c
@@ -229,8 +229,6 @@ print_type_bin(NODE *node, int level)
|| node->v.bin.opcode == bin_fnmatch) {
if (node->v.bin.qualifier & QUALIFIER_MX)
printf(",MX");
- if (node->v.bin.qualifier & QUALIFIER_REGFREE)
- printf(",REGFREE");
}
printf("\n");
print_node(node->v.bin.arg[0], level+1);
@@ -614,9 +612,7 @@ optimize_type_bin(NODE *node)
node->type = node_type_number;
free_node(arg0);
free_node(arg1);
- } else
- node->v.bin.qualifier &=
- ~QUALIFIER_REGFREE;
+ }
} else if (arg1->type != node_type_regcomp) {
parse_error_locus(&arg1->locus,
"right-hand side argument "
diff --git a/src/gram.y b/src/gram.y
index b6fc4527..e677e9f3 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -1048,7 +1048,7 @@ expr : NOT expr
$$ = alloc_node(node_type_bin, &$2.locus);
$$->v.bin.opcode = bin_match;
- $$->v.bin.qualifier = $2.qualifier | QUALIFIER_REGFREE;
+ $$->v.bin.qualifier = $2.qualifier;
$$->v.bin.arg[0] = cast_to(dtype_string, $1);
$$->v.bin.arg[1] = p = alloc_node(node_type_regcomp, &$2.locus);
p->v.regcomp_data.expr = cast_to(dtype_string, $3);
diff --git a/src/mailfromd.h b/src/mailfromd.h
index a292a743..11af559f 100644
--- a/src/mailfromd.h
+++ b/src/mailfromd.h
@@ -329,7 +329,6 @@ enum bin_opcode {
};
#define QUALIFIER_MX 0x1
-#define QUALIFIER_REGFREE 0x2
struct bin_node { /* A binary operation */
enum bin_opcode opcode; /* Operation code */
@@ -338,7 +337,7 @@ struct bin_node { /* A binary operation */
arg[1] - right side argument */
};
-/* Unary operations - currently only one */
+/* Unary operations */
enum un_opcode {
unary_not,
unary_minus,
diff --git a/src/prog.c b/src/prog.c
index d29387c0..4d9a8c7e 100644
--- a/src/prog.c
+++ b/src/prog.c
@@ -1056,8 +1056,9 @@ instr_regmatch(eval_environ_t env)
char *string = get_string_arg(env, 1);
adjust_stack(env, 2);
- if (PROG_TRACE_ENGINE) /*FIXME: print string instead of %p */
- prog_trace(env, "REGMATCH %p %s", re, string);
+ if (PROG_TRACE_ENGINE)
+ prog_trace(env, "REGMATCH %s %s",
+ env_data_ref(env, regtab[index].expr), string);
env->matchcount = re->re_nsub;
if (env->matchsize < env->matchcount + 1) {
@@ -1082,6 +1083,7 @@ instr_regcomp(eval_environ_t env)
int v;
regex_t *re;
char buffer[REGEX_STRING_BUFSIZE];
+ size_t expr_off = (size_t)get_arg(env, 0);
char *expr = get_string_arg(env, 0);
size_t index = (size_t) get_immediate(env, 0);
struct rt_regex *rtx = &regtab[index];
@@ -1106,8 +1108,10 @@ instr_regcomp(eval_environ_t env)
"compiling regex `%s': %s",
expr,
errbuf);
- } else
+ } else {
rtx->compiled = 1;
+ rtx->expr = expr_off;
+ }
push(env, (STKVAL) index);
}
@@ -1195,8 +1199,9 @@ instr_regmatch_mx(eval_environ_t env)
char *string = get_string_arg(env, 1);
adjust_stack(env, 2);
- if (PROG_TRACE_ENGINE) /*FIXME: print string instead of %p */
- prog_trace(env, "REGMATCH,MX %p %s", re, string);
+ if (PROG_TRACE_ENGINE)
+ prog_trace(env, "REGMATCH,MX %s %s",
+ regtab[index].expr, string);
rc = mx_match(env, string, regex_matcher, re);

Return to:

Send suggestions and report system problems to the System administrator.