highlight/highlight-2.4-fixcodegen.patch

17 lines
620 B
Diff
Raw Normal View History

2006-03-15 16:28:28 +00:00
diff -ur highlight-2.4.4.old/highlight/codegenerator.cpp highlight-2.4.4/highlight/codegenerator.cpp
--- highlight-2.4.4.old/highlight/codegenerator.cpp 2006-02-19 09:11:18.000000000 -0800
+++ highlight-2.4.4/highlight/codegenerator.cpp 2006-02-19 09:11:18.000000000 -0800
@@ -284,7 +284,11 @@
bool CodeGenerator::readNewLine(string &newLine){
bool eof;
- terminatingChar=newLine[lineIndex-1];
+ if (lineIndex > 0) {
+ terminatingChar=newLine[lineIndex-1];
+ } else {
+ terminatingChar = '\0';
+ }
if (formattingPossible && formattingEnabled) {
eof=!formatter->hasMoreLines();
if (!eof) {