Module Name:    src
Committed By:   roy
Date:           Thu Feb 25 23:44:02 UTC 2010

Modified Files:
        src/lib/libterminfo: compile.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.1 src/lib/libterminfo/compile.c:1.2
--- src/lib/libterminfo/compile.c:1.1	Mon Feb 22 23:05:39 2010
+++ src/lib/libterminfo/compile.c	Thu Feb 25 23:44:02 2010
@@ -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);

Reply via email to