Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2007 02:18:34 GMT
From:      Weongyo Jeong <weongyo.jeong@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/118297: ndiscvt(8): sort a output format.
Message-ID:  <200711280218.lAS2IY5W094295@www.freebsd.org>
Resent-Message-ID: <200711280220.lAS2K1hw044440@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         118297
>Category:       bin
>Synopsis:       ndiscvt(8): sort a output format.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 28 02:20:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Weongyo Jeong
>Release:        FreeBSD 7.0 CURRENT
>Organization:
CDNetworks
>Environment:
FreeBSD freebsd.weongyo.org 7.0-CURRENT FreeBSD 7.0-CURRENT #3: Sun Jun 24 21:47:30 KST 2007     weongyo@bsd.dev1.cdnetworks.co.kr:/usr/obj/usr/src/sys/GENERIC  i386
You have mail in /var/mail/weongyo

>Description:
the output automatically generated by ndiscvt(8) is not easy to read.  This fix sorts output formats.

>How-To-Repeat:
$ ndis -i <anyfiles> -s <anyfiles> -o tmp.h

>Fix:
Index: inf.c
===================================================================
RCS file: /data/cvs/src/usr.sbin/ndiscvt/inf.c,v
retrieving revision 1.16
diff -u -r1.16 inf.c
--- inf.c       15 May 2005 19:46:14 -0000      1.16
+++ inf.c       28 Nov 2007 02:11:00 -0000
@@ -451,8 +451,8 @@
                if (reg->section == sec) {
                        if (reg->subkey == NULL) {
                                fprintf(ofp, "\n\t{ \"%s\",", reg->key);
-                               fprintf(ofp,"\n\t\"%s \",", reg->key);
-                               fprintf(ofp, "\n\t{ \"%s\" }, %d },",
+                               fprintf(ofp,"\n\t  \"%s \",", reg->key);
+                               fprintf(ofp, "\n\t  { \"%s\" }, %d },",
                                    reg->value == NULL ? "" :
                                    stringcvt(reg->value), devidx);
                        } else if (strncasecmp(reg->subkey,
@@ -537,8 +537,8 @@
                        continue;
                if (reg->key == NULL || strcasecmp(reg->key, "Default"))
                        continue;
-               fprintf(ofp, "\n\t{ \"%s\" }, %d },", reg->value == NULL ? "" :
-                   stringcvt(reg->value), devidx);
+               fprintf(ofp, "\n\t  { \"%s\" }, %d },",
+                   reg->value == NULL ? "" : stringcvt(reg->value), devidx);
                        break;
        }
        return;
@@ -555,7 +555,7 @@
                        continue;
                if (reg->key == NULL || strcasecmp(reg->key, "ParamDesc"))
                        continue;
-               fprintf(ofp, "\n\t\"%s", stringcvt(r->value));
+               fprintf(ofp, "\n\t  \"%s", stringcvt(r->value));
                        break;
        }
        return;


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711280218.lAS2IY5W094295>