You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2015/08/06 21:23:55 UTC
lucy-clownfish git commit: Add "=encoding utf8" and autogen headers
to POD
Repository: lucy-clownfish
Updated Branches:
refs/heads/master 49be3026c -> b1a2632ac
Add "=encoding utf8" and autogen headers to POD
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/b1a2632a
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/b1a2632a
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/b1a2632a
Branch: refs/heads/master
Commit: b1a2632acef2e61049358d0d6a3d7ef3ec679050
Parents: 49be302
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Aug 6 21:22:26 2015 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Aug 6 21:22:26 2015 +0200
----------------------------------------------------------------------
compiler/src/CFCPerl.c | 19 ++++++++++++++++---
compiler/src/CFCPerlClass.c | 2 ++
2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b1a2632a/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerl.c b/compiler/src/CFCPerl.c
index 04ccacb..2766da8 100644
--- a/compiler/src/CFCPerl.c
+++ b/compiler/src/CFCPerl.c
@@ -242,9 +242,19 @@ S_write_standalone_pod(CFCPerl *self) {
for (size_t i = 0; i < num_pod_files; i++) {
CFCDocument *doc = docs[i];
- char *md = CFCDocument_get_contents(doc);
- char *pod = CFCPerlPod_md_to_pod(md, NULL, 1);
- FREEMEM(md);
+ char *md = CFCDocument_get_contents(doc);
+ char *raw_pod = CFCPerlPod_md_to_pod(md, NULL, 1);
+
+ const char *pattern =
+ "%s"
+ "\n"
+ "=encoding utf8\n"
+ "\n"
+ "%s"
+ "\n"
+ "%s";
+ char *pod = CFCUtil_sprintf(pattern, self->pod_header, raw_pod,
+ self->pod_footer);
const char *path_part = CFCDocument_get_path_part(doc);
char *pod_path = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s.pod",
@@ -252,6 +262,9 @@ S_write_standalone_pod(CFCPerl *self) {
pod_files[i].contents = pod;
pod_files[i].path = pod_path;
+
+ FREEMEM(raw_pod);
+ FREEMEM(md);
}
pod_files[num_pod_files].contents = NULL;
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b1a2632a/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerlClass.c b/compiler/src/CFCPerlClass.c
index 91c34a8..cb26d4d 100644
--- a/compiler/src/CFCPerlClass.c
+++ b/compiler/src/CFCPerlClass.c
@@ -406,6 +406,8 @@ CFCPerlClass_create_pod(CFCPerlClass *self) {
// Put it all together.
const char pattern[] =
+ "=encoding utf8\n"
+ "\n"
"=head1 NAME\n"
"\n"
"%s - %s"