indent: remove support for backspace in code and comments

The C code in the whole tree does not contain a single literal
backspace.
This commit is contained in:
rillig 2023-06-18 07:10:24 +00:00
parent 5af61aec35
commit 926f8bd544
3 changed files with 6 additions and 9 deletions

View File

@ -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

View File

@ -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 len)
ind = 0;
else if (*p == '\t')
ind = next_tab(ind);
else if (*p == '\b')
ind--;
else
ind++;
}

View File

@ -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, ssize_t *last_blank)
*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;