diff options
author | Jim Meyering <jim@meyering.net> | 2007-01-11 14:49:19 +0100 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-01-11 14:49:19 +0100 |
commit | 48545b57560932ceb661306d8b961fc625415cf5 (patch) | |
tree | 2e55c92d2e3166cd819ed104a48b94dfd22ca9f0 | |
parent | c8e51ae68abb0c9b281153ce64a83edd8bb7bdc8 (diff) | |
parent | dad7d86d57d2a6351ba1a395109760dce8977a91 (diff) | |
download | coreutils-48545b57560932ceb661306d8b961fc625415cf5.tar.xz |
trivial merge
-rw-r--r-- | ChangeLog | 42 | ||||
-rw-r--r-- | Makefile.maint | 9 | ||||
-rw-r--r-- | gl/lib/base64.c | 2 | ||||
-rw-r--r-- | src/Makefile.am | 9 | ||||
-rw-r--r-- | src/dircolors.hin | 1 | ||||
-rw-r--r-- | src/fmt.c | 11 | ||||
-rwxr-xr-x | src/groups.sh | 4 | ||||
-rwxr-xr-x | tests/fmt/basic | 30 | ||||
-rw-r--r-- | tests/sample-test | 2 |
9 files changed, 83 insertions, 27 deletions
@@ -1,8 +1,50 @@ +2007-01-07 Jim Meyering <jim@meyering.net> + + * tests/sample-test: Update copyright date to 2007. + * Makefile.maint (copyright-check): Also check the copyright date + in tests/sample-test. + +2007-01-06 Jim Meyering <jim@meyering.net> + + * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests, + based on examples from G.P. Halkes in + <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>. + +2007-01-06 G.P. Halkes <buscom@ghalkes.nl> + + * src/fmt.c (copy_rest): Correct prefix handling. + Don't elide a line with the prefix followed by only white space. + (get_line): Move EOF-check to loop-termination condition. + * tests/fmt/basic (pfx-1): Adjust test to expect desired result. + (pfx-2): Remove test; its premise was contrary to the documentation. + +2007-01-05 Jim Meyering <jim@meyering.net> + + Avoid a used-uninitialized bug for invalid input, i.e., when the size + of the input, not counting newlines, is 1 % 4. + * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4. + It may be smaller when flushing. + +2007-01-05 Mike Frysinger <vapier@gentoo.org> + + * src/dircolors.hin: Add a TERM directive for cons25. + 2007-01-04 Jim Meyering <jim@meyering.net> * Makefile.cfg (local-checks-to-skip): Skip strftime-check, in case you don't have convenient access to glibc info documentation. + Use the release year, not the current year. + * src/groups.sh (version): Use a better name: @RELEASE_YEAR@. + * src/Makefile.am (RELEASE_YEAR): Define it. + (.sh): Use it. + Thanks to a prod from Eric Blake. + + Ensure that "group --version" always prints the current year. + * src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006. + * src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@. + Suggestion from Eric Blake. + When decoding, always allow newlines in input, with almost no performance impact. * src/base64.c (do_decode): Initialize decode context. diff --git a/Makefile.maint b/Makefile.maint index c33d9d235..9baafa3d8 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -2,7 +2,7 @@ # This Makefile fragment is shared between the coreutils, # CPPI, Bison, and Autoconf. -## Copyright (C) 2001-2006 Free Software Foundation, Inc. +## Copyright (C) 2001-2007 Free Software Foundation, Inc. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -449,6 +449,7 @@ writable-files: test "$$fail" && exit 1 || : v_etc_file = lib/version-etc.c +sample-test = tests/sample-test # Make sure that the copyright date in $(v_etc_file) is up to date. copyright-check: @if test -f $(v_etc_file); then \ @@ -457,6 +458,12 @@ copyright-check: || { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \ exit 1; }; \ fi + @if test -f $(sample-test); then \ + grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test) \ + >/dev/null \ + || { echo 'out of date copyright in $(sample-test); update it' 1>&2; \ + exit 1; }; \ + fi # Sanity checks with the repository. diff --git a/gl/lib/base64.c b/gl/lib/base64.c index ba7322a26..a438d0fd1 100644 --- a/gl/lib/base64.c +++ b/gl/lib/base64.c @@ -506,7 +506,7 @@ base64_decode (struct base64_decode_context *ctx, inlen = 0; break; } - if (!decode_4 (non_nl, 4, &out, &outleft)) + if (!decode_4 (non_nl, inlen, &out, &outleft)) break; inlen = in_end - in; diff --git a/src/Makefile.am b/src/Makefile.am index 8c39ee02f..7aa504b36 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to produce Makefile.in -*-Makefile-*- -## Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -## 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +## Copyright (C) 1990, 1991, 1993-2007 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -116,10 +115,16 @@ $(PROGRAMS): ../lib/libcoreutils.a SUFFIXES = .sh +# Get the release year from ../lib/version-etc.c. +RELEASE_YEAR = \ + `sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \ + $(top_srcdir)/lib/version-etc.c` + .sh: rm -f $@ $@-t sed \ -e 's!@''bindir''@!$(bindir)!' \ + -e 's/@''RELEASE_YEAR'@/$(RELEASE_YEAR)/ \ -e 's/@''GNU_PACKAGE''@/$(GNU_PACKAGE)/' \ -e 's/@''PACKAGE_BUGREPORT''@/$(PACKAGE_BUGREPORT)/' \ -e 's/@''VERSION''@/$(VERSION)/' $< > $@-t diff --git a/src/dircolors.hin b/src/dircolors.hin index c13bd4ab9..8d550d194 100644 --- a/src/dircolors.hin +++ b/src/dircolors.hin @@ -23,6 +23,7 @@ TERM con80x30 TERM con80x43 TERM con80x50 TERM con80x60 +TERM cons25 TERM console TERM cygwin TERM dtterm @@ -607,12 +607,15 @@ copy_rest (FILE *f, int c) const char *s; out_column = 0; - if (in_column > next_prefix_indent && c != '\n' && c != EOF) + if (in_column > next_prefix_indent || (c != '\n' && c != EOF)) { put_space (next_prefix_indent); for (s = prefix; out_column != in_column && *s; out_column++) putchar (*s++); - put_space (in_column - out_column); + if (c != EOF && c != '\n') + put_space (in_column - out_column); + if (c == EOF && in_column >= next_prefix_indent + prefix_length) + putchar ('\n'); } while (c != '\n' && c != EOF) { @@ -688,10 +691,8 @@ get_line (FILE *f, int c) flush_paragraph (); } word_limit++; - if (c == EOF) - return EOF; } - while (c != '\n'); + while (c != '\n' && c != EOF); return get_prefix (f); } diff --git a/src/groups.sh b/src/groups.sh index 86343fcfc..dd32c63c5 100755 --- a/src/groups.sh +++ b/src/groups.sh @@ -1,6 +1,6 @@ #!/bin/sh # groups -- print the groups a user is in -# Copyright (C) 1991, 1997, 2000, 2002, 2004, 2006 Free Software Foundation, Inc. +# Copyright (C) 1991, 1997, 2000, 2002, 2004-2007 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ Same as id -Gn. If no USERNAME, use current process. Report bugs to <@PACKAGE_BUGREPORT@>." version='groups (@GNU_PACKAGE@) @VERSION@ -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) @RELEASE_YEAR@ Free Software Foundation, Inc. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. diff --git a/tests/fmt/basic b/tests/fmt/basic index 77682f103..66abe1305 100755 --- a/tests/fmt/basic +++ b/tests/fmt/basic @@ -2,7 +2,7 @@ # -*- perl -*- # Basic tests for "fmt". -# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -60,23 +60,23 @@ my @Tests = . " is the first\noption; use -w N instead\n" . "Try `fmt --help' for more information.\n" }, {EXIT => 1}], - # With --prefix=P, Do not remove leading on lines without the prefix. + # With --prefix=P, do not remove leading space on lines without the prefix. ['pfx-1', qw (-p '>'), {IN=> " 1\n 2\n\t3\n\t\t4\n> quoted\n> text\n"}, - # This is the buggy output (leading white space removed), - # from coreutils-5.93. - {OUT=> "1\n2\n3\n4\n> quoted text\n"}], - # FIXME: this is the desired output - # {OUT=> " 1\n 2\n\t3\n\t\t4\n> quoted text\n"}], + {OUT=> " 1\n 2\n\t3\n\t\t4\n> quoted text\n"}], - # Like the above, but when two adjacent, non-prefixed lines have - # the same indentation, ensure that they are formatted. - ['pfx-2', qw (-p '>'), - {IN=> " 1\n 2\n\t3\n\t4\n"}, - {OUT=> "1\n2\n3\n4\n"}], - # FIXME: this is the desired output - # {OUT=> " 1 2\n\t3 4\n"}], - ); + # Don't remove prefix from a prefix-only line. + ['pfx-only', qw (-p '>'), + {IN=> ">\n"}, + {OUT=> ">\n"}], + + # With a multi-byte prefix, say, "foo", don't empty a line that + # starts with a strict prefix (e.g. "fo") of that prefix. + # With fmt from coreutils-6.7, it would mistakenly output an empty line. + ['pfx-of-pfx', qw (-p 'foo'), + {IN=> "fo\n"}, + {OUT=> "fo\n"}], +); my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; diff --git a/tests/sample-test b/tests/sample-test index f4b459ce2..87e16ff31 100644 --- a/tests/sample-test +++ b/tests/sample-test @@ -1,7 +1,7 @@ #!/bin/sh # FIXME -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2007 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by |