summaryrefslogtreecommitdiff
path: root/win/configure.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'win/configure.cpp')
-rw-r--r--win/configure.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/win/configure.cpp b/win/configure.cpp
index 1df1eba67..290b8e7a1 100644
--- a/win/configure.cpp
+++ b/win/configure.cpp
@@ -125,17 +125,20 @@ int get_svn_revision(char * buffer, size_t len)
7033
*/
char buf[1000];
+ int rev = 0;
+
FILE * f = fopen("..\\.svn\\entries", "r");
- if(!f) goto bad_rev;
+ if (f)
+ {
+ fgets(buf, 1000, f);
+ fgets(buf, 1000, f);
+ fgets(buf, 1000, f);
+ fgets(buf, 1000, f);
+ rev = atoi(buf);
+ sprintf(buffer, "%u", rev);
+ fclose(f);
+ }
- if(!fgets(buf, 1000, f)) goto bad_rev;
- if(!fgets(buf, 1000, f)) goto bad_rev;
- if(!fgets(buf, 1000, f)) goto bad_rev;
- if(!fgets(buf, 1000, f)) goto bad_rev;
- int rev = atoi(buf);
- if(rev == 0) goto bad_rev;
- sprintf(buffer, "%u", rev);
- fclose(f);
return rev;
bad_rev: