summaryrefslogtreecommitdiff
path: root/include/version.cpp
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2010-12-19 08:56:31 +0100
committerDukePyrolator <DukePyrolator@anope.org>2010-12-19 08:56:31 +0100
commit184e14ea83412489921367614d63a7c24df3827d (patch)
tree152c0318684ec36375b55e3553b1f70e8734843e /include/version.cpp
parent02476332ea2f5ab3fd766e0ca9d83d67a9a9f122 (diff)
parent21125cf2cb0dc5f80f9f796fe4c222c36ba2fcc4 (diff)
Merge branch '1.9' of ssh://anope.git.sourceforge.net/gitroot/anope/anope into 1.9
Diffstat (limited to 'include/version.cpp')
-rw-r--r--include/version.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/version.cpp b/include/version.cpp
index ae3ee883e..9b8f38c45 100644
--- a/include/version.cpp
+++ b/include/version.cpp
@@ -54,12 +54,19 @@ int main(int argc, char *argv[])
std::string version_build = "#define VERSION_BUILD 1";
std::string build = "#define BUILD 1";
+ std::string version_extra;
if (fd.is_open())
{
while (getline(fd, filebuf))
{
if (!filebuf.find("#define VERSION_BUILD"))
version_build = filebuf;
+ else if (!filebuf.find("#define VERSION_EXTRA"))
+ {
+ size_t q = filebuf.find('"');
+
+ version_extra = filebuf.substr(q + 1, filebuf.length() - q - 2);
+ }
else if (!filebuf.find("#define BUILD"))
{
size_t tab = filebuf.find(' ');
@@ -89,7 +96,7 @@ int main(int argc, char *argv[])
for (std::list<std::pair<std::string, std::string> >::iterator it = versions.begin(), it_end = versions.end(); it != it_end; ++it)
{
if (it->first == "EXTRA")
- fd << "#define VERSION_EXTRA \"" << it->second << "\"" << std::endl;
+ fd << "#define VERSION_EXTRA \"" << (!version_extra.empty() ? version_extra : "") << it->second << "\"" << std::endl;
else
fd << "#define VERSION_" << it->first << " " << it->second << std::endl;
}