User forums > Nightly builds
The 27 October 2014 build (10016) is out.
Alpha:
Does this work better?
--- Code: ---diff --git a/src/build_tools/autorevision/autorevision.cpp b/src/build_tools/autorevision/autorevision.cpp
index b0220b6..514ebd7 100644
--- a/src/build_tools/autorevision/autorevision.cpp
+++ b/src/build_tools/autorevision/autorevision.cpp
@@ -227,17 +227,17 @@ bool QuerySvn(const string& workingDir, string& revision, string &date)
bool WriteOutput(const string& outputFile, string& revision, string& date)
{
- string old;
- string comment("/*");
- comment.append(revision);
- comment.append("*/");
-
{
ifstream in(outputFile.c_str());
if (!in.bad() && !in.eof())
{
+ string old;
in >> old;
- if(old == comment)
+ int oldRev = 0;
+ size_t pos = old.find('*');
+ if (pos != string::npos)
+ oldRev = atoi(old.c_str() + pos + 1);
+ if(oldRev >= atoi(revision.c_str()))
{
if(be_verbose)
printf("Revision unchanged (%s). Skipping.", revision.c_str());
@@ -256,7 +256,7 @@ bool WriteOutput(const string& outputFile, string& revision, string& date)
return false;
}
- fprintf(header, "%s\n", comment.c_str());
+ fprintf(header, "/*%s*/\n", revision.c_str());
fprintf(header, "//don't include this header, only configmanager-revision.cpp should do this.\n");
fprintf(header, "#ifndef AUTOREVISION_H\n");
fprintf(header, "#define AUTOREVISION_H\n\n\n");
--- End code ---
Jenna:
Same effect with less conversion, even if it should not matter much as it happens only one time:
--- Code: ---commit e2e7ed0e50fc1843cb0ae77cafd82f07305695cb
Author: Jens Lody <jens@codeblocks.org>
Date: Thu Nov 6 22:26:28 2014 +0100
* fix for commit 10011, which could lead to revision string "0"
Index: src/build_tools/autorevision/autorevision.cpp
===================================================================
--- src/build_tools/autorevision/autorevision.cpp
+++ src/build_tools/autorevision/autorevision.cpp
@@ -237,10 +237,12 @@
if (!in.bad() && !in.eof())
{
in >> old;
- if(old == comment)
+ size_t l_old = old.length();
+ size_t l_comment = comment.length();
+ if(l_old > l_comment || ((l_old == l_comment) && old >= comment))
{
if(be_verbose)
- printf("Revision unchanged (%s). Skipping.", revision.c_str());
+ printf("Revision unchanged or older (%s). Skipping.", revision.c_str());
in.close();
return false;
}
--- End code ---
oBFusCATed:
@gd_on: the two patches are in svn now...
ollydbg:
--- Quote from: oBFusCATed on November 03, 2014, 05:37:29 pm ---@ollydbg: I've done some bisecting and r9931 seems to be the last working revision. r9932 is broken.
--- End quote ---
I still can't reproduce the issue in my system. :'(
As a workaround, you can just try to comment out the line "HandleMacroExpansion(id, peek);", thus disable the macro expansion for the first meet token, and see whether the issue happens again.
I have a local patch which only handles macro expansion in the Tokenizer level(low level), but not in the ParserThread level(high level), but that involves too many code changes......
gd_on:
@oBFusCATed : Thanks
@jens and Alpha : I tried your two patches. Both give me the "good" result on the isolated machine : svn number not modified in my autorevision.h file and this is what I expected.
So, it's up to you to choose which one is better than the other. May be jens's one is a little bit shorter... and less conversion.
gd_on
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version