From e10a07af0056a30a14bc789a73c9ef40d0962654 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sat, 9 Sep 2006 20:38:41 +0000 Subject: [PATCH] *add support for the new SVN 1.4.x binary format svn path=/trunk/; revision=24006 --- reactos/tools/buildno/buildno.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/reactos/tools/buildno/buildno.cpp b/reactos/tools/buildno/buildno.cpp index c859f2dd6cd..9a49bbf6303 100644 --- a/reactos/tools/buildno/buildno.cpp +++ b/reactos/tools/buildno/buildno.cpp @@ -3,6 +3,7 @@ * buildno - Generate the build number for ReactOS * * Copyright (c) 1999,2000 Emanuele Aliberti + * Copyright (c) 2006 Christoph von Wittich * * The build number is the day on which the build took * place, as YYYYMMDD @@ -16,6 +17,8 @@ * * REVISIONS * --------- + * 2006-09-09 (cwittich) + * read binary entries files from SVN 1.4.x * 2000-01-22 (ea) * Fixed bugs: tm_year is (current_year - 1900), * tm_month is 0-11 not 1-12 and code ignored TZ. @@ -176,6 +179,32 @@ GetRev(void) static char Unknown[] = "UNKNOWN"; static char Revision[10]; /* 999999999 revisions should be enough for everyone... */ + /* SVN 1.4.x */ + FILE *fp = NULL; + char ch; + size_t count = 0, chars = 0; + fp = fopen(".svn/entries", "r"); + if (fp != NULL) + { + if (fgetc(fp) == 56) /* some kind of header? */ + { + while((ch=fgetc(fp)) != EOF) + { + if (ch == 10) count++; /* seems to used as a seperator */ + if (count > 3) + break; + if ((count == 3) && (chars < sizeof(Revision))) + { + if (chars != 0) + Revision[chars - 1] = ch; + chars++; + } + } + fclose(fp); + return Revision; + } + } + try { XMLElement *head;