X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftrace%2Fvisbuf.c;h=4f78139f3fcc174afe0b9d4970f7a677dd09e705;hp=13023aaa1a82426e9f2c45e1a730299d7ff623e3;hb=8890c8f28a1db5995ef17f52a7d8c0b9cf574210;hpb=e2e9c09c48b19b24979cafb2d4864f538b5ddd1c diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c index 13023aaa..4f78139f 100644 --- a/ncurses/trace/visbuf.c +++ b/ncurses/trace/visbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2014,2016 Free Software Foundation, Inc. * + * Copyright (c) 2001-2017,2019 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 * @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: visbuf.c,v 1.48 2016/09/05 00:43:08 tom Exp $") +MODULE_ID("$Id: visbuf.c,v 1.51 2019/05/04 20:31:31 tom Exp $") #define NUM_VISBUFS 4 @@ -80,6 +80,9 @@ _nc_vischar(char *tp, unsigned c LIMIT_ARG) } else if (c == '\b') { *tp++ = '\\'; *tp++ = 'b'; + } else if (c == '\t') { + *tp++ = '\\'; + *tp++ = 't'; } else if (c == '\033') { *tp++ = '\\'; *tp++ = 'e'; @@ -334,9 +337,9 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) buf[j].chars[PUTC_i], &PUT_st); if (PUTC_n <= 0 || buf[j].chars[PUTC_i] > 255) { _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) - "{%d:\\u%x}", - wcwidth(buf[j].chars[PUTC_i]), - buf[j].chars[PUTC_i]); + "{%d:\\u%lx}", + _nc_wacs_width(buf[j].chars[PUTC_i]), + (unsigned long) buf[j].chars[PUTC_i]); (void) _nc_trace_bufcat(bufnum, temp); break; }