summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2dcbbf2)
raw | patch | inline | side by side (parent: 2dcbbf2)
author | Antoine Beaupré <anarcat@koumbit.org> | |
Fri, 6 Dec 2013 05:16:28 +0000 (00:16 -0500) | ||
committer | Antoine Beaupré <anarcat@koumbit.org> | |
Fri, 6 Dec 2013 05:16:56 +0000 (00:16 -0500) |
note that "forcing" may not work: ncurses still expects your locale to
be correct, so maybe the force flag should also explicitely set a utf8
locale?
be correct, so maybe the force flag should also explicitely set a utf8
locale?
src/oping.c | patch | blob | history |
diff --git a/src/oping.c b/src/oping.c
index aa99ef9d87a7d7ac1cf9673518166004c8db05fa..c8d3cdfd104101d2ae4dffc75fd04fd22aa53aa9 100644 (file)
--- a/src/oping.c
+++ b/src/oping.c
static int opt_count = -1;
static int opt_send_ttl = 64;
static uint8_t opt_send_qos = 0;
+static int opt_utf8_force = 0;
+static int opt_utf8_disable = 0;
static int host_num = 0;
while (1)
{
- optchar = getopt (argc, argv, "46c:hi:I:t:Q:f:D:");
+ optchar = getopt (argc, argv, "46uUc:hi:I:t:Q:f:D:");
if (optchar == -1)
break;
opt_addrfamily = (optchar == '4') ? AF_INET : AF_INET6;
break;
+ case 'u':
+ opt_utf8_force = 1;
+ break;
+ case 'U':
+ opt_utf8_disable = 1;
+ break;
+
case 'c':
{
int new_count;
}
}
+ if (opt_utf8_disable && opt_utf8_force)
+ fprintf (stderr, "Ignoring contradictory unicode flags\n");
+
return (optind);
} /* }}} read_options */
#if USE_NCURSES
static int unicode_locale() /* {{{ */
{
- return _nc_unicode_locale();
+ return ( _nc_unicode_locale() || opt_utf8_force ) && !opt_utf8_disable;
} /* }}} int unicode_locale */
static int update_prettyping_graph (ping_context_t *ctx, /* {{{ */