Skip to content
This repository was archived by the owner on Jul 21, 2018. It is now read-only.

Commit b2d7b3c

Browse files
committed
final fix of magic header parsing
1 parent e1970ab commit b2d7b3c

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

ChangeLog

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
Ansifilter ChangeLog
22

3+
03.08.2017
4+
5+
ansifilter 2.7
6+
7+
-fixed processing of very small input files (https://github.com/andre-simon/ansifilter/issues/7)
8+
-added -fPIC to CXXFLAGS in src/makefile (https://github.com/andre-simon/ansifilter/issues/6)
9+
10+
---
311
25.07.2017
412

513
ansifilter 2.6
@@ -145,7 +153,7 @@ ansifilter 1.9
145153
ansifilter 1.8
146154

147155
-added support for Erase Line, Save and Restore Cursor sequences
148-
(thanks to Kovács Zoltán)
156+
(thanks to Kov�cs Zolt�n)
149157

150158
---
151159
04.01.2012

src/codegenerator.cpp

+10-7
Original file line numberDiff line numberDiff line change
@@ -966,9 +966,10 @@ void CodeGenerator::allocateTermBuffer(){
966966
bool CodeGenerator::streamIsXBIN() {
967967
bool isXBIN = false;
968968
char head[5] = {0};
969-
if (in!=&cin && in->read (head, 4) ) {
969+
if (in!=&cin && in->read (head, sizeof head -1) ) {
970970
isXBIN = string(head)=="XBIN";
971971
}
972+
in->clear();
972973
in->seekg (0, ios::beg);
973974
return isXBIN;
974975
}
@@ -978,9 +979,11 @@ bool CodeGenerator::streamIsTundra() {
978979
bool isTND = false;
979980
char head[10] = {0};
980981

981-
if (in!=&cin && in->read (head, 9) ) {
982+
if (in!=&cin && in->read (head, sizeof head -1) ) {
982983
isTND = string(head)=="\x18TUNDRA24";
983-
}
984+
}
985+
986+
in->clear();
984987
in->seekg (0, ios::beg);
985988
return isTND;
986989
}
@@ -1028,15 +1031,15 @@ void CodeGenerator::processInput()
10281031
}
10291032
}
10301033

1031-
/* if (streamIsXBIN()) {
1032-
*out<<"Please apply --art-bin option for XBIN files.";
1034+
if (streamIsXBIN()) {
1035+
*out<<"Please apply --art-bin option for XBIN files.\n";
10331036
return;
10341037
}
10351038

10361039
if (streamIsTundra()) {
1037-
*out<<"Please apply --art-tundra option for TND files.";
1040+
*out<<"Please apply --art-tundra option for TND files.\n";
10381041
return;
1039-
}*/
1042+
}
10401043

10411044
string line;
10421045
size_t i=0;

src/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ along with ANSIFilter. If not, see <http://www.gnu.org/licenses/>.
2525
#ifndef VERSION_H
2626
#define VERSION_H
2727

28-
#define ANSIFILTER_VERSION "2.6"
28+
#define ANSIFILTER_VERSION "2.7"
2929

3030
#define ANSIFILTER_URL "http://www.andre-simon.de/"
3131
#define ANSIFILTER_EMAIL "[email protected]"

0 commit comments

Comments
 (0)