projects
/
biaweb2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Included functionality to describe the document in the input file
[biaweb2.git]
/
biawebutil.hpp
diff --git
a/biawebutil.hpp
b/biawebutil.hpp
index
ee6cd5a
..
6a87827
100644
(file)
--- a/
biawebutil.hpp
+++ b/
biawebutil.hpp
@@
-23,16
+23,18
@@
namespace biaweb {
// till a cleaner solution can be found.
MMIOT *doc;
doc = mkd_string (str.c_str(), str.size(), 0);
// till a cleaner solution can be found.
MMIOT *doc;
doc = mkd_string (str.c_str(), str.size(), 0);
- FILE *f = fopen (".biaweb.tmp", "w");
+ char tempfile[20];
+ strcpy (tempfile, "/tmp/biawebXXXXXX");
+ mkstemp (tempfile);
+ FILE *f = fopen (tempfile, "w");
markdown (doc, f, 0);
fclose (f);
markdown (doc, f, 0);
fclose (f);
- std::ifstream ftmp (
".biaweb.tmp"
);
+ std::ifstream ftmp (
tempfile
);
std::string tmpl ( (std::istreambuf_iterator<char> (ftmp)),
(std::istreambuf_iterator<char> ())
);
ftmp.close ();
mkd_cleanup (doc);
std::string tmpl ( (std::istreambuf_iterator<char> (ftmp)),
(std::istreambuf_iterator<char> ())
);
ftmp.close ();
mkd_cleanup (doc);
- remove (".biaweb.tmp");
return tmpl;
}
return tmpl;
}