Bug 67781 - Indent -cdw doesn't work when while and } are on different lines.
Summary: Indent -cdw doesn't work when while and } are on different lines.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: indent
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Machata
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-07-01 23:37 UTC by Octavio Alvarez
Modified: 2015-05-05 01:32 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-01 09:57:57 UTC
Embargoed:


Attachments (Terms of Use)

Description Octavio Alvarez 2002-07-01 23:37:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Description of problem:
Having the following code:

do {
  whatever();
}
while (condition=1);

indent -cdw should give me:

do {
  whatever();
} while (condition=1);

but it gives me the same as the original.

However, if the original is:

do {
  whatever();
} while (condition=1);

indent -cdw works as expected, leaving the text as is.
indent -ncdw works (always) as expected making sure there exists a blank after 
the }.


Version-Release number of selected component (if applicable):
Version is 2.2.7. (is it?) The one that comes with RH 7.3.

How reproducible:
Always

Steps to Reproduce:
1. Have a file test.c contain the code from the first example above.
2. ]$ indent test.c -cdw
3. ]$ cat test.c

Comment 1 Trond Eivind Glomsrxd 2002-07-03 19:40:10 UTC
Can you try indent-2.2.8-3 from Rawhide? You'll have to rebuild it to make it
run on your system...

Comment 2 Octavio Alvarez 2002-07-04 00:48:15 UTC
I just downloaded indent-2.2.8-3.i386.rpm from Rawhide. I didn't have to 
rebuild it. (Tested it on an RH72.)

Result: It is still buggy.

]$ rpm -q indent
indent-2.2.8-3



Comment 3 Petr Machata 2006-02-01 09:57:57 UTC
It's fixed in rawhide.
I changed the behavior of cuddling to brace, so that the closing brace stays
aligned with the opening one.  This also affects cuddled else.


Note You need to log in before you can comment on or make changes to this bug.