Skip to content

Commit 5e55b6b

Browse files
authored
fix: obfus - here doc (#15)
here doc is not parsed correctly. Also, keep spaces.
1 parent 52897c8 commit 5e55b6b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.bin/obfus

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ sub obfuscate {
161161
# - open quotes (single or double)
162162
# - here documents
163163
if ($flatten) {
164-
if ($line =~ m/<<\s*['"]?(\w+)['"]?\s*$/) {
164+
if ($line =~ m/<<\s*['"]?(\w+)['"]?\s*/) {
165165
my $end = $1;
166166
print $ofh $line;
167167
while(my $line=<$ifh>) {
@@ -308,10 +308,10 @@ sub newline_process {
308308
open $handle, '<', \$data;
309309
while(my $line=<$handle>) {
310310
# is this a here document?
311-
if ($line =~ m/<<\s*['"]?(\w+)['"]?\s*$/) {
311+
if ($line =~ m/<<\s*['"]?(\w+)['"]?\s*/) {
312312
my $end = $1;
313313
print $ofh $line;
314-
while(my $line=<$handle>) {
314+
while($line=<$handle>) {
315315
print $ofh $line;
316316
last if $line =~ m/$end/;
317317
}

0 commit comments

Comments
 (0)