]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tic.c
ncurses 5.7 - patch 20100703
[ncurses.git] / progs / tic.c
index c56fd993ad14d355be2163aa28c1c0c90d847013..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            *
@@ -44,7 +44,7 @@
 #include <dump_entry.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.138 2009/03/14 18:45:55 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.141 2010/05/01 21:17:23 tom Exp $")
 
 const char *_nc_progname = "tic";
 
@@ -342,8 +342,15 @@ stripped(char *src)
     while (isspace(UChar(*src)))
        src++;
     if (*src != '\0') {
-       char *dst = strcpy((char *) malloc(strlen(src) + 1), src);
-       size_t len = strlen(dst);
+       char *dst;
+       size_t len;
+
+       if ((dst = strdup(src)) == NULL)
+           failed("strdup");
+
+       assert(dst != 0);
+
+       len = strlen(dst);
        while (--len != 0 && isspace(UChar(dst[len])))
            dst[len] = '\0';
        return dst;
@@ -1268,6 +1275,8 @@ similar_sgr(int num, char *a, char *b)
            } else if (delaying) {
                a = skip_delay(a);
                b = skip_delay(b);
+           } else if ((*b == '0' || (*b == ';')) && *a == 'm') {
+               b++;
            } else {
                a++;
            }