[Ttssh2-commit] [3430] ActivePerl で動作するように改修した。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 5月 31日 (日) 22:59:54 JST


Revision: 3430
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3430
Author:   yutakapon
Date:     2009-05-31 22:59:54 +0900 (Sun, 31 May 2009)

Log Message:
-----------
ActivePerl で動作するように改修した。

Modified Paths:
--------------
    trunk/installer/check_sjis_code.pl


-------------- next part --------------
Modified: trunk/installer/check_sjis_code.pl
===================================================================
--- trunk/installer/check_sjis_code.pl	2009-05-30 15:33:27 UTC (rev 3429)
+++ trunk/installer/check_sjis_code.pl	2009-05-31 13:59:54 UTC (rev 3430)
@@ -3,17 +3,43 @@
 #
 # ‰pŒê”ŃhƒLƒ…ƒƒ“ƒg‚É“ú–{Œê‚ªŠÜ‚Ü‚ê‚Ä‚¢‚È‚¢‚©‚𒲂ׂéB
 #
-# Usage(on Cygwin):
-#  perl ./check_sjis_code.pl ../doc/en/*/*/*.html > result.txt
+# Usage(ActivePerl):
+#  perl check_sjis_code.pl > result.txt
 #
 
-for ($i = 0 ; $i < @ARGV ; $i++) {
-#	print "$ARGV[$i]\n";
-	check_sjis_code($ARGV[$i]);
-}
+get_file_paths('../doc/en/html');
 exit(0);
 
+sub get_file_paths {
+	my ($top_dir)= @_;
+	my @paths=();
+	my @temp = ();
+
+	#-- ƒJƒŒƒ“ƒg‚̈ꗗ‚ðŽæ“¾ --#
+	opendir(DIR, $top_dir);
+	@temp = readdir(DIR);
+	closedir(DIR);
+	foreach my $path (sort @temp) {
+		next if( $path =~ /^\.{1,2}$/ );                # '.' ‚Æ '..' ‚̓XƒLƒbƒv
+		next if( $path =~ /^\.svn$/ );                # '.svn' ‚̓XƒLƒbƒv
+		
+		my $full_path = "$top_dir" . '/' . "$path";
+		next if (-B $full_path);     # ƒoƒCƒiƒŠƒtƒ@ƒCƒ‹‚̓XƒLƒbƒv
+		
+#		print "$full_path\r\n";                     # •\Ž¦‚¾‚¯‚È‚ç‘S‚Ä‚ð•\Ž¦‚µ‚Ä‚­‚ê‚é-------
+		push(@paths, $full_path);                       # ƒf[ƒ^‚Æ‚µ‚ÄŽæ‚荞‚ñ‚Å‚à‘O‚ÌŽæ‚荞‚Ý‚ª‰Šú‰»‚³‚ê‚é
+		if( -d "$top_dir/$path" ){                      #-- ƒfƒBƒŒƒNƒgƒŠ‚̏ꍇ‚ÍŽ©•ªŽ©g‚ðŒÄ‚яo‚·
+			&get_file_paths("$full_path");
+			
+		} else {
+			check_sjis_code($full_path);
+		
+		}
+	}
+	return \@paths;
+}
 
+
 # cf. http://charset.7jp.net/sjis.html
 # ShiftJIS •¶Žš
 



Ttssh2-commit メーリングリストの案内
Back to archive index