The following commit has been merged in the master branch:
commit c9853061090eff5b353cf503992ae1bc17d70700
Author: Raphael Geissert <[email protected]>
Date:   Wed Dec 30 17:57:41 2009 -0600

    Uppercase the spelling correction if the original word is ^[A-Z]+$
    
    * lib/Spelling.pm:
      + [RG] Uppercase every character of the correction if every
        character of the original word is too.

diff --git a/debian/changelog b/debian/changelog
index de446c7..144e0f2 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,6 +48,8 @@ lintian (2.3.1) UNRELEASED; urgency=low
   * lib/Spelling.pm:
     + [ADB] Add corrections for "nam" (name) and "nams" (names).
     + [RG] Add some more spelling errors.
+    + [RG] Uppercase every character of the correction if every
+      character of the original word is too.
 
   * man/lintian.1:
     + [RG] Document deprecation of unpack levels.
diff --git a/lib/Spelling.pm b/lib/Spelling.pm
index 260df94..f8db712 100644
--- a/lib/Spelling.pm
+++ b/lib/Spelling.pm
@@ -631,7 +631,9 @@ sub spelling_check {
         if (exists $CORRECTIONS{$lcword}) {
             $counter++;
             my $correction = $CORRECTIONS{$lcword};
-            if ($word =~ /^[A-Z]/) {
+            if ($word =~ /^[A-Z]+$/) {
+               $correction = uc $correction;
+           } elsif ($word =~ /^[A-Z]/) {
                 $correction = ucfirst $correction;
             }
             _tag($tag, $filename, $word, $correction) if defined $tag;
@@ -643,7 +645,9 @@ sub spelling_check {
        if ($text =~ m,\b($regex)\b,) {
            my $word = $1;
            my $correction = $MULTIWORD_CORRECTIONS{$regex};
-           if ($word =~ /^[A-Z]/) {
+           if ($word =~ /^[A-Z]+$/) {
+               $correction = uc $correction;
+           } elsif ($word =~ /^[A-Z]/) {
                $correction = ucfirst $correction;
            }
            $counter++;
diff --git a/t/tests/debian-readme-general/tags 
b/t/tests/debian-readme-general/tags
index e37c7b6..69f1d95 100644
--- a/t/tests/debian-readme-general/tags
+++ b/t/tests/debian-readme-general/tags
@@ -1,4 +1,4 @@
 W: debian-readme-general: readme-debian-contains-debmake-default-email-address
 W: debian-readme-general: readme-debian-mentions-usr-doc line 4
-W: debian-readme-general: spelling-error-in-readme-debian CHNAGES Changes
+W: debian-readme-general: spelling-error-in-readme-debian CHNAGES CHANGES
 W: debian-readme-general: spelling-error-in-readme-debian accidentaly 
accidentally

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to