Module Name: src
Committed By: rillig
Date: Sun Jun 18 07:10:24 UTC 2023
Modified Files:
src/tests/usr.bin/indent: lsym_comment.c
src/usr.bin/indent: indent.c pr_comment.c
Log Message:
indent: remove support for backspace in code and comments
The C code in the whole tree does not contain a single literal
backspace.
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/tests/usr.bin/indent/lsym_comment.c
cvs rdiff -u -r1.380 -r1.381 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.168 -r1.169 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/tests/usr.bin/indent/lsym_comment.c
diff -u src/tests/usr.bin/indent/lsym_comment.c:1.22 src/tests/usr.bin/indent/lsym_comment.c:1.23
--- src/tests/usr.bin/indent/lsym_comment.c:1.22 Sat Jun 17 22:09:24 2023
+++ src/tests/usr.bin/indent/lsym_comment.c Sun Jun 18 07:10:24 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_comment.c,v 1.22 2023/06/17 22:09:24 rillig Exp $ */
+/* $NetBSD: lsym_comment.c,v 1.23 2023/06/18 07:10:24 rillig Exp $ */
/*
* Tests for the token lsym_comment, which starts a comment.
@@ -50,7 +50,6 @@
* - wrap/nowrap comment containing '\n'
* - wrap/nowrap comment containing '\f'
* - wrap/nowrap comment containing '\t'
- * - wrap/nowrap comment containing '\b'
*/
//indent input
Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.380 src/usr.bin/indent/indent.c:1.381
--- src/usr.bin/indent/indent.c:1.380 Sat Jun 17 22:28:49 2023
+++ src/usr.bin/indent/indent.c Sun Jun 18 07:10:24 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: indent.c,v 1.380 2023/06/17 22:28:49 rillig Exp $ */
+/* $NetBSD: indent.c,v 1.381 2023/06/18 07:10:24 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: indent.c,v 1.380 2023/06/17 22:28:49 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.381 2023/06/18 07:10:24 rillig Exp $");
#include <sys/param.h>
#include <err.h>
@@ -176,8 +176,6 @@ ind_add(int ind, const char *s, size_t l
ind = 0;
else if (*p == '\t')
ind = next_tab(ind);
- else if (*p == '\b')
- ind--;
else
ind++;
}
Index: src/usr.bin/indent/pr_comment.c
diff -u src/usr.bin/indent/pr_comment.c:1.168 src/usr.bin/indent/pr_comment.c:1.169
--- src/usr.bin/indent/pr_comment.c:1.168 Sat Jun 17 23:03:20 2023
+++ src/usr.bin/indent/pr_comment.c Sun Jun 18 07:10:24 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: pr_comment.c,v 1.168 2023/06/17 23:03:20 rillig Exp $ */
+/* $NetBSD: pr_comment.c,v 1.169 2023/06/18 07:10:24 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pr_comment.c,v 1.168 2023/06/17 23:03:20 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.169 2023/06/18 07:10:24 rillig Exp $");
#include <string.h>
@@ -177,7 +177,7 @@ copy_comment_wrap_text(int line_length,
*last_blank = (ssize_t)com.len;
com_add_char(ch);
ind++;
- if (memchr("*\n\r\b\t", inp_p[0], 6) != NULL)
+ if (memchr("*\n\r\t", inp_p[0], 5) != NULL)
break;
if (ind >= line_length && *last_blank != -1)
break;