Module Name: src Committed By: roy Date: Sat Feb 11 14:57:15 UTC 2017
Modified Files: src/lib/libterminfo: compile.c Log Message: Following a newline, strip leading whitespace from capability strings. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libterminfo/compile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.9 src/lib/libterminfo/compile.c:1.10 --- src/lib/libterminfo/compile.c:1.9 Fri Jun 7 13:16:18 2013 +++ src/lib/libterminfo/compile.c Sat Feb 11 14:57:15 2017 @@ -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 @@ encode_string(const char *term, const ch 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;