Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libterminfo Following a newline, strip leading whitespac...



details:   https://anonhg.NetBSD.org/src/rev/d3c767126b3c
branches:  trunk
changeset: 821631:d3c767126b3c
user:      roy <roy%NetBSD.org@localhost>
date:      Sat Feb 11 14:57:15 2017 +0000

description:
Following a newline, strip leading whitespace from capability strings.

diffstat:

 lib/libterminfo/compile.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r b48ff4ac23e6 -r d3c767126b3c lib/libterminfo/compile.c
--- a/lib/libterminfo/compile.c Sat Feb 11 14:11:24 2017 +0000
+++ b/lib/libterminfo/compile.c Sat Feb 11 14:57:15 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compile.c,v 1.9 2013/06/07 13:16:18 roy Exp $ */
+/* $NetBSD: compile.c,v 1.10 2017/02/11 14:57:15 roy Exp $ */
 
 /*
  * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: compile.c,v 1.9 2013/06/07 13:16:18 roy Exp $");
+__RCSID("$NetBSD: compile.c,v 1.10 2017/02/11 14:57:15 roy Exp $");
 
 #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H
 #include <sys/endian.h>
@@ -323,6 +323,13 @@
        last = '\0';
        /* Convert escape codes */
        while ((ch = *str++) != '\0') {
+               if (ch == '\n') {
+                       /* Following a newline, strip leading whitespace from
+                        * capability strings. */
+                       while (isspace((unsigned char)*str))
+                               str++;
+                       continue;
+               }
                if (slash == 0 && ch == '\\') {
                        slash = 1;
                        continue;



Home | Main Index | Thread Index | Old Index