summaryrefslogtreecommitdiff
path: root/lib/sbin
diff options
context:
space:
mode:
authorknarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac>2009-01-26 20:11:51 +0000
committerknarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac>2009-01-26 20:11:51 +0000
commit30d9f3301a868fdb0e1b9ad1b5e1608d4fe8c043 (patch)
treec43cc21a420d191bd1f082f73c5c5302ffbacbd0 /lib/sbin
parent21d8822569e95ed10d71ab50190b7f60301b5662 (diff)
fix multiline perl
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4518 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin')
-rw-r--r--lib/sbin/c_file_processor.pl1
-rw-r--r--lib/sbin/f_file_processor.pl32
2 files changed, 16 insertions, 17 deletions
diff --git a/lib/sbin/c_file_processor.pl b/lib/sbin/c_file_processor.pl
index a9e05804..b71f2e53 100644
--- a/lib/sbin/c_file_processor.pl
+++ b/lib/sbin/c_file_processor.pl
@@ -34,6 +34,7 @@ $do_fix_fnames = 0;
# parse the file up to a ";\n"
$/ = ";\n";
+#$* = 1; enable multiline support -- no longer supported in perl 5.10
while (<>)
{
diff --git a/lib/sbin/f_file_processor.pl b/lib/sbin/f_file_processor.pl
index 0a44ac3b..f65082a0 100644
--- a/lib/sbin/f_file_processor.pl
+++ b/lib/sbin/f_file_processor.pl
@@ -27,8 +27,6 @@
# Reads input from stdin.
# The result will be printed to stdout.
-$MULTILINE_MATCHING = 1; # Multi-line is on!
-
# Do we want line directives?
$line_directives = $line_directives eq 'yes';
@@ -206,14 +204,14 @@ sub fixed_format_splitline
my ($LINE) = @_;
# Note the new treatement of comments with \S
- if ($LINE =~ /^([^\S].{71,71})/)
+ if ($LINE =~ /^([^\S].{71,71})/m)
{
&printline ($1);
- $LINE =~ s/.{72,72}//;
- while ($LINE =~ /^(.{66,66})/)
+ $LINE =~ s/.{72,72}//m;
+ while ($LINE =~ /^(.{66,66})/m)
{
&printline (" &$1");
- $LINE =~ s/.{66,66}//;
+ $LINE =~ s/.{66,66}//m;
}
&printline (" &$LINE");
}
@@ -240,36 +238,36 @@ sub free_format_splitline
my $maxlen1i = $max_line_length - $indentation - 1;
my $maxlen2i = $max_line_length - $indentation - 2;
- if ($LINE =~ /^(.{$maxlen1,$maxlen1})../)
+ if ($LINE =~ /^(.{$maxlen1,$maxlen1})../m)
{
$OUT = $1;
# Check if the line already has a continuation mark.
- $OUT = "$OUT&" if (! ($OUT =~ /\&\s*$/));
+ $OUT = "$OUT&" if (! ($OUT =~ /\&\s*$/m));
&printline ($OUT);
- $LINE =~ s/.{$maxlen1,$maxlen1}//;
+ $LINE =~ s/.{$maxlen1,$maxlen1}//m;
- while ($LINE =~ /^(.{$maxlen1i,$maxlen1i})/)
+ while ($LINE =~ /^(.{$maxlen1i,$maxlen1i})/m)
{
- $LINE =~ /^(.{$maxlen2i,$maxlen2i})/;
+ $LINE =~ /^(.{$maxlen2i,$maxlen2i})/m;
$OUT = $1;
- $OUT = "$indent&$OUT" if (! ($OUT =~ /^\s*\&/));
- $OUT = "$OUT&" if (! ($OUT =~ /\&\s*$/));
+ $OUT = "$indent&$OUT" if (! ($OUT =~ /^\s*\&/m));
+ $OUT = "$OUT&" if (! ($OUT =~ /\&\s*$/m));
&printline ($OUT);
- $LINE =~ s/.{$maxlen2i,$maxlen2i}//;
+ $LINE =~ s/.{$maxlen2i,$maxlen2i}//m;
}
- if ($LINE =~ /^\&\s*$/)
+ if ($LINE =~ /^\&\s*$/m)
{
&printline ("$indent& $LINE");
}
- elsif ($LINE =~ /^\s*\&\s*$/)
+ elsif ($LINE =~ /^\s*\&\s*$/m)
{
&printline ("$indent&$LINE");
}
else
{
$OUT = $LINE;
- $OUT = "$indent&$OUT" if (! ($LINE =~ /^\s*\&/));
+ $OUT = "$indent&$OUT" if (! ($LINE =~ /^\s*\&/m));
&printline ($OUT);
}
}