aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/triplet.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/triplet.c b/src/triplet.c
index 048cdcb..1b0fb18 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -496,13 +496,22 @@ expand_user_email (struct metadef *def, void *data)
static const char *
expand_report (struct metadef *def, void *data)
{
return report_string;
}
-
+
+static const char *
+expand_comment (struct metadef *def, void *data)
+{
+ struct file_triplet *trp = data;
+ if (directive_get_value (trp, "comment", (const char**) &def->value))
+ def->value = "";
+ return def->value;
+}
+
#define DECL_EXPAND_TIMER(what) \
static const char * \
__cat2__(expand_timer_,what) (struct metadef *def, void *data) \
{ \
wydawca_timer_t t = timer_stop ((char*)def->data); \
def->storage = timer_format_time (__cat2__(timer_get_,what) (t)); \
@@ -528,12 +537,13 @@ struct metadef triplet_default_meta[] = {
{ "project", NULL, expand_project_base, NULL },
{ "url", NULL, expand_url, NULL },
{ "spool", NULL, expand_tag, NULL },
{ "dir", NULL, expand_relative_dir, NULL },
{ "dest-dir", NULL, expand_dest_dir, NULL },
{ "source-dir", NULL, expand_source_dir, NULL },
+ { "comment", NULL, expand_comment, NULL },
{ NULL }
};
char *
triplet_expand_method_query (struct access_method *method, void *handle,
struct file_triplet *trp)
@@ -558,12 +568,13 @@ struct metadef triplet_meta[] = {
{ "triplet:dir", NULL, expand_triplet_directive, NULL },
{ "user", NULL, expand_user_name, NULL },
{ "user:name", NULL, expand_user_name, NULL },
{ "user:real-name", NULL, expand_user_real_name, NULL },
{ "user:email", NULL, expand_user_email, NULL },
{ "report", NULL, expand_report, NULL },
+ { "comment", NULL, expand_comment, NULL },
DECL_FULL_TIMER(wydawca),
DECL_FULL_TIMER(triplet),
DECL_FULL_TIMER(spool),
{ NULL }
};

Return to:

Send suggestions and report system problems to the System administrator.