Bug with case labels

Prakhar Deep <[email protected]>
Newsgroups gmane.comp.gnu.indent.bugs
Organization Acme Technologies Pvt. Ltd.
Message-ID <[email protected]>
Hi,

We have found a strange behavior of indent version 2.2.9. When indent is 
run twice or more on a file, with the same  profile,  it  is changing 
that file every time.

For example:
------------

In a case structure like following:

switch(c)
{
case 1:
{

}
	PREFIX
case2:
SUFFIX
{

}

}

We ran indent with following options: -kr -ts4 -l120 -bad -nbbo -br -nce 
-nbfda -nut


First run:
----------
prakhar> indent -kr -ts4 -l120 -bad -nbbo -br -nce -nbfda -nut test.c

test.c changes to:

switch (c) {
case 1:
     {

     }
   PREFIX case2:
     SUFFIX {

     }

}


Second run:
-----------

prakhar> indent -kr -ts4 -l120 -bad -nbbo -br -nce -nbfda -nut test.c

test.c changes to: ----------------------- I form

switch (c) {
case 1:
     {

     }
     PREFIX case2:SUFFIX {

}}


Third run:
----------

prakhar> indent -kr -ts4 -l120 -bad -nbbo -br -nce -nbfda -nut test.c

test.c changes to: ----------------------- II form

switch (c) {
case 1:
     {

     }
     PREFIX case2:SUFFIX {

     }
}


Fourth run:
-----------

prakhar> indent -kr -ts4 -l120 -bad -nbbo -br -nce -nbfda -nut test.c

test.c changes to: ----------------------- I form

switch (c) {
case 1:
     {

     }
     PREFIX case2:SUFFIX {

}}


In all successive runs the file keeps on changing between the I and II 
form, infinetly.

Pls check the given behavior.

Thanks.

Prakhar Deep
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.