aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-20 18:58:10 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-20 18:58:10 +0000
commit39cff2441c45040c9260a6f5eba5b8debd66604e (patch)
tree4e2fcd53b5fd1fdaad107192480b14c6d89e2e36 /src
parentec49bde7e1919e5a460c05903b6ccafc00be0455 (diff)
downloadusdx-39cff2441c45040c9260a6f5eba5b8debd66604e.tar.gz
usdx-39cff2441c45040c9260a6f5eba5b8debd66604e.tar.xz
usdx-39cff2441c45040c9260a6f5eba5b8debd66604e.zip
do not handle txt file format errors that strict
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2253 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r--src/base/USong.pas19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/base/USong.pas b/src/base/USong.pas
index 597bcb46..a441fe40 100644
--- a/src/base/USong.pas
+++ b/src/base/USong.pas
@@ -377,19 +377,20 @@ var
begin
OldLinePos := LinePos;
Str := ParseLyricStringParam(Line, LinePos);
- if (Length(Str) <> 1) then
+
+ if (Length(Str) < 1) then
begin
- { to-do : decide what to do here
- usdx < 1.1 does not nead a whitespace after a char param
- so we may just write a warning to error.log and use the
- first non whitespace character instead of raising an
- exception that causes the song not to load. So the more
- error resistant code is:
- LinePos := OldLinePos + 1;
- // raise EUSDXParseException.Create('Character expected'); }
LinePos := OldLinePos;
raise EUSDXParseException.Create('Character expected');
+ end
+ else if (Length(Str) > 1) then
+ begin
+ Log.LogWarn(Format('"%s" in line %d: %s',
+ [FileName.ToNative, FileLineNo, 'character expected but found "' + Str + '"']),
+ 'TSong.ParseLyricCharParam');
end;
+
+ LinePos := OldLinePos + 1;
Result := Str[1];
end;