Commit MetaInfo

Revisionef8fef002016f22d0b174de13a38b7cb4ad15c77 (tree)
Zeit2019-12-12 04:30:08
AutorSHIRAKATA Kentaro <argrath@ub32...>
CommiterSHIRAKATA Kentaro

Log Message

untab

Ändern Zusammenfassung

Diff

--- a/1line/diff.pl
+++ b/1line/diff.pl
@@ -1,25 +1,23 @@
11 #! /usr/bin/perl -i.bak
22 while(<>){
3- if($_ eq "/*JP\n"){
4- my($s1, $s2, $s3);
5- $s1 = <>;
6- $s2 = <>;
7- $s3 = <>;
8- if($s2 eq "*/\n"){
9- print $s1;
10- open FF, ">>../../1line/$ARGV.txt";
11- print FF $s1;
12- print FF $s3;
13- close FF;
14- } else {
15- print "/*JP\n";
16- print $s1;
17- print $s2;
18- print $s3;
19- }
20- } else {
21- print $_;
22- }
3+ if($_ eq "/*JP\n"){
4+ my($s1, $s2, $s3);
5+ $s1 = <>;
6+ $s2 = <>;
7+ $s3 = <>;
8+ if($s2 eq "*/\n"){
9+ print $s1;
10+ open FF, ">>../../1line/$ARGV.txt";
11+ print FF $s1;
12+ print FF $s3;
13+ close FF;
14+ } else {
15+ print "/*JP\n";
16+ print $s1;
17+ print $s2;
18+ print $s3;
19+ }
20+ } else {
21+ print $_;
22+ }
2323 }
24-
25-
--- a/1line/patch.pl
+++ b/1line/patch.pl
@@ -5,40 +5,40 @@ my (@file) = <>;
55 my (@file2) = @file;
66 close F;
77 for($i = 0; $i < $#file; $i++){
8-$file2[$i] =~ s/^[\t ]+//;
8+ $file2[$i] =~ s/^[\t ]+//;
99 }
1010 open FI, "<../../1line/$ARGV.txt";
1111 while(!eof(FI)){
12- my ($i);
13- my ($in, $in2, $out);
14- my ($f) = 0;
15- $in = <FI>;
16- $out = <FI>;
17- $in2 = $in;
18- $in2 =~ s/^[\t ]+//;
19- for($i = 0; $i < $#file; $i++){
20- if($file[$i] eq "#if 0 /*JP*/\n"){
21- $f = 1;
22- next;
23- }
24- if($file[$i] =~ /endif/){
25- $f = 0;
26- next;
27- }
12+ my ($i);
13+ my ($in, $in2, $out);
14+ my ($f) = 0;
15+ $in = <FI>;
16+ $out = <FI>;
17+ $in2 = $in;
18+ $in2 =~ s/^[\t ]+//;
19+ for($i = 0; $i < $#file; $i++){
20+ if($file[$i] eq "#if 0 /*JP*/\n"){
21+ $f = 1;
22+ next;
23+ }
24+ if($file[$i] =~ /endif/){
25+ $f = 0;
26+ next;
27+ }
2828
29- if($f == 1){
30- next;
31- }
29+ if($f == 1){
30+ next;
31+ }
3232
33- if($in2 eq $file2[$i]){
34- $file[$i] = "/*JP\n$in*/\n$out";
35- $file2[$i] = '';
36- last;
37- }
38- }
39- if($i == $#file){
40- print "$ARGV:\n" . $in . $out;
41- }
33+ if($in2 eq $file2[$i]){
34+ $file[$i] = "/*JP\n$in*/\n$out";
35+ $file2[$i] = '';
36+ last;
37+ }
38+ }
39+ if($i == $#file){
40+ print "$ARGV:\n" . $in . $out;
41+ }
4242 }
4343 close FI;
4444 open FO, ">$ARGV.new";
Show on old repository browser