Skip to content

Commit

Permalink
Fixed a bug in the log file format detection affecting custom logs.
Browse files Browse the repository at this point in the history
After the first commit in a log is read to check the file format the log
it is rewound to the beginning, however the last line read was still buffered
so it would return the buffered line next not the first line of the log. As
custom log entries are all on one line this would erroneously be parsed as the
first commit.
  • Loading branch information
acaudwell committed Sep 17, 2018
1 parent 9207043 commit 22b12ab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
0.50:
* Fixed a bug in the log file format detection that could result in the wrong
first entry being displayed for a custom log.

0.49:
* Fixed compatibility with GLM 0.9.9.0.

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -3,7 +3,7 @@

AC_PREREQ(2.61)

AC_INIT(Gource, 0.49, [acaudwell@gmail.com])
AC_INIT(Gource, 0.50, [acaudwell@gmail.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/main.h])
AM_INIT_AUTOMAKE([dist-bzip2 foreign subdir-objects])
Expand Down
5 changes: 3 additions & 2 deletions src/formats/commitlog.cpp
Expand Up @@ -130,6 +130,7 @@ bool RCommitLog::checkFormat() {
if(seekable) {
//if the log is seekable, go back to the start
((SeekLog*)logf)->seekTo(0.0);
lastline.clear();
} else {
//otherwise set the buffered flag as we have bufferd one commit
buffered = true;
Expand Down Expand Up @@ -171,7 +172,7 @@ bool RCommitLog::getCommitAt(float percent, RCommit& commit) {
bool RCommitLog::getNextLine(std::string& line) {
if(!lastline.empty()) {
line = lastline;
lastline = std::string("");
lastline.clear();
return true;
}

Expand All @@ -182,7 +183,7 @@ bool RCommitLog::getNextLine(std::string& line) {
void RCommitLog::seekTo(float percent) {
if(!seekable) return;

lastline = "";
lastline.clear();

((SeekLog*)logf)->seekTo(percent);
}
Expand Down
2 changes: 1 addition & 1 deletion src/gource_settings.h
Expand Up @@ -18,7 +18,7 @@
#ifndef GOURCE_SETTINGS_H
#define GOURCE_SETTINGS_H

#define GOURCE_VERSION "0.49"
#define GOURCE_VERSION "0.50"

#include "core/texture.h"
#include "core/settings.h"
Expand Down

0 comments on commit 22b12ab

Please sign in to comment.