X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Ftrim_sgr0.c;h=80c8f77fbebe1f2eec543232fd17731c4c266e7c;hp=7e7d15dfbe5682f2a3f4d100cf99d2f7db25656b;hb=99c50261a07b29bfad4ab33ebe9f6597558e8c88;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c index 7e7d15df..80c8f77f 100644 --- a/ncurses/tinfo/trim_sgr0.c +++ b/ncurses/tinfo/trim_sgr0.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005 Free Software Foundation, Inc. * + * Copyright (c) 2005-2006,2007 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 * @@ -37,7 +37,7 @@ #include #include -MODULE_ID("$Id: trim_sgr0.c,v 1.5 2005/07/17 00:13:24 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.8 2007/04/07 17:14:11 tom Exp $") #undef CUR #define CUR tp-> @@ -83,7 +83,7 @@ skip_delay(const char *s) { if (s[0] == '$' && s[1] == '<') { s += 2; - while ((*s != '\0') && (isdigit(*s) || *s == '/')) + while (isdigit(UChar(*s)) || *s == '/') ++s; if (*s == '>') ++s; @@ -247,9 +247,7 @@ _nc_trim_sgr0(TERMTYPE *tp) if (!rewrite_sgr(on, enter_alt_charset_mode) || !rewrite_sgr(off, exit_alt_charset_mode) || !rewrite_sgr(end, exit_alt_charset_mode)) { - FreeIfNeeded(on); FreeIfNeeded(off); - FreeIfNeeded(end); } else if (similar_sgr(off, end) && !similar_sgr(off, on)) { TR(TRACE_DATABASE, ("adjusting sgr(9:off) : %s", _nc_visbuf(off))); @@ -315,8 +313,8 @@ _nc_trim_sgr0(TERMTYPE *tp) */ free(off); } - free(end); - free(on); + FreeIfNeeded(end); + FreeIfNeeded(on); } else { /* * Possibly some applications are confused if sgr0 contains rmacs,