Source-Changes-HG archive

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

[src/trunk]: src/libexec/makewhatis Cat pages end up looking like "page -- de...



details:   https://anonhg.NetBSD.org/src/rev/16af74d8daaf
branches:  trunk
changeset: 579983:16af74d8daaf
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Apr 03 20:30:39 2005 +0000

description:
Cat pages end up looking like "page -- description", so substitute "--" for
the section page. This makes things look right again, and avoids duplicates.

diffstat:

 libexec/makewhatis/makewhatis.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (64 lines):

diff -r b5bf1d2b6358 -r 16af74d8daaf libexec/makewhatis/makewhatis.c
--- a/libexec/makewhatis/makewhatis.c   Sun Apr 03 20:12:18 2005 +0000
+++ b/libexec/makewhatis/makewhatis.c   Sun Apr 03 20:30:39 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: makewhatis.c,v 1.31 2004/11/05 21:59:12 dsl Exp $      */
+/*     $NetBSD: makewhatis.c,v 1.32 2005/04/03 20:30:39 christos Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\n\
        All rights reserved.\n");
-__RCSID("$NetBSD: makewhatis.c,v 1.31 2004/11/05 21:59:12 dsl Exp $");
+__RCSID("$NetBSD: makewhatis.c,v 1.32 2005/04/03 20:30:39 christos Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -444,7 +444,7 @@
                        if (*from != '\0')
                                *to++ = ' ';
                }
-               else if (*(from + 1) == '\10')
+               else if (*(from + 1) == '\b')
                        from += 2;
                else
                        *to++ = *from++;
@@ -492,6 +492,8 @@
        }
        while (buffer[0] == '\n');
 
+printf("buffer %s\n", buffer);
+
        section = NULL;
        if ((ptr = strchr(buffer, '(')) != NULL) {
                if ((last = strchr(ptr + 1, ')')) !=NULL) {
@@ -505,6 +507,8 @@
                }
        }
 
+printf("section %s\n", section);
+
        for (;;) {
                if (GetS(in, buffer, sizeof(buffer)) == NULL) {
                        free(section);
@@ -515,6 +519,7 @@
                        break;
        }
 
+printf("buffer2 %s\n", buffer);
        ptr = last = buffer;
        size = sizeof(buffer) - 1;
        while ((size > 0) && (GetS(in, ptr, size) != NULL)) {
@@ -526,7 +531,9 @@
                if (length == 0) {
                        *last = '\0';
 
-                       ptr = replacestring(buffer, " - ", section);
+printf("buffer [%s] section [%s]\n", buffer, section);
+                       ptr = replacestring(buffer, " -- ", section);
+printf("ptr %s\n", ptr);
                        free(section);
                        return ptr;
                }



Home | Main Index | Thread Index | Old Index