You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2018/09/20 09:31:11 UTC
svn commit: r1841449 - /tomcat/jk/trunk/tools/lineends.pl
Author: rjung
Date: Thu Sep 20 09:31:11 2018
New Revision: 1841449
URL: http://svn.apache.org/viewvc?rev=1841449&view=rev
Log:
Tab police.
Modified:
tomcat/jk/trunk/tools/lineends.pl
Modified: tomcat/jk/trunk/tools/lineends.pl
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/tools/lineends.pl?rev=1841449&r1=1841448&r2=1841449&view=diff
==============================================================================
--- tomcat/jk/trunk/tools/lineends.pl (original)
+++ tomcat/jk/trunk/tools/lineends.pl Thu Sep 20 09:31:11 2018
@@ -93,8 +93,8 @@ OUTCH
}
else {
find(\&totxt, @ARGV[0]);
- print "scanned " . @ARGV[0] . "\n";
- $givenpaths = 1;
+ print "scanned " . @ARGV[0] . "\n";
+ $givenpaths = 1;
}
shift @ARGV;
}
@@ -106,49 +106,49 @@ if (!$givenpaths) {
sub totxt {
$oname = $_;
- $tname = '.#' . $_;
+ $tname = '.#' . $_;
if (!-f) {
return;
}
- @exts = split /\./;
- if ($forceending < 2) {
+ @exts = split /\./;
+ if ($forceending < 2) {
while ($#exts && ($ext = pop(@exts))) {
if ($ignore =~ m|-$ext-|i) {
return;
}
- }
+ }
}
- @ostat = stat($oname);
+ @ostat = stat($oname);
$srcfl = new IO::File $oname, "r" or die;
- $dstfl = new IO::File $tname, "w" or die;
+ $dstfl = new IO::File $tname, "w" or die;
binmode $srcfl;
- if ($notnative) {
+ if ($notnative) {
binmode $dstfl;
- }
- undef $t;
+ }
+ undef $t;
while (<$srcfl>) {
if (s/(\r*)\n$/\n/) {
- $n = length $1;
- if (!defined $t) {
- $t = $n;
- }
- if (!$forceending && (($n != $t) || m/\r/)) {
- print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n";
- undef $t;
- last;
- }
- elsif ($notnative > 0) {
+ $n = length $1;
+ if (!defined $t) {
+ $t = $n;
+ }
+ if (!$forceending && (($n != $t) || m/\r/)) {
+ print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n";
+ undef $t;
+ last;
+ }
+ elsif ($notnative > 0) {
s/\n$/\r\n/;
}
}
- print $dstfl $_;
- }
- if (defined $t && (tell $srcfl == tell $dstfl)) {
- undef $t;
- }
- undef $srcfl;
- undef $dstfl;
- if (defined $t) {
+ print $dstfl $_;
+ }
+ if (defined $t && (tell $srcfl == tell $dstfl)) {
+ undef $t;
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if (defined $t) {
unlink $oname or die;
rename $tname, $oname or die;
@anames = ($oname);
@@ -158,8 +158,8 @@ sub totxt {
chmod $ostat[2] & 07777, @anames;
chown $ostat[5], $ostat[6], @anames;
print "Converted file " . $oname . " to text in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname or die;
- }
+ }
+ else {
+ unlink $tname or die;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org