if () statement folding seems not to work correctly

This forum should be used for all code folding problems, questions or suggestions. You can also use this forum to request folding support for a new language.
Post Reply
UdoJ
Posts: 6
Joined: Tue Sep 14, 2004 6:46 am

if () statement folding seems not to work correctly

Post by UdoJ »

Hi Jussij,

It seems that there is a bug related to the folding of the if () statement (programming language: C).

Here is what I did:
I wrote a small stupid program to show the behavior:

Code: Select all

#include <StdIO.H>

void main (void)
{
  int         iTest = 0;

  printf ("Hello World!\n");

  if (iTest)
  {
    printf ("iTest: %d\n", iTest);
  }
}
I collapsed all and got the following:

Code: Select all

#include <StdIO.H>

void main (void)
{ ... }
Now I inserted another line:

Code: Select all

#include <StdIO.H>
#include <ConIO.H>

void main (void)
{ ... }
I saved the file. The Zeus view doesn't change but the contents of the file on the disk looked like that:

Code: Select all

#include <StdIO.H>
#include <ConIO.H>

void main (void)
{
  int         iTest = 0;

  printf ("Hello World!\n");

  if (iTest)
  { ... }
}
If I now close Zeus everything between the {} braces of the if statement is gone. The file on the disk looks like above.
It seems the file is only saved correctly if I make changes to the unfolded file.
This is really bad because if I forget to unfold the whole file I lose a lot of code.
Could you please check this.

Thanks Udo
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Udo,
This is really bad because if I forget to unfold the whole file I lose a lot of code.
You have definitely found a bug and as point out this is a very dangerous and serious bug :(

The problem is that nested folds (ie folds inside a fold) are not being handled correctly.

A fix for this has been found and is currently being tested. Once the testing is complete a new executable will be made available to all registered users. I expect this to happen in the next day or so.

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

This bug has been fixed in the latest Zeus 3.94a release.

All registered 3.94 users have been sent an e-mail instructing them on how to get a free upgrade to this latest version.

Any registered 3.94 user who did not receive an e-mail should send their registration details to sales at zeusedit dot com and a upgrade will be made available.

Cheers Jussi
Post Reply