bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] maint: change "can not" to "cannot"


From: Jim Meyering
Subject: Re: [PATCH] maint: change "can not" to "cannot"
Date: Sun, 10 Apr 2011 10:00:23 +0200

Paul Eggert wrote:
> Thanks.  I pushed another one too, which I caught with:
>
>    word1=$1
>    word2=$2
>    shift
>    shift
>
>    export LC_ALL=C
>    gawk '
>      BEGIN { IGNORECASE = 1 }
>      /^[[:space:]]*'"$word2"'([^[:alnum:]_]|$)/ {
>        if (NR == nr1 + 1 && FILENAME == filename1)
>          print FILENAME ":" NR ":" $0
>      }
>      /(^|[^[:alnum:]_])'"$word1"'[[:space:]]*$/ {
>        nr1 = NR
>        filename1 = FILENAME
>      }
>    ' $(find ${*-*} -type f -print | sort)
>
> Dunno if you want to put that kind of gorp into the Make rule,
> though.  :-)
>
> Here's what I pushed:
>
> maint: change "can not" to "cannot"
> * doc/posix-functions/iconv.texi (iconv): This one crossed line
> boundaries.

Thanks!

Here's perl-based gorp that's uncovered a few more.
The tricky part was to get the line numbers while in perl's
slurp-entire-file mode (-0777).

git ls-files|xargs perl -0777 -n \
  -e 'while (/\b(a|then?|if|but|or|and|to)\s+\1\b/gms)' \
  -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/; print "$ARGV:$n:$v\n"}'

That caught several new ones in coreutils, grep and gzip.
I'll definitely add a rule for this.

>From f9e83fd48cb5c5a0b5a65751710138d42c814402 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 10 Apr 2011 09:56:02 +0200
Subject: [PATCH] maint: remove doubled words in comments, e.g., s/a a/a/

* lib/strptime.c (day_of_the_week): s/the the/the/
* tests/test-chown.h (test_chown): s/a a/a/
---
 ChangeLog          |    4 ++++
 lib/strptime.c     |    2 +-
 tests/test-chown.h |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c1eede5..9bf2029 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-04-10  Jim Meyering  <address@hidden>

+       maint: remove doubled words in comments, e.g., s/a a/a/
+       * lib/strptime.c (day_of_the_week): s/the the/the/
+       * tests/test-chown.h (test_chown): s/a a/a/
+
        test-chown.h: correct a cast
        * tests/test-chown.h (test_chown): Cast -1 to gid_t (not uid_t)
        when the destination is a stat.st_gid.
diff --git a/lib/strptime.c b/lib/strptime.c
index 9e4394b..6cf44bc 100644
--- a/lib/strptime.c
+++ b/lib/strptime.c
@@ -200,7 +200,7 @@ static void
 day_of_the_week (struct tm *tm)
 {
   /* We know that January 1st 1970 was a Thursday (= 4).  Compute the
-     the difference between this data in the one on TM and so determine
+     difference between this data in the one on TM and so determine
      the weekday.  */
   int corr_year = 1900 + tm->tm_year - (tm->tm_mon < 2);
   int wday = (-473
diff --git a/tests/test-chown.h b/tests/test-chown.h
index c99ffc1..85cbb5a 100644
--- a/tests/test-chown.h
+++ b/tests/test-chown.h
@@ -38,7 +38,7 @@ test_chown (int (*func) (char const *, uid_t, gid_t), bool 
print)
   int result;

   /* Solaris 8 is interesting - if the current process belongs to
-     multiple groups, the current directory is owned by a a group that
+     multiple groups, the current directory is owned by a group that
      the current process belongs to but different than getegid(), and
      the current directory does not have the S_ISGID bit, then regular
      files created in the directory belong to the directory's group,
--
1.7.5.rc1.228.g86d60b



reply via email to

[Prev in Thread] Current Thread [Next in Thread]