summaryrefslogtreecommitdiff
path: root/win/configure.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-13 14:34:12 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-13 14:34:12 +0000
commita6d662108a1fef29cca206f6887c52a9959a5a45 (patch)
tree809edae3411f3487dff21a16576f4dcdec5291e3 /win/configure.cpp
parent282236ab26b50ed0cea4795541825b9b41d2c442 (diff)
Whack gotos here too
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9480 e03df62e-2008-0410-955e-edbf42e46eb7
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: