From 5e55b6b19a0e862ee7b252aacb4895fe7df514c4 Mon Sep 17 00:00:00 2001 From: Jan Guth Date: Fri, 29 Mar 2024 14:10:54 +0100 Subject: [PATCH] fix: obfus - here doc (#15) here doc is not parsed correctly. Also, keep spaces. --- .bin/obfus | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.bin/obfus b/.bin/obfus index 57d6d3a..fdc163b 100755 --- a/.bin/obfus +++ b/.bin/obfus @@ -161,7 +161,7 @@ sub obfuscate { # - open quotes (single or double) # - here documents if ($flatten) { - if ($line =~ m/<<\s*['"]?(\w+)['"]?\s*$/) { + if ($line =~ m/<<\s*['"]?(\w+)['"]?\s*/) { my $end = $1; print $ofh $line; while(my $line=<$ifh>) { @@ -308,10 +308,10 @@ sub newline_process { open $handle, '<', \$data; while(my $line=<$handle>) { # is this a here document? - if ($line =~ m/<<\s*['"]?(\w+)['"]?\s*$/) { + if ($line =~ m/<<\s*['"]?(\w+)['"]?\s*/) { my $end = $1; print $ofh $line; - while(my $line=<$handle>) { + while($line=<$handle>) { print $ofh $line; last if $line =~ m/$end/; }