From 1bf0254f3bfc9a728814a32dc29759a784607520 Mon Sep 17 00:00:00 2001 From: xazax-hun Date: Thu, 22 Dec 2011 16:05:20 +0000 Subject: 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 --- src/common/core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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 ) { -- cgit v1.2.3-70-g09d2