Module Name:    src
Committed By:   rillig
Date:           Tue Oct  5 06:15:25 UTC 2021

Modified Files:
        src/usr.bin/indent: io.c lexi.c pr_comment.c

Log Message:
indent: use proper escape sequence for form feed

This escape sequence has been available since at least 1978.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/indent/io.c
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/indent/lexi.c
cvs rdiff -u -r1.50 -r1.51 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/io.c
diff -u src/usr.bin/indent/io.c:1.69 src/usr.bin/indent/io.c:1.70
--- src/usr.bin/indent/io.c:1.69	Tue Oct  5 06:09:42 2021
+++ src/usr.bin/indent/io.c	Tue Oct  5 06:15:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.69 2021/10/05 06:09:42 rillig Exp $	*/
+/*	$NetBSD: io.c,v 1.70 2021/10/05 06:15:24 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)io.c	8.1 (Be
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.69 2021/10/05 06:09:42 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.70 2021/10/05 06:15:24 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -240,7 +240,7 @@ dump_line(void)
 	    ps.stats.comment_lines++;
 	}
 	if (ps.use_ff)
-	    output_char('\014');
+	    output_char('\f');
 	else
 	    output_char('\n');
 	ps.stats.lines++;

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.68 src/usr.bin/indent/lexi.c:1.69
--- src/usr.bin/indent/lexi.c:1.68	Tue Oct  5 06:09:42 2021
+++ src/usr.bin/indent/lexi.c	Tue Oct  5 06:15:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.68 2021/10/05 06:09:42 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.69 2021/10/05 06:15:24 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.68 2021/10/05 06:09:42 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.69 2021/10/05 06:15:24 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -538,7 +538,7 @@ lexi(struct parser_state *state)
 	ttype = rbrace;
 	break;
 
-    case 014:			/* a form feed */
+    case '\f':
 	unary_delim = state->last_u_d;
 	state->last_nl = true;	/* remember this so we can set 'state->col_1'
 				 * right */

Index: src/usr.bin/indent/pr_comment.c
diff -u src/usr.bin/indent/pr_comment.c:1.50 src/usr.bin/indent/pr_comment.c:1.51
--- src/usr.bin/indent/pr_comment.c:1.50	Tue Oct  5 06:09:42 2021
+++ src/usr.bin/indent/pr_comment.c	Tue Oct  5 06:15:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr_comment.c,v 1.50 2021/10/05 06:09:42 rillig Exp $	*/
+/*	$NetBSD: pr_comment.c,v 1.51 2021/10/05 06:15:24 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.50 2021/10/05 06:09:42 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.51 2021/10/05 06:15:24 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -207,7 +207,7 @@ process_comment(void)
     for (;;) {			/* this loop will go until the comment is
 				 * copied */
 	switch (*buf_ptr) {	/* this checks for various special cases */
-	case 014:		/* check for a form feed */
+	case '\f':
 	    check_size_comment(3);
 	    if (!ps.box_com) {	/* in a text comment, break the line here */
 		ps.use_ff = true;
@@ -221,7 +221,7 @@ process_comment(void)
 		    buf_ptr++;
 	    } else {
 		inbuf_skip();
-		*com.e++ = 014;
+		*com.e++ = '\f';
 	    }
 	    break;
 

Reply via email to