3 # C comment spell checker
4 # For each given source file, print the filename, a colon, and the number
5 # of misspelled words, then a list of misspelled words.
6 # Words contained in the file stopwords.txt are not considered spelling errors.
7 # Copyright 2003, Dan Kegel. Licensed under GPL. See the file ../COPYING for details.
12 print POUT "$content\n";
15 $TEMPFILE="/tmp/spell.tmp";
16 $STOPFILE=shift(@ARGV);
18 open(STOPFILE, $STOPFILE) || die "can't open stopword file $STOPFILE";
25 foreach $file (@ARGV) {
26 open (FI, $file) || die $file;
27 $content = join ("", <FI>);
30 open(POUT, "> $TEMPFILE") || die;
31 $content =~ s!//(.+)$!check_content($1)!egm;
32 $content =~ s!/\*(.+?)\*/!check_content($1)!egs;
35 open(PIN, "ispell -d american -l < $TEMPFILE | sort -uf |") || die;
39 if ($stopped{$_} == 0) {
46 print "$file: ".scalar(@badwords)."\n\n";
47 print join(" ",@badwords)."\n\n";