]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/trace/lib_tracebits.c
ncurses 6.2 - patch 20200404
[ncurses.git] / ncurses / trace / lib_tracebits.c
index 6f7c8ca26af3001dc06940e83c941a8952385502..14e5d90bd0972230c6a51d399f2db5fe263ec9d8 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2012,2015 Free Software Foundation, Inc.              *
+ * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 1998-2012,2015 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -34,7 +35,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_tracebits.c,v 1.25 2015/04/04 13:45:27 tom Exp $")
+MODULE_ID("$Id: lib_tracebits.c,v 1.28 2020/02/02 23:34:34 tom Exp $")
 
 #if HAVE_SYS_TERMIO_H
 #include <sys/termio.h>                /* needed for ISC */
 
 #if HAVE_SYS_TERMIO_H
 #include <sys/termio.h>                /* needed for ISC */
@@ -85,7 +86,7 @@ lookup_bits(char *buf, const BITNAMES * table, const char *label, unsigned int v
 
     _nc_STRCAT(buf, label, TRACE_BUF_SIZE(0));
     _nc_STRCAT(buf, ": {", TRACE_BUF_SIZE(0));
 
     _nc_STRCAT(buf, label, TRACE_BUF_SIZE(0));
     _nc_STRCAT(buf, ": {", TRACE_BUF_SIZE(0));
-    for (sp = table; sp->name; sp++)
+    for (sp = table; sp->name[0]; sp++)
        if (sp->val != 0
            && (val & sp->val) == sp->val) {
            _nc_STRCAT(buf, sp->name, TRACE_BUF_SIZE(0));
        if (sp->val != 0
            && (val & sp->val) == sp->val) {
            _nc_STRCAT(buf, sp->name, TRACE_BUF_SIZE(0));
@@ -130,7 +131,7 @@ _nc_trace_ttymode(TTY * tty)
        DATA(ONOCR),
        DATA(ONLRET),
        DATAX()
        DATA(ONOCR),
        DATA(ONLRET),
        DATAX()
-#define ALLOUT (OPOST|OFLAGS_TABS|ONLCR|OCRNL|ONOCR|ONLRET)
+#define ALLOUT (OPOST|OFLAGS_TABS|ONLCR|OCRNL|ONOCR|ONLRET|OFLAGS_TABS)
     }, cflags[] =
     {
        DATA(CLOCAL),
     }, cflags[] =
     {
        DATA(CLOCAL),