Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/sdpquery when printing URL strings, don't use VIS_HT...



details:   https://anonhg.NetBSD.org/src/rev/7cee04dde866
branches:  trunk
changeset: 769605:7cee04dde866
user:      plunky <plunky%NetBSD.org@localhost>
date:      Thu Sep 15 17:52:53 2011 +0000

description:
when printing URL strings, don't use VIS_HTTPSTYLE, it does
not quite work as I expected.. just use VIS_CSTYLE

diffstat:

 usr.bin/sdpquery/print.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (80 lines):

diff -r e995ca1318c9 -r 7cee04dde866 usr.bin/sdpquery/print.c
--- a/usr.bin/sdpquery/print.c  Thu Sep 15 17:51:57 2011 +0000
+++ b/usr.bin/sdpquery/print.c  Thu Sep 15 17:52:53 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: print.c,v 1.18 2011/08/20 09:18:47 plunky Exp $        */
+/*     $NetBSD: print.c,v 1.19 2011/09/15 17:52:53 plunky Exp $        */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: print.c,v 1.18 2011/08/20 09:18:47 plunky Exp $");
+__RCSID("$NetBSD: print.c,v 1.19 2011/09/15 17:52:53 plunky Exp $");
 
 #include <ctype.h>
 #include <iconv.h>
@@ -64,7 +64,7 @@
 } language_t;
 
 static const char *string_uuid(uuid_t *);
-static const char *string_vis(int, const char *, size_t);
+static const char *string_vis(const char *, size_t);
 
 static void print_hexdump(const char *, const uint8_t *, size_t);
 static bool print_attribute(uint16_t, sdp_data_t *, attr_t *, size_t);
@@ -553,13 +553,14 @@
 }
 
 static const char *
-string_vis(int style, const char *src, size_t len)
+string_vis(const char *src, size_t len)
 {
        static char buf[50];
        char *dst = buf;
+       int style;
 
        buf[0] = '\0';
-       style |= VIS_NL;
+       style = VIS_CSTYLE | VIS_NL;
        while (len > 0 && (dst + 5) < (buf + sizeof(buf))) {
                dst = vis(dst, src[0], style, (len > 1 ? src[1] : 0));
                src++;
@@ -776,7 +777,7 @@
        if (!sdp_get_str(data, &str, &len))
                return;
 
-       printf("\"%s\"\n", string_vis(VIS_CSTYLE, str, len));
+       printf("\"%s\"\n", string_vis(str, len));
 }
 
 static void
@@ -799,7 +800,7 @@
                        len -= l + 1;
                        ep++;
                }
-               printf("    %s\n", string_vis(VIS_CSTYLE, str, l));
+               printf("    %s\n", string_vis(str, l));
                str = ep;
        }
 }
@@ -813,7 +814,7 @@
        if (!sdp_get_url(data, &url, &len))
                return;
 
-       printf("\"%s\"\n", string_vis(VIS_HTTPSTYLE, url, len));
+       printf("\"%s\"\n", string_vis(url, len));
 }
 
 static void
@@ -1608,7 +1609,7 @@
                }
 
                l = (size_t)(ep - str + 1);
-               printf("    %s\n", string_vis(VIS_CSTYLE, str, l));
+               printf("    %s\n", string_vis(str, l));
                str += l;
                len -= l;
        }



Home | Main Index | Thread Index | Old Index