When an edge block begins a string of less than 2
characters (i.e. has no clue), the following clues are
missynced and execution normally aborts.
The following patch corrects this problem by detecting
the problem.
--- editted/src/Puzzle.cpp 2005-09-24
02:27:15.000000000 -0400
+++ xword-0.07/src/Puzzle.cpp 2002-01-23
14:43:03.000000000 -0500
@@ -24,7 +24,6 @@
#include <config.h>
-#include <iostream>
#include "Puzzle.h"
#include <fstream>
@@ -224,8 +223,7 @@
// across clues
//
// check to see if this is the far left border
- // and the length is at least two.
- if (j == 0 && s[1] == '-') {
+ if (j == 0) {
// m_mapCluesAcross[nClueNum] = *itrClueString;
m_mapCluesAcross[nClueNum] = clue;
++itrClueString;
@@ -233,7 +231,7 @@
square.SetAcrossNum(nClueNum);
bFoundClue = true;
}
- else if (s[j - 1] == '.' && s[j + 1] == '-') {
+ else if (s[j - 1] == '.') {
m_mapCluesAcross[nClueNum] = clue;
++itrClueString;
clue.SetText(*itrClueString);
@@ -244,23 +242,16 @@
// down clues
//
// check to see if this is the top border
- // and the length is at least 2
if (i == 0) {
- std::string strBelow = m_vecGrid[i + 1];
- if (strBelow[j] == '-') {
- m_mapCluesDown[nClueNum] = clue;
- ++itrClueString;
- clue.SetText(*itrClueString);
- square.SetDownNum(nClueNum);
- bFoundClue = true;
- }
- }
- else if (i >= m_nSizeY - 1) {
+ m_mapCluesDown[nClueNum] = clue;
+ ++itrClueString;
+ clue.SetText(*itrClueString);
+ square.SetDownNum(nClueNum);
+ bFoundClue = true;
}
else {
std::string strAbove = m_vecGrid[i - 1];
- std::string strBelow = m_vecGrid[i + 1];
- if (strAbove[j] == '.' && strBelow[j] == '-') {
+ if (strAbove[j] == '.') {
m_mapCluesDown[nClueNum] = clue;
++itrClueString;
clue.SetText(*itrClueString);