Bug 67781 - Indent -cdw doesn't work when while and } are on different lines.
Indent -cdw doesn't work when while and } are on different lines.
Product: Red Hat Linux
Classification: Retired
Component: indent (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Petr Machata
Depends On:
  Show dependency treegraph
Reported: 2002-07-01 19:37 EDT by Octavio Alvarez
Modified: 2015-05-04 21:32 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-01 04:57:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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

Description of problem:
Having the following code:

do {
while (condition=1);

indent -cdw should give me:

do {
} while (condition=1);

but it gives me the same as the original.

However, if the original is:

do {
} 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:

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 15:40:10 EDT
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-03 20:48:15 EDT
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

Comment 3 Petr Machata 2006-02-01 04:57:57 EST
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.