From 7e5c86e018a1c3d51b8a674fb577d853be458680 Mon Sep 17 00:00:00 2001 From: "E. Choroba" Date: Wed, 28 Aug 2024 14:47:18 +0200 Subject: [PATCH] Prevent uninitialized warnings --- tred_refactored/tredlib/TrEd/Stylesheet.pm | 2 +- tred_refactored/tredlib/contrib/support/arrows.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tred_refactored/tredlib/TrEd/Stylesheet.pm b/tred_refactored/tredlib/TrEd/Stylesheet.pm index 968639995..66695a23b 100644 --- a/tred_refactored/tredlib/TrEd/Stylesheet.pm +++ b/tred_refactored/tredlib/TrEd/Stylesheet.pm @@ -377,7 +377,7 @@ sub get_stylesheet_patterns { $hint = $s->{hint}; $context = $s->{context}; $context = '.*' unless ( wantarray or $context =~ /\S/ ); - chomp $context; + chomp $context if length $context; @$patterns = defined( $s->{patterns} ) ? @{ $s->{patterns} } : (); } else { diff --git a/tred_refactored/tredlib/contrib/support/arrows.inc b/tred_refactored/tredlib/contrib/support/arrows.inc index 5766107de..5ac84b193 100644 --- a/tred_refactored/tredlib/contrib/support/arrows.inc +++ b/tred_refactored/tredlib/contrib/support/arrows.inc @@ -219,7 +219,7 @@ instruction in L). $dx ||= 0; $dy ||= 0; - if ( $node == $target ) { + if ( $node == ($target // -1) ) { # same node push @{ $props{-coords} }, <<"COORDS";