From b4477c97a5441c704c710df14a530291033da40a Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 1 Jun 2025 15:33:31 +0300 Subject: [PATCH] Fix variable shadowing --- swg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/swg b/swg index 570720c..dca444f 100755 --- a/swg +++ b/swg @@ -274,27 +274,31 @@ END_HTML $cmd = $2; } if ($cmd =~ /^=> (\S+)\s?(.*)$/) { + my $url = $1; my $t = ($2 eq q{}) ? $1 : $2; $t = htmlescape $t; $t =~ s/"/\&guot;/g; - $_ = "$head=> $t"; + $_ = "$head=> $t"; } elsif ($cmd =~ /^img (\S+)\s?(.*) => (\S+)$/) { if ($2 eq q{}) { $_ = "$head"; } else { + my $urlImg = $1; + my $urlA = $3; my $t = $2; $t = htmlescape $t; $t =~ s/"/\&guot;/g; - $_ = "$head\"$t\""; + $_ = "$head\"$t\""; } } elsif ($cmd =~ /^img (\S+)\s?(.*)$/) { if ($2 eq q{}) { $_ = "$head"; } else { + my $url = $1; my $t = $2; $t = htmlescape $t; $t =~ s/"/\&guot;/g; - $_ = "$head\"$t\""; + $_ = "$head\"$t\""; } } elsif ($cmd eq q{do-backs}) { $doBacks = 1; -- 2.48.1