]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/tracemunch
ncurses 6.2 - patch 20200308
[ncurses.git] / test / tracemunch
index cc33852dc5ccf13968cf61cecccaa44b550b236e..4de41963f979fabb76a3c53f17205a80973728a0 100755 (executable)
@@ -1,7 +1,8 @@
 #!/usr/bin/env perl
-# $Id: tracemunch,v 1.26 2019/12/21 22:33:35 tom Exp $
+# $Id: tracemunch,v 1.28 2020/03/08 12:22:49 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.                #
+# Copyright 2018-2019,2020 Thomas E. Dickey                                  #
+# Copyright 1998-2005,2017 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 "Software"), #
@@ -36,6 +37,8 @@
 use strict;
 use warnings;
 
+$| = 1;
+
 our $putattr =
     'PutAttrChar\(\{\{ ' . "'(.)'"
   . ' = 0[0-7]+ \}\}\) at \(([0-9]+), ([0-9]+)\)';
@@ -419,7 +422,10 @@ sub transaddr($) {
             my $type = $known_p1{$func};
             chomp $addr;
             $addr =~ s/^[^(]+\((0x[[:xdigit:]]+).*/$1/i;
-            if ( $type == 1 ) {
+            if ( $addr !~ /^0x[[:xdigit:]]+$/i ) {
+                printf "OOPS - expected type #$type, skipping\n>>$addr\n";
+            }
+            elsif ( $type == 1 ) {
                 $scr_addr{$addr} = ++$scr_nums;
                 $arg = &transaddr($arg);
             }