]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tic.c
ncurses 6.0 - patch 20150822
[ncurses.git] / progs / tic.c
index 8182e2eea7aa9d8a0f2c1d4682bfac67c5d1dbe0..1175d9a479a921aa4376a0fd775ad36a1880504d 100644 (file)
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.210 2015/05/27 00:58:18 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.213 2015/08/22 23:49:57 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -142,6 +142,7 @@ usage(void)
     static const char options_string[] =
     {
        DATA("Options:")
+       DATA("  -0         format translation output all capabilities on one line")
        DATA("  -1         format translation output one capability per line")
 #if NCURSES_XNAMES
        DATA("  -a         retain commented-out capabilities (sets -x also)")
@@ -2149,7 +2150,7 @@ get_fkey_list(TERMTYPE *tp)
     NAME_VALUE *result = typeMalloc(NAME_VALUE, NUM_STRINGS(tp) + 1);
     const struct tinfo_fkeys *all_fkeys = _nc_tinfo_fkeys;
     int used = 0;
-    int j;
+    unsigned j;
 
     if (result == 0)
        failed("get_fkey_list");
@@ -2165,7 +2166,7 @@ get_fkey_list(TERMTYPE *tp)
     }
 #if NCURSES_XNAMES
     for (j = STRCOUNT; j < NUM_STRINGS(tp); ++j) {
-       const char *name = ExtStrname(tp, j, strnames);
+       const char *name = ExtStrname(tp, (int) j, strnames);
        if (*name == 'k') {
            result[used].keycode = -1;
            result[used].name = name;
@@ -2337,13 +2338,15 @@ check_termtype(TERMTYPE *tp, bool literal)
                      ("will trim sgr0\n\toriginal sgr0=%s\n\ttrimmed  sgr0=%s",
                       _nc_visbuf2(1, exit_attribute_mode),
                       _nc_visbuf2(2, check_sgr0)));
-               free(check_sgr0);
            } else {
                DEBUG(2,
                      ("will not trim sgr0\n\toriginal sgr0=%s",
                       _nc_visbuf(exit_attribute_mode)));
            }
        }
+       if (check_sgr0 != exit_attribute_mode) {
+           free(check_sgr0);
+       }
     }
 #ifdef TRACE
     show_where(2);