X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fcomp_expand.c;h=09b816954d7471cbbd1aa4e7e4d52334e8b3936a;hp=02e38e6e3c7a440a3715b8d0010f0209dd852659;hb=81304798ee736c467839c779c9ca5dca48db7bea;hpb=47d2fb4537d9ad5bb14f4810561a327930ca4280 diff --git a/ncurses/tinfo/comp_expand.c b/ncurses/tinfo/comp_expand.c index 02e38e6e..09b81695 100644 --- a/ncurses/tinfo/comp_expand.c +++ b/ncurses/tinfo/comp_expand.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -36,7 +36,7 @@ #include #include -MODULE_ID("$Id: comp_expand.c,v 1.32 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: comp_expand.c,v 1.33 2021/02/28 00:58:19 tom Exp $") #if 0 #define DEBUG_THIS(p) DEBUG(9, p) @@ -87,7 +87,10 @@ _nc_tic_expand(const char *srcp, bool tic_format, int numbers) return 0; } - DEBUG_THIS(("_nc_tic_expand %s", _nc_visbuf(srcp))); + DEBUG_THIS(("_nc_tic_expand %s:%s:%s", + tic_format ? "ti" : "tc", + numbers ? "#" : "", + _nc_visbuf(srcp))); bufp = 0; while ((ch = UChar(*str)) != 0) { if (ch == '%' && REALPRINT(str + 1)) { @@ -162,12 +165,12 @@ _nc_tic_expand(const char *srcp, bool tic_format, int numbers) trailing_spaces(str))) { buffer[bufp++] = '\\'; buffer[bufp++] = 's'; - } else if ((ch == ',' || ch == ':' || ch == '^') && tic_format) { + } else if ((ch == ',' || ch == '^') && tic_format) { buffer[bufp++] = '\\'; buffer[bufp++] = (char) ch; } else if (REALPRINT(str) && (ch != ',' - && ch != ':' + && !(ch == ':' && !tic_format) && !(ch == '!' && !tic_format) && ch != '^')) buffer[bufp++] = (char) ch;