projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d154e4
)
masonize fix: avoid newline prepend fix from borking indented first <%, fixes custome...
author
ivan
<ivan>
Fri, 18 Jun 2004 10:28:11 +0000
(10:28 +0000)
committer
ivan
<ivan>
Fri, 18 Jun 2004 10:28:11 +0000
(10:28 +0000)
bin/masonize
patch
|
blob
|
history
httemplate/search/cust_main-otaker.cgi
patch
|
blob
|
history
diff --git
a/bin/masonize
b/bin/masonize
index
3139e0a
..
169ba71
100755
(executable)
--- a/
bin/masonize
+++ b/
bin/masonize
@@
-6,34
+6,38
@@
foreach $file ( split(/\n/, `find . -depth -print`) ) {
@file = <F>;
#print "$file ". scalar(@file). "\n";
close $file;
@file = <F>;
#print "$file ". scalar(@file). "\n";
close $file;
- system("chmod u+w $file");
- open(W,">$file") or die "can't open $file for writing: $!";
- select W; $| = 1; select STDOUT;
$newline = ''; #avoid prepending extraneous newlines
$all = join('',@file);
$newline = ''; #avoid prepending extraneous newlines
$all = join('',@file);
+ $w = '';
+
$mode = 'html';
while ( length($all) ) {
if ( $mode eq 'html' ) {
if ( $all =~ /^(.+?)(<%=?.*)$/s && $1 !~ /<%/s ) {
$mode = 'html';
while ( length($all) ) {
if ( $mode eq 'html' ) {
if ( $all =~ /^(.+?)(<%=?.*)$/s && $1 !~ /<%/s ) {
-
print W
$1;
+
$w .=
$1;
$all = $2;
next;
} elsif ( $all =~ /^<%=(.*)$/s ) {
$all = $2;
next;
} elsif ( $all =~ /^<%=(.*)$/s ) {
-
print W
'<%';
+
$w .=
'<%';
$all = $1;
$mode = 'perlv';
#die;
next;
} elsif ( $all =~ /^<%(.*)$/s ) {
$all = $1;
$mode = 'perlv';
#die;
next;
} elsif ( $all =~ /^<%(.*)$/s ) {
-
print W
$newline; $newline = "\n";
+
$w .=
$newline; $newline = "\n";
$all = $1;
$mode = 'perlc';
$all = $1;
$mode = 'perlc';
+
+ #avoid newline prepend fix from borking indented first <%
+ $w =~ s/\n\s+\z/\n/;
+ $w .= "\n" if $w =~ /.+\z/;
+
next;
} elsif ( $all !~ /<%/s ) {
next;
} elsif ( $all !~ /<%/s ) {
-
print W
$all;
+
$w .=
$all;
last;
} else {
warn length($all); die;
last;
} else {
warn length($all); die;
@@
-43,7
+47,7
@@
foreach $file ( split(/\n/, `find . -depth -print`) ) {
} elsif ( $mode eq 'perlv' ) {
if ( $all =~ /^(.*?%>)(.*)$/s ) {
} elsif ( $mode eq 'perlv' ) {
if ( $all =~ /^(.*?%>)(.*)$/s ) {
-
print W
$1;
+
$w .=
$1;
$all=$2;
$mode = 'html';
next;
$all=$2;
$mode = 'html';
next;
@@
-53,13
+57,13
@@
foreach $file ( split(/\n/, `find . -depth -print`) ) {
} elsif ( $mode eq 'perlc' ) {
if ( $all =~ /^([^\n]*?)%>(.*)$/s ) {
} elsif ( $mode eq 'perlc' ) {
if ( $all =~ /^([^\n]*?)%>(.*)$/s ) {
-
print W
"%$1\n";
+
$w .=
"%$1\n";
$all=$2;
$mode='html';
next;
}
if ( $all =~ /^([^\n]*)\n(.*)$/s ) {
$all=$2;
$mode='html';
next;
}
if ( $all =~ /^([^\n]*)\n(.*)$/s ) {
-
print W
"%$1\n";
+
$w .=
"%$1\n";
$all=$2;
next;
}
$all=$2;
next;
}
@@
-68,5
+72,9
@@
foreach $file ( split(/\n/, `find . -depth -print`) ) {
}
}
+ system("chmod u+w $file");
+ select W; $| = 1; select STDOUT;
+ open(W,">$file") or die "can't open $file for writing: $!";
+ print W $w;
close W;
}
close W;
}
diff --git
a/httemplate/search/cust_main-otaker.cgi
b/httemplate/search/cust_main-otaker.cgi
index
68569f0
..
4421436
100755
(executable)
--- a/
httemplate/search/cust_main-otaker.cgi
+++ b/
httemplate/search/cust_main-otaker.cgi
@@
-10,10
+10,9
@@
<FORM ACTION="cust_main.cgi" METHOD="post">
Search for <B>Order taker</B>:
<INPUT TYPE="hidden" NAME="otaker_on" VALUE="TRUE">
<FORM ACTION="cust_main.cgi" METHOD="post">
Search for <B>Order taker</B>:
<INPUT TYPE="hidden" NAME="otaker_on" VALUE="TRUE">
- <% my $dbh = dbh;
- my $sth = $dbh->prepare("SELECT DISTINCT otaker FROM cust_main")
- or eidiot $dbh->errstr;
- $sth->execute() or eidiot $sth->errstr;
+ <% my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_main")
+ or die dbh->errstr;
+ $sth->execute() or die $sth->errstr;
# my @otakers = map { $_->[0] } @{$sth->selectall_arrayref};
%>
<SELECT NAME="otaker">
# my @otakers = map { $_->[0] } @{$sth->selectall_arrayref};
%>
<SELECT NAME="otaker">