aboutsummaryrefslogtreecommitdiff
path: root/src/meta.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-28 18:54:48 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-28 18:54:48 +0200
commit5fc738e4d43eb708428c4b30e60e570e2dd55470 (patch)
treea96f33c70162ff8a825b800fc9276360d95d154a /src/meta.c
parent514797c56e431f37de9a00834281f990a7b15c46 (diff)
downloadwydawca-5fc738e4d43eb708428c4b30e60e570e2dd55470.tar.gz
wydawca-5fc738e4d43eb708428c4b30e60e570e2dd55470.tar.bz2
Various fixes
* doc/Makefile.am: Improve checking and final rules. * doc/fdl.texi, doc/rendition.texi: Use single-space sentence separators. * doc/wydawca.texi: Update. * src/config.c (cb_email_address): Accept a list of addresses. * src/meta.c (meta_expand_string): Take two additional arguments. Quote expansions if they are provided. * src/triplet.c (triplet_expand_method_query): New function. * src/mail.c, src/verify.c: Use triplet_expand_method_query * src/wydawca.h: Update. * src/meta.c (meta_escape): Remove.
Diffstat (limited to 'src/meta.c')
-rw-r--r--src/meta.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/src/meta.c b/src/meta.c
index e60651a..eb332f5 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -50,11 +50,12 @@ find_expansion_word (const char *kw, size_t len,
}
char *
-meta_expand_string (const char *string, struct metadef *def, void *data)
+meta_expand_string (const char *string, struct metadef *def, void *data,
+ struct access_method *method, void *handle)
{
const char *p, *s;
char *res;
- struct obstack stk;
+ struct obstack stk;
if (!string)
return NULL;
@@ -81,7 +82,17 @@ meta_expand_string (const char *string, struct metadef *def, void *data)
e = strchr (p + 1, '}');
if (e && (s = find_expansion_word (p + 1, e - p - 1, def, data)))
{
- obstack_grow (&stk, s, strlen (s));
+ if (method)
+ {
+ char *newval;
+ size_t len;
+ /* FIXME: Return value? */
+ method_quote_string (method, handle, s, &newval, &len);
+ obstack_grow (&stk, newval, len);
+ free (newval);
+ }
+ else
+ obstack_grow (&stk, s, strlen (s));
p = e + 1;
}
else
@@ -99,7 +110,18 @@ meta_expand_string (const char *string, struct metadef *def, void *data)
s = p - 1;
len = 1;
}
- obstack_grow (&stk, s, len);
+
+ if (method)
+ {
+ char *newval;
+ size_t len;
+ /* FIXME: Return value? */
+ method_quote_string (method, handle, s, &newval, &len);
+ obstack_grow (&stk, newval, len);
+ free (newval);
+ }
+ else
+ obstack_grow (&stk, s, len);
p++;
}
}
@@ -113,24 +135,6 @@ meta_expand_string (const char *string, struct metadef *def, void *data)
}
void
-meta_escape (struct access_method *method, void *handle, struct metadef *def)
-{
- for (; def->kw; def++)
- {
- if (def->value)
- {
- char *newval;
-
- /* FIXME: Return value? */
- method_quote_string (method, handle, def->value, &newval, NULL);
- if (def->storage)
- free (def->storage);
- def->value = def->storage = newval;
- }
- }
-}
-
-void
meta_free (struct metadef *def)
{
for (; def->kw; def++)

Return to:

Send suggestions and report system problems to the System administrator.