summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxazax-hun <xazax-hun@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-22 16:05:20 +0000
committerxazax-hun <xazax-hun@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-22 16:05:20 +0000
commit1bf0254f3bfc9a728814a32dc29759a784607520 (patch)
treec6d3f9d607867b846606eedcc07933790fbd48c4
parent7c6fa6ed09fc2031a9307ac70e8916c76e319781 (diff)
downloadhercules-1bf0254f3bfc9a728814a32dc29759a784607520.tar.gz
hercules-1bf0254f3bfc9a728814a32dc29759a784607520.tar.bz2
hercules-1bf0254f3bfc9a728814a32dc29759a784607520.tar.xz
hercules-1bf0254f3bfc9a728814a32dc29759a784607520.zip
Improved subversion 1.7 revision detecting. Followup r15211.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15212 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/common/core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/core.c b/src/common/core.c
index 99ac1c6bd..a6ddeb665 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -175,11 +175,12 @@ const char* get_svn_revision(void)
}
/**
* subversion 1.7 introduces the use of a .db file to store it, and we go through it
+ * TODO: In some cases it may be not accurate
**/
- if(!(*eA_svn_version) && ((fp = fopen(".svn/wc.db", "r")) != NULL || (fp = fopen("../.svn/wc.db", "r")) != NULL)) {
- char lines[512];
+ if(!(*eA_svn_version) && ((fp = fopen(".svn/wc.db", "rb")) != NULL || (fp = fopen("../.svn/wc.db", "rb")) != NULL)) {
+ char lines[64];
int revision,last_known = 0;
- while(fgets(lines, sizeof(lines), fp)) {
+ while(fread(lines, sizeof(char), sizeof(lines), fp)) {
if( strstr(lines,"!svn/ver/") ) {
if (sscanf(strstr(lines,"!svn/ver/"),"!svn/ver/%d/%*s", &revision) == 1) {
if( revision > last_known ) {