Commit cc0129c2 authored by Matthew Trey's avatar Matthew Trey

Revised comment search code

git-svn-id: svn://svn.debian.org/svn/tux4kids/tuxtype/trunk@1506 47d30e19-490b-0410-9d18-e851f4e465b3
parent 6abf4430
......@@ -18,6 +18,7 @@ Sreerenj Balachandran <bsreerenj@gmail.com>
Vimal Ravi <vimal_ravi@rediff.com>
Prince K. Antony <prince.kantony@gmail.com>
Mobin Mohan <mobinmohan@gmail.com>
Matthew Trey <tux4kids@treyhome.com>
Packaging & Ports:
------------------
......
10 Sep 2009 (svn.debian.org/tux4kids - revision 1504)
[ Matthew Trey <tux4kids@treyhome.com> ]
- Scripting - added code so the script parser recognizes comments in
xml.
31 Aug 2009 (svn.debian.org/tux4kids - revision 1470)
[ Matthew Trey <tux4kids@treyhome.com> ]
- Practice - fixed a problem that was causing the wrong key to flash
in the bottom row of keys
- Game Instructions - simplified and reactivated cascade and laser game
instruction scripts, fixed scripting background image so that it scales
properly in fullscreen
- Scripting - Added some basic scripts so that new users will have a
complete lesson set out of the box. Added a howto in the docs.
10 Jun 2009 (svn.debian.org/tux4kids - revision 1034)
[ David Bruce <davidstuartbruce@gmail.com> ]
Version 1.7.5
......
......@@ -14,6 +14,7 @@ Previous Project Manager:
Developers:
Jacob Greig <bombastic@firstlinux.net>
Jesse Andrews <jdandr2@sheffield.cslab.uky.edu>
Matthew Trey <tux4kids@treyhome.com>
Original Windows Port by:
Olivier Dagenais <olivier_dagenais@canada.com>
Windows Crossbuild by:
......
......@@ -544,38 +544,47 @@ static int load_script(const char* fn)
do
{
for ( tmpStr = str; strlen(tmpStr) >= 3; ++tmpStr )
// search the current line for comment end
for ( tmpStr = str; strlen(tmpStr) >= 3 && !found; ++tmpStr )
{
if (strncmp("-->",tmpStr, 3) == 0)
{
found = 1;
tmpStr += 3;
if (strlen(tmpStr) > 0)
{
// copy the rest of the line into str for processing
strncpy(str, tmpStr, strlen(tmpStr));
}
else
{
// str needs another line, this one is used up
fscanf_result = fscanf(f, "%[^\n]\n", str);
tmpStr = str;
// we may get consecutive comment lines
if (fscanf_result != EOF && strncmp("<!--", str, 4) == 0)
{
found = 0;
}
}
}
}
// if the comment end was not found get another line
if (!found)
{
fscanf_result = fscanf(f, "%[^\n]\n", str);
tmpStr = str;
}
// we did find the end of the comment
else
{
// move past the comment end tag
tmpStr += 3;
if (strlen(tmpStr) > 0)
{
// copy the rest of the line into str for processing
strncpy(str, tmpStr, strlen(tmpStr));
}
else
{
// str needs another line, this one is used up
fscanf_result = fscanf(f, "%[^\n]\n", str);
tmpStr = str;
}
// if the next line is a comment, start all over again
if (fscanf_result != EOF && strncmp("<!--", str, 4) == 0)
{
found = 0;
}
{
} while ( fscanf_result != EOF && !found );
/* -- if we reached the end of the file and saw no close to the comment, generate a warning -- */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment