Skip to content

Commit

Permalink
fix: obfus - here doc (#15)
Browse files Browse the repository at this point in the history
here doc is not parsed correctly. Also, keep spaces.
  • Loading branch information
fentas authored Mar 29, 2024
1 parent 52897c8 commit 5e55b6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .bin/obfus
Original file line number Diff line number Diff line change
Expand Up @@ -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>) {
Expand Down Expand Up @@ -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/;
}
Expand Down

0 comments on commit 5e55b6b

Please sign in to comment.