projects
/
biaweb2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Separated the strings used for document tree generation from code
[biaweb2.git]
/
biawebutil.hpp
diff --git
a/biawebutil.hpp
b/biawebutil.hpp
index
6a87827
..
c8603ea
100644
(file)
--- a/
biawebutil.hpp
+++ b/
biawebutil.hpp
@@
-25,8
+25,8
@@
namespace biaweb {
doc = mkd_string (str.c_str(), str.size(), 0);
char tempfile[20];
strcpy (tempfile, "/tmp/biawebXXXXXX");
doc = mkd_string (str.c_str(), str.size(), 0);
char tempfile[20];
strcpy (tempfile, "/tmp/biawebXXXXXX");
- mkstemp (tempfile);
- FILE *f = f
open (tempfile
, "w");
+
int fd =
mkstemp (tempfile);
+ FILE *f = f
dopen (fd
, "w");
markdown (doc, f, 0);
fclose (f);
std::ifstream ftmp (tempfile);
markdown (doc, f, 0);
fclose (f);
std::ifstream ftmp (tempfile);
@@
-35,6
+35,7
@@
namespace biaweb {
);
ftmp.close ();
mkd_cleanup (doc);
);
ftmp.close ();
mkd_cleanup (doc);
+ remove (tempfile);
return tmpl;
}
return tmpl;
}