summaryrefslogtreecommitdiffstats
path: root/usr.bin/indent
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-02-27 20:50:34 +0000
committerobrien <obrien@FreeBSD.org>2001-02-27 20:50:34 +0000
commit30bb5dedcae628416907fb42c9133a4368ce649d (patch)
tree3d95fcfb1cccee6998e7be633ab6e48a6c37ad8b /usr.bin/indent
parentdd84ad82bfc07defd02defecf83a70f54b2ec5a5 (diff)
downloadFreeBSD-src-30bb5dedcae628416907fb42c9133a4368ce649d.zip
FreeBSD-src-30bb5dedcae628416907fb42c9133a4368ce649d.tar.gz
Fix indent endless on garbage input (i.e., if it encountered EOF while
waiting for a '}' nesting terminator) Obtained from: OpenBSD rev 1.8
Diffstat (limited to 'usr.bin/indent')
-rw-r--r--usr.bin/indent/indent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index c790720..447c8e2 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -997,7 +997,7 @@ check_type:
if (buf_ptr >= buf_end)
fill_buffer();
}
- while (*buf_ptr != '\n' || in_comment) {
+ while (*buf_ptr != '\n' || (in_comment && !had_eof)) {
CHECK_SIZE_LAB;
*e_lab = *buf_ptr++;
if (buf_ptr >= buf_end)
OpenPOWER on IntegriCloud