From a6d662108a1fef29cca206f6887c52a9959a5a45 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 13 Apr 2008 14:34:12 +0000 Subject: Whack gotos here too git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9480 e03df62e-2008-0410-955e-edbf42e46eb7 --- win/configure.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'win') 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: -- cgit v1.2.3