]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tic.c
ncurses 5.7 - patch 20100515
[ncurses.git] / progs / tic.c
index 3d894acd2d406b850c465268400a2b6c2933c31b..e6032c80989dd3779d3d062a0d6d0d07b65dd4f9 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2010 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            *
@@ -44,7 +44,7 @@
 #include <dump_entry.h>
 #include <transform.h>
 
 #include <dump_entry.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.139 2009/12/12 17:30:12 Nicholas.Marriott Exp $")
+MODULE_ID("$Id: tic.c,v 1.141 2010/05/01 21:17:23 tom Exp $")
 
 const char *_nc_progname = "tic";
 
 
 const char *_nc_progname = "tic";
 
@@ -347,6 +347,9 @@ stripped(char *src)
 
        if ((dst = strdup(src)) == NULL)
            failed("strdup");
 
        if ((dst = strdup(src)) == NULL)
            failed("strdup");
+
+       assert(dst != 0);
+
        len = strlen(dst);
        while (--len != 0 && isspace(UChar(dst[len])))
            dst[len] = '\0';
        len = strlen(dst);
        while (--len != 0 && isspace(UChar(dst[len])))
            dst[len] = '\0';
@@ -1272,6 +1275,8 @@ similar_sgr(int num, char *a, char *b)
            } else if (delaying) {
                a = skip_delay(a);
                b = skip_delay(b);
            } else if (delaying) {
                a = skip_delay(a);
                b = skip_delay(b);
+           } else if ((*b == '0' || (*b == ';')) && *a == 'm') {
+               b++;
            } else {
                a++;
            }
            } else {
                a++;
            }