I've noticed/fixed a few occurrences of doubled words like "the the",
"to to", etc. in other packages, so wrote this to find more of them:

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

I would be inclined to prepare a patch if I thought it would
be applied (promptly?), but I submitted a clear/simple fix for
an obvious double-free bug (albeit only in a test case) a month ago:

        http://patchwork.ozlabs.org/patch/85973/
        avoid memory overrun in a test leading to potential double-free
        * testsuite/test-expandargv.c (writeout_test): Fix off-by-one error:
        i.e., do copy the trailing NUL byte.

AFAIK, it hasn't been applied.  If a "real" bug has such low priority,
this is not a good time to submit a clean-up change.

Running the above command on gcc's master produced the following output:
Note that if you add "i" to the regexp match option list, you'll get
at least one more legitimate match:

    gcc/fortran/gfortran.texi:970:The the

However, many of the mixed case matches are spurious.
(same for the "if if" matches in code)

-------------------------------------------------------------------
boehm-gc/configure.host:5:the the
boehm-gc/doc/README:123:to to
boehm-gc/misc.c:212:to to
boehm-gc/os_dep.c:4010:to to
config/tcl.m4:2417:the the
contrib/reghunt/bin/gcc-build-full:18:the the
contrib/reghunt/bin/gcc-build-simple:20:the the
contrib/reghunt/bin/gcc-svn-patchlist:19:the the
contrib/reghunt/bin/gcc-svn-update:18:the the
contrib/reghunt/bin/gcc-test-accepts-invalid:18:the the
contrib/reghunt/bin/gcc-test-bogus-warning:18:the the
contrib/reghunt/bin/gcc-test-compiler-hangs:18:the the
contrib/reghunt/bin/gcc-test-ice-on-invalid-code:18:the the
contrib/reghunt/bin/gcc-test-ice-on-valid-code:18:the the
contrib/reghunt/bin/gcc-test-missing-warning:18:the the
contrib/reghunt/bin/gcc-test-rejects-valid:18:the the
contrib/reghunt/bin/gcc-test-segfault-on-valid-code:19:the the
contrib/reghunt/bin/gcc-test-wrong-code:18:the the
contrib/reghunt/bin/reg-hunt:62:the the
contrib/reghunt/bin/reg-newmid:25:the the
contrib/reghunt/bin/reg-test:40:the the
gcc/ada/gcc-interface/trans.c:5411:to\n  to
gcc/ada/sem_prag.adb:1701:to to
gcc/c-family/c-ada-spec.c:3236:the the
gcc/c-typeck.c:8885:if if
gcc/cfganal.c:653:then then
gcc/cgraphunit.c:48:the the
gcc/config/arm/arm.c:9508:to to
gcc/config/arm/arm.c:9656:to to
gcc/config/arm/arm.c:23010:the the
gcc/config/arm/arm.md:100:the the
gcc/config/cris/cris.md:2512:the the
gcc/config/i386/i386.c:16252:the the
gcc/config/i386/i386.c:16286:the\n     the
gcc/config/i386/i386.c:21002:and and
gcc/config/i386/smmintrin.h:600:the the
gcc/config/mips/mips-protos.h:74:the\n       the
gcc/config/mips/mips.c:10800:to to
gcc/config/s390/s390.c:4015:and and
gcc/config/s390/s390.md:8827:and and
gcc/config/sh/sh.c:9108:the the
gcc/config/spu/spu.c:2669:to to
gcc/config/spu/spu.c:4373:and and
gcc/cp/decl.c:1091:then\n     then
gcc/cp/name-lookup.c:4149:the the
gcc/doc/invoke.texi:7711:the the
gcc/doc/tm.texi:96:the\nthe
gcc/doc/tm.texi:2334:the\nthe
gcc/doc/tm.texi.in:96:the\nthe
gcc/doc/tm.texi.in:2324:the\nthe
gcc/fortran/frontend-passes.c:888:the\n        the
gcc/fortran/gfortran.texi:813:and and
gcc/fortran/intrinsic.texi:2766:the the
gcc/fortran/intrinsic.texi:2808:the the
gcc/fortran/target-memory.c:498:the the
gcc/fortran/trans-decl.c:1700:the the
gcc/fortran/trans-decl.c:1783:the the
gcc/fortran/trans-expr.c:3602:to\n     to
gcc/fortran/trans-types.c:2228:the the
gcc/gengtype.c:1955:the the
gcc/genhooks.c:40:the the
gcc/gimple.c:2317:the the
gcc/go/gofrontend/backend.h:151:the the
gcc/go/gofrontend/gogo-tree.cc:2179:the the
gcc/haifa-sched.c:854:the\n     the
gcc/ipa-prop.c:1519:and and
gcc/ira-emit.c:232:the the
gcc/ira-int.h:808:the the
gcc/java/jcf-parse.c:1765:to to
gcc/lto-streamer.c:532:the the
gcc/lto/lto.c:189:the the
gcc/matrix-reorg.c:849:to to
gcc/objc/objc-next-runtime-abi-02.c:2162:the the
gcc/regs.h:47:or or
gcc/regstat.c:45:or or
gcc/sel-sched.c:2744:to to
gcc/targhooks.c:1193:the the
gcc/testsuite/ada/acats/tests/c4/c460011.a:40:the the
gcc/testsuite/ada/acats/tests/c9/c954013.a:366:the the
gcc/testsuite/gcc.c-torture/compile/20011106-2.c:1:the the
gcc/testsuite/gcc.c-torture/execute/980709-1.x:4:the the
gcc/testsuite/gcc.c-torture/execute/990826-0.x:4:the the
gcc/testsuite/gcc.dg/vect/vect-peel-1.c:17:the \n     the
gcc/testsuite/gcc.target/mips/inter/mips16_stubs_1_x.c:92:and and
gcc/testsuite/gfortran.dg/alloc_comp_assign_10.f90:34:if \n      if
gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90:124:if\n        if
gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90:133:if\n            if
gcc/testsuite/gfortran.dg/allocatable_scalar_4.f90:73:if\n    if
gcc/testsuite/gfortran.dg/any_all_2.f90:12:if\n\n  if
gcc/testsuite/gfortran.dg/append_1.f90:30:if\n        if
gcc/testsuite/gfortran.dg/auto_char_dummy_array_1.f90:43:if\n\n    if
gcc/testsuite/gfortran.dg/bind_c_dts_2.f03:34:if\n\n    if
gcc/testsuite/gfortran.dg/bind_c_dts_2.f03:39:if\n\n    if
gcc/testsuite/gfortran.dg/bind_c_dts_2.f03:43:if\n\n    if
gcc/testsuite/gfortran.dg/bind_c_dts_2.f03:47:if\n\n    if
gcc/testsuite/gfortran.dg/bind_c_dts_2.f03:51:if\n\n    if
gcc/testsuite/gfortran.dg/bind_c_dts_2.f03:55:if\n\n    if
gcc/testsuite/gfortran.dg/bound_2.f90:211:if\n\n    if
gcc/testsuite/gfortran.dg/bound_7.f90:215:if\n\n    if
gcc/testsuite/gfortran.dg/bounds_check_15.f90:30:if\n    if
gcc/testsuite/gfortran.dg/c_assoc_2.f03:13:if\n    \n    if
gcc/testsuite/gfortran.dg/c_assoc_2.f03:17:if\n\n    if
gcc/testsuite/gfortran.dg/c_assoc_2.f03:21:if\n\n    if
gcc/testsuite/gfortran.dg/c_assoc_2.f03:29:if\n\n    if
gcc/testsuite/gfortran.dg/c_loc_tests_2.f03:40:if\n    if
gcc/testsuite/gfortran.dg/c_loc_tests_2.f03:75:if\n    if
gcc/testsuite/gfortran.dg/default_format_1.inc:29:if\n\n    if
gcc/testsuite/gfortran.dg/default_format_1.inc:61:if\n\n    if
gcc/testsuite/gfortran.dg/default_format_2.inc:30:if\n\n    if
gcc/testsuite/gfortran.dg/dup_save_1.f90:9:if\n     if
gcc/testsuite/gfortran.dg/dup_save_1.f90:12:if\n     if
gcc/testsuite/gfortran.dg/dup_save_1.f90:15:if\n     if
gcc/testsuite/gfortran.dg/dup_save_2.f90:10:if\n     if
gcc/testsuite/gfortran.dg/dup_save_2.f90:13:if\n     if
gcc/testsuite/gfortran.dg/dup_save_2.f90:16:if\n     if
gcc/testsuite/gfortran.dg/ftell_3.f90:33:if\n  if
gcc/testsuite/gfortran.dg/func_result_1.f90:2:the the
gcc/testsuite/gfortran.dg/goto_2.f90:14:if\n    if
gcc/testsuite/gfortran.dg/graphite/run-id-1.f:41:if\n\n      if
gcc/testsuite/gfortran.dg/intrinsic_modulo_1.f90:30:if\n    if
gcc/testsuite/gfortran.dg/iso_c_binding_rename_1.f03:42:if\n    if
gcc/testsuite/gfortran.dg/iso_c_binding_rename_1.f03:55:if\n\n    if
gcc/testsuite/gfortran.dg/iso_c_binding_rename_1.f03:76:if\n    \n    if
gcc/testsuite/gfortran.dg/list_read_3.f90:21:if\n\n  if
gcc/testsuite/gfortran.dg/loc_2.f90:50:if\n     if
gcc/testsuite/gfortran.dg/loc_2.f90:54:if\n     if
gcc/testsuite/gfortran.dg/loc_2.f90:58:if\n     if
gcc/testsuite/gfortran.dg/loc_2.f90:70:if\n        if
gcc/testsuite/gfortran.dg/loc_2.f90:75:if\n        if
gcc/testsuite/gfortran.dg/loc_2.f90:80:if\n        if
gcc/testsuite/gfortran.dg/loc_2.f90:93:if\n           if
gcc/testsuite/gfortran.dg/loc_2.f90:98:if\n           if
gcc/testsuite/gfortran.dg/loc_2.f90:103:if\n           if
gcc/testsuite/gfortran.dg/matmul_6.f90:46:if\n        if
gcc/testsuite/gfortran.dg/missing_derived_type_1.f90:2:the the
gcc/testsuite/gfortran.dg/namelist_27.f90:55:if\n       if
gcc/testsuite/gfortran.dg/use_rename_1.f90:3:the the
gcc/testsuite/gfortran.dg/vect/fast-math-vect-8.f90:76:if\n    if
gcc/testsuite/gfortran.dg/whole_file_27.f90:165:if\n  if
gcc/testsuite/gfortran.fortran-torture/compile/emptyif.f90:9:if\n   \n   if
gcc/testsuite/gfortran.fortran-torture/compile/emptyif.f90:14:if\n\n   if
gcc/testsuite/gfortran.fortran-torture/compile/emptyif.f90:19:if\n\n   if
gcc/testsuite/gfortran.fortran-torture/compile/emptyif.f90:26:if\n\n   if
gcc/testsuite/gfortran.fortran-torture/compile/emptyif.f90:33:if\n\n   if
gcc/testsuite/gfortran.fortran-torture/execute/allocate.f90:18:if\n  if
gcc/testsuite/gfortran.fortran-torture/execute/emptyif.f90:17:if\n  if
gcc/testsuite/gfortran.fortran-torture/execute/forall_7.f90:79:if\n       if
gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90:68:if\nif
gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90:81:if\nif
gcc/testsuite/gfortran.fortran-torture/execute/save_2.f90:16:if\n       if
gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist-impl.h:679:the
 the
gcc/testsuite/objc/execute/next_mapping.h:752:the the
gcc/tree-loop-distribution.c:107:the the
gcc/tree-sra.c:2338:the\n   the
gcc/tree-ssa-alias.c:519:the the
gcc/tree-ssa-dom.c:337:the the
gcc/tree-ssa-pre.c:4683:then then
gcc/tree-vect-data-refs.c:1498:the\n                 the
gcc/tree-vrp.c:927:to to
gcc/tree-vrp.c:980:to to
gcc/tree-vrp.c:7092:the\n     the
gcc/tree.c:7606:the\n   the
libdecnumber/decCommon.c:391:the the
libffi/README:105:the the
libffi/src/dlmalloc.c:103:if if
libffi/src/dlmalloc.c:1616:the the
libffi/src/dlmalloc.c:3436:or\n       or
libgfortran/configure.host:4:the the
libgo/config/ltmain.sh:570:and and
libgo/go/go/printer/nodes.go:273:the the
libgo/go/math/remainder.go:7:the the
libgo/go/regexp/regexp.go:712:to to
libgo/go/runtime/extern.go:23:the the
libgo/go/tabwriter/tabwriter.go:582:the the
libgomp/testsuite/libgomp.fortran/allocatable6.f90:27:if\n    if
libgomp/testsuite/libgomp.fortran/omp_parse1.f90:177:if\n    if
libgomp/testsuite/libgomp.fortran/omp_parse2.f90:98:if\n    if
libiberty/regex.c:5434:the\n   the
libjava/classpath/external/w3c_dom/org/w3c/dom/Document.java:263:the the
libjava/classpath/external/w3c_dom/org/w3c/dom/bootstrap/DOMImplementationRegistry.java:89:the
 the
libjava/classpath/gnu/CORBA/CDR/AbstractCdrInput.java:1073:the the
libjava/classpath/gnu/CORBA/NamingService/Ext.java:59:the the
libjava/classpath/gnu/CORBA/NamingService/TransientContext.java:320:the the
libjava/classpath/gnu/java/awt/font/opentype/NameDecoder.java:324:and and
libjava/classpath/gnu/java/awt/java2d/AbstractGraphics2D.java:101:the the
libjava/classpath/gnu/java/awt/java2d/PixelCoverage.java:65:the the
libjava/classpath/gnu/java/awt/java2d/ScanlineCoverage.java:402:the the
libjava/classpath/gnu/javax/crypto/sasl/UserAlreadyExistsException.java:45:the 
the
libjava/classpath/gnu/javax/imageio/jpeg/JPEGImageInputStream.java:145:the the
libjava/classpath/gnu/javax/naming/giop/ListBindingsEnumeration.java:72:the the
libjava/classpath/gnu/javax/naming/giop/ListEnumeration.java:69:the the
libjava/classpath/gnu/javax/print/ipp/IppRequest.java:816:the the
libjava/classpath/gnu/javax/print/ipp/IppStatusCode.java:116:the the
libjava/classpath/gnu/javax/swing/text/html/parser/models/node.java:183:the the
libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java:233:the 
the
libjava/classpath/java/awt/font/ImageGraphicAttribute.java:146:the the
libjava/classpath/java/awt/geom/Area.java:836:the the
libjava/classpath/java/awt/geom/QuadCurve2D.java:323:the the
libjava/classpath/java/awt/image/IndexColorModel.java:53:the the
libjava/classpath/java/beans/PropertyDescriptor.java:285:the the
libjava/classpath/java/io/ByteArrayOutputStream.java:133:the the
libjava/classpath/java/io/CharArrayWriter.java:144:the the
libjava/classpath/java/lang/Boolean.java:148:the the
libjava/classpath/java/lang/Math.java:108:the the
libjava/classpath/java/lang/Math.java:127:the the
libjava/classpath/java/lang/StrictMath.java:114:the the
libjava/classpath/java/lang/StrictMath.java:132:the the
libjava/classpath/java/lang/reflect/Array.java:139:the the
libjava/classpath/java/math/BigInteger.java:2219:the the
libjava/classpath/java/math/BigInteger.java:2235:the the
libjava/classpath/java/net/URL.java:337:then then
libjava/classpath/java/net/URL.java:361:then then
libjava/classpath/java/net/URLClassLoader.java:406:the the
libjava/classpath/java/net/URLConnection.java:306:the the
libjava/classpath/java/nio/ByteBuffer.java:152:the the
libjava/classpath/java/nio/ByteBuffer.java:181:the the
libjava/classpath/java/nio/ByteBuffer.java:209:the the
libjava/classpath/java/nio/CharBuffer.java:188:the the
libjava/classpath/java/nio/CharBuffer.java:217:the the
libjava/classpath/java/nio/CharBuffer.java:245:the the
libjava/classpath/java/nio/DoubleBuffer.java:134:the the
libjava/classpath/java/nio/DoubleBuffer.java:163:the the
libjava/classpath/java/nio/DoubleBuffer.java:191:the the
libjava/classpath/java/nio/FloatBuffer.java:134:the the
libjava/classpath/java/nio/FloatBuffer.java:163:the the
libjava/classpath/java/nio/FloatBuffer.java:191:the the
libjava/classpath/java/nio/IntBuffer.java:135:the the
libjava/classpath/java/nio/IntBuffer.java:164:the the
libjava/classpath/java/nio/IntBuffer.java:192:the the
libjava/classpath/java/nio/LongBuffer.java:134:the the
libjava/classpath/java/nio/LongBuffer.java:163:the the
libjava/classpath/java/nio/LongBuffer.java:191:the the
libjava/classpath/java/nio/ShortBuffer.java:135:the the
libjava/classpath/java/nio/ShortBuffer.java:164:the the
libjava/classpath/java/nio/ShortBuffer.java:192:the the
libjava/classpath/java/security/AccessControlContext.java:49:the the
libjava/classpath/java/security/Signer.java:75:the the
libjava/classpath/java/util/TreeMap.java:2207:the the
libjava/classpath/java/util/TreeMap.java:2302:the the
libjava/classpath/java/util/TreeMap.java:2347:the the
libjava/classpath/java/util/TreeMap.java:2406:the the
libjava/classpath/java/util/TreeSet.java:463:the the
libjava/classpath/java/util/TreeSet.java:483:the the
libjava/classpath/java/util/logging/LogRecord.java:541:the the
libjava/classpath/java/util/logging/Logger.java:338:the the
libjava/classpath/java/util/logging/Logger.java:352:the the
libjava/classpath/javax/imageio/spi/ServiceRegistry.java:407:if if
libjava/classpath/javax/imageio/spi/ServiceRegistry.java:460:if if
libjava/classpath/javax/management/ObjectInstance.java:105:the the
libjava/classpath/javax/print/package.html:89:the the
libjava/classpath/javax/swing/ImageIcon.java:385:the the
libjava/classpath/javax/swing/ImageIcon.java:398:the the
libjava/classpath/javax/swing/JComponent.java:2456:the the
libjava/classpath/javax/swing/JFileChooser.java:646:the the
libjava/classpath/javax/swing/JTable.java:2843:the the
libjava/classpath/javax/swing/JTree.java:223:the the
libjava/classpath/javax/swing/JTree.java:1453:to to
libjava/classpath/javax/swing/SwingUtilities.java:1451:the the
libjava/classpath/javax/swing/border/SoftBevelBorder.java:105:if if
libjava/classpath/javax/swing/plaf/BorderUIResource.java:318:if if
libjava/classpath/javax/swing/plaf/ComponentUI.java:95:the the
libjava/classpath/javax/swing/plaf/basic/BasicBorders.java:805:the the
libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java:771:the the
libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java:571:the the
libjava/classpath/javax/swing/text/html/CSSParser.java:294:the the
libjava/classpath/javax/swing/text/html/HRuleView.java:116:the the
libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java:406:the the
libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java:420:the the
libjava/classpath/javax/swing/undo/CompoundEdit.java:56:the the
libjava/classpath/javax/swing/undo/CompoundEdit.java:151:the the
libjava/classpath/ltmain.sh:547:and and
libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:133:if
 if
libjava/classpath/org/ietf/jgss/GSSContext.java:418:the the
libjava/classpath/org/ietf/jgss/GSSContext.java:458:the the
libjava/classpath/org/ietf/jgss/GSSCredential.java:109:the the
libjava/classpath/org/omg/CORBA/ARG_INOUT.java:42:the the
libjava/classpath/org/omg/IOP/CodecOperations.java:119:the the
libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java:226:the
 the
libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.java:92:and
 and
libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.java:69:the
 the
libjava/classpath/org/omg/PortableServer/POAOperations.java:190:the the
libjava/classpath/org/omg/PortableServer/POAOperations.java:216:the the
libjava/classpath/org/omg/PortableServer/package.html:214:the the
libjava/classpath/scripts/check_jni_methods.sh.in:24:the the
libjava/classpath/tools/gnu/classpath/tools/NotifyingInputStreamReader.java:127:to
 to
libjava/configure.ac:670:if if
libjava/configure.host:4:the the
libjava/gnu/gcj/runtime/PersistentByteMap.java:23:the the
libjava/gnu/gcj/runtime/PersistentByteMap.java:438:the the
libjava/include/config.h.in:432:if if
libjava/include/jni_md.h:52:and and
libjava/java/lang/Math.java:100:the the
libjava/java/lang/Math.java:119:the the
libjava/java/lang/natObject.cc:507:the the
libjava/java/lang/reflect/Array.java:126:the the
libjava/java/util/logging/Logger.java:356:the the
libjava/java/util/logging/Logger.java:373:the the
libjava/jvmti.cc:1088:the the
libjava/testsuite/lib/libjava.exp:248:the the
libobjc/encoding.c:1154:the the
libstdc++-v3/configure.host:4:the the
libstdc++-v3/doc/html/ext/lwg-closed.html:2966:the the
libstdc++-v3/doc/html/ext/lwg-closed.html:7942:the the
libstdc++-v3/doc/html/ext/lwg-closed.html:10676:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:4763:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:12751:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:13413:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:19629:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:24715:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:41449:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:46044:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:70907:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:72274:the the
libstdc++-v3/doc/html/ext/lwg-defects.html:79177:the the
libstdc++-v3/doc/html/ext/pb_ds/introduction.html:113:the the
libstdc++-v3/doc/html/ext/pb_ds/motivation.html:668:the\n      the
libstdc++-v3/doc/html/ext/pb_ds/tree_order_statistics_timing_test.html:15:the 
the
libstdc++-v3/testsuite/data/thirty_years_among_the_dead_preproc.txt:2652:the\nthe
ltmain.sh:570:and and
zlib/contrib/asm586/README.586:8:the the
zlib/contrib/minizip/unzip.c:407:the the
zlib/contrib/minizip/zip.c:552:the the
zlib/contrib/minizip/zip.h:154:the the
zlib/contrib/minizip/zip.h:156:the the
zlib/contrib/puff/puff.c:20:to to
zlib/deflate.c:166:to to
zlib/deflate.c:179:to to
zlib/old/visual-basic.txt:118:the the

Reply via email to