Source-Changes-HG archive

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

[src/trunk]: src/lib/libterminfo If we only have a name then we flatten to an...



details:   https://anonhg.NetBSD.org/src/rev/aef91f18843d
branches:  trunk
changeset: 752441:aef91f18843d
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Feb 25 23:44:02 2010 +0000

description:
If we only have a name then we flatten to an alias.

diffstat:

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

diffs (32 lines):

diff -r 7923a46d7bdf -r aef91f18843d lib/libterminfo/compile.c
--- a/lib/libterminfo/compile.c Thu Feb 25 23:40:39 2010 +0000
+++ b/lib/libterminfo/compile.c Thu Feb 25 23:44:02 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compile.c,v 1.1 2010/02/22 23:05:39 roy Exp $ */
+/* $NetBSD: compile.c,v 1.2 2010/02/25 23:44:02 roy Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: compile.c,v 1.1 2010/02/22 23:05:39 roy Exp $");
+__RCSID("$NetBSD: compile.c,v 1.2 2010/02/25 23:44:02 roy Exp $");
 
 #include <assert.h>
 #include <ctype.h>
@@ -235,7 +235,12 @@
                return -1;
        
        cap = *buf;
-       *cap++ = 2; /* version */
+       if (alen == 0 && dlen == 0 && tic->flags.bufpos == 0 &&
+           tic->nums.bufpos == 0 && tic->strs.bufpos == 0 &&
+           tic->extras.bufpos == 0)
+               *cap++ = 0; /* alias */
+       else
+               *cap++ = 2; /* version */
        le16enc(cap, len);
        cap += sizeof(uint16_t);
        memcpy(cap, tic->name, len);



Home | Main Index | Thread Index | Old Index