Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/indent indent: remove support for backspace in code ...
details: https://anonhg.NetBSD.org/src/rev/639340dcf91a
branches: trunk
changeset: 376444:639340dcf91a
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jun 18 07:10:24 2023 +0000
description:
indent: remove support for backspace in code and comments
The C code in the whole tree does not contain a single literal
backspace.
diffstat:
tests/usr.bin/indent/lsym_comment.c | 3 +--
usr.bin/indent/indent.c | 6 ++----
usr.bin/indent/pr_comment.c | 6 +++---
3 files changed, 6 insertions(+), 9 deletions(-)
diffs (71 lines):
diff -r f42cff2129ac -r 639340dcf91a tests/usr.bin/indent/lsym_comment.c
--- a/tests/usr.bin/indent/lsym_comment.c Sun Jun 18 06:56:32 2023 +0000
+++ b/tests/usr.bin/indent/lsym_comment.c Sun Jun 18 07:10:24 2023 +0000
@@ -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
diff -r f42cff2129ac -r 639340dcf91a usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c Sun Jun 18 06:56:32 2023 +0000
+++ b/usr.bin/indent/indent.c Sun Jun 18 07:10:24 2023 +0000
@@ -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++;
}
diff -r f42cff2129ac -r 639340dcf91a usr.bin/indent/pr_comment.c
--- a/usr.bin/indent/pr_comment.c Sun Jun 18 06:56:32 2023 +0000
+++ b/usr.bin/indent/pr_comment.c Sun Jun 18 07:10:24 2023 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index