Module Name: src
Committed By: rillig
Date: Tue Oct 12 19:57:53 UTC 2021
Modified Files:
src/usr.bin/indent: pr_comment.c
Log Message:
indent: replace unreachable code with assertion
To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/indent/pr_comment.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/indent/pr_comment.c
diff -u src/usr.bin/indent/pr_comment.c:1.71 src/usr.bin/indent/pr_comment.c:1.72
--- src/usr.bin/indent/pr_comment.c:1.71 Tue Oct 12 19:56:07 2021
+++ src/usr.bin/indent/pr_comment.c Tue Oct 12 19:57:53 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pr_comment.c,v 1.71 2021/10/12 19:56:07 rillig Exp $ */
+/* $NetBSD: pr_comment.c,v 1.72 2021/10/12 19:57:53 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)pr_comment.c
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: pr_comment.c,v 1.71 2021/10/12 19:56:07 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.72 2021/10/12 19:57:53 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
#endif
@@ -356,8 +356,7 @@ process_comment(void)
* enough.
*/
while (*p != '\0') {
- if (is_hspace(*p))
- last_blank = com.e - com.buf;
+ assert(!is_hspace(*p));
*com.e++ = *p++;
}
}