diff --git a/ChangeLog b/ChangeLog index 522fa5cd7..8a5924b8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-08-19 Don Allingham + * src/GrampsDbUtils/_WriteGedcom.py (breakup): fix index check + 2007-08-19 Robert Cawley * src/plugins/DetDescendantReport.py: * src/plugins/DetAncestralReport.py: diff --git a/src/GrampsDbUtils/_WriteGedcom.py b/src/GrampsDbUtils/_WriteGedcom.py index d5dc3085c..5e5f3f7a3 100644 --- a/src/GrampsDbUtils/_WriteGedcom.py +++ b/src/GrampsDbUtils/_WriteGedcom.py @@ -233,12 +233,13 @@ def breakup(txt, limit): to avoid issues with spaces. """ data = [] + original = txt while limit < len(txt)+1: idx = limit-1 - while txt[idx] in string.whitespace or txt[idx+1] in string.whitespace : + while txt[idx-1] in string.whitespace or txt[idx] in string.whitespace : idx -= 1 - data.append(txt[:idx+1]) - txt = txt[idx+1:] + data.append(txt[:idx]) + txt = txt[idx:] if len(txt) > 0: data.append(txt) return data