summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2007-09-07chmod: don't ignore a dangling symlinkJim Meyering
* NEWS: Mention the bug fix. * src/chmod.c (process_file): Handle the case of FTS_SLNONE, i.e., give a diagnostic saying we cannot operate on such a file. * tests/chmod/thru-dangling: Compare new stderr output with expected.
2007-09-05Adapt to new SELinux behavior: "?" vs. new "unlabeled"Jim Meyering
* src/ls.c (gobble_file): Interpret the new "unlabeled" indicator from getfilecon/lgetfilecon the same way we interpret a negative return value: no security context. So we don't print the "+". * tests/selinux: Recognize that "unlabeled" means insufficient support for SELinux, just like "?".
2007-09-01Ensure that snapshot version changes make it to groups, too.Jim Meyering
* src/Makefile.am (groups): Depend on Makefile.
2007-08-30* src/.gitignore: Ignore *.exe for platforms with non-empty $(EXEEXT).Eric Blake
2007-08-30Use PACKAGE_NAME instead of GNU_PACKAGE.Eric Blake
* src/Makefile.am (.sh, uninstall-local): Adjust all users of hand-rolled GNU_PACKAGE to instead use autoconf-provided PACKAGE_NAME. * src/basename.c (main): Likewise. * src/chroot.c (main): Likewise. * src/dirname.c (main): Likewise. * src/echo.c (main): Likewise. * src/expr.c (main): Likewise. * src/factor.c (main): Likewise. * src/groups.sh (version): Likewise. Also, reflect change in --version output due to GPLv3. * src/hostid.c (main): Likewise. * src/hostname.c (main): Likewise. * src/link.c (main): Likewise. * src/logname.c (main): Likewise. * src/nice.c (main): Likewise. * src/nohup.c (main): Likewise. * src/printenv.c (main): Likewise. * src/printf.c (main): Likewise. * src/pwd.c (main): Likewise. * src/setuidgid.c (main): Likewise. * src/sleep.c (main): Likewise. * src/system.h (case_GETOPT_VERSION_CHAR): Likewise. * src/test.c (main): Likewise. * src/true.c (main): Likewise. * src/unlink.c (main): Likewise. * src/uptime.c (main): Likewise. * src/users.c (main): Likewise. * src/whoami.c (main): Likewise. * src/yes.c (main): Likewise. * configure.ac (AC_CHECK_DECLS): No need to check strtoimax, strtoumax, since gnulib does this.
2007-08-29Use EXIT_FAILURE, not EXIT_FAIL, now that EXIT_FAILURE is always 1.Jim Meyering
* src/system.h (EXIT_FAIL): Remove definition. * src/chroot.c (main): EXIT_FAIL -> EXIT_FAILURE. * src/env.c (main): Likewise. * src/nice.c (main): Likewise. * src/su.c (change_identity, main): Likewise. * src/tty.c (main): Likewise. Suggestion from Eric Blake.
2007-08-28* src/test.c (usage): Say that [ honors --help and --version, but test does not.Jim Meyering
2007-08-28By default, do not install hostname anymore; no kidding, this time.Jim Meyering
* src/Makefile.am (EXTRA_PROGRAMS): Remove hostname from this list, now that it's no longer being installed by default. This should have been part of the 2007-08-21 change. (check-duplicate-no-install): New rule to ensure this doesn't happen again. (check): Depend on it.
2007-08-28Reflect renaming: mreadlink-with-size -> areadlink-with-size.Jim Meyering
* bootstrap.conf: Update module name. * src/copy.c (copy_internal): Update header and function names. * src/ls.c (get_link_name): Likewise. * src/readlink.c (main): Likewise. * src/stat.c (print_stat): Likewise.
2007-08-28Add file system type names and magic numbers from "man 2 statfs".Jim Meyering
* src/stat.c (human_fstype): Also handle BEFS, BFS, BINFMT_MISC, FUSECTL, HUGETLBFS, NFSD and OPENPROM.
2007-08-27Add some file system type names and magic numbers from glibc.Jim Meyering
* src/stat.c (human_fstype): Add any file system names and values present in glibc's linux_fsinfo.h but not in this list. Alphabetize the S_* names and capitalize the hexadecimal constants.
2007-08-25* src/dircolors.hin: Add .dz and .svgz as archive suffixes.Jim Meyering
2007-08-25Remove all .cvsignore files from version control.Jim Meyering
2007-08-24* src/system.h (fseeko, ftello): Remove now-unneeded definitions.Jim Meyering
2007-08-24* src/od.c (LDBL_DIG): Remove now-unneeded definition.Jim Meyering
2007-08-23* src/dircolors.hin: Add xterm-16color, xterm-88color and eterm-color.Jim Meyering
Suggestion from Dan Nicolaescu.
2007-08-23Don't let ln be a party to destroying user data.Jim Meyering
* src/ln.c: Include "file-set.h", "hash.h" and "hash-triple.h". (dest_set, DEST_INFO_INITIAL_CAPACITY): New globals. (do_link): Refuse to remove a just-created link. Record a name,dev,ino triple for each link we create. (main): Initialize dest_set, if needed. * tests/mv/childproof: Test for the above fix. * NEWS: Document this. Reported by Eric Blake. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-08-23Move functions from copy.c into new modules, since ln needs them, too.Jim Meyering
* bootstrap.conf (gnulib_modules): Add file-set. * gl/lib/file-set.c (record_file, seen_file): Functions from copy.c. * gl/lib/file-set.h: Add prototypes. * gl/lib/hash-triple.c (triple_hash, triple_hash_no_name): (triple_compare, triple_free): Functions from copy.c. * gl/lib/hash-triple.h (struct F_triple): Define. From copy.c. Add prototypes. * gl/modules/file-set: New module. * gl/modules/hash-triple: New module. * src/Makefile.am (copy_sources): New variable. (ginstall_SOURCES, cp_SOURCES, mv_SOURCES): Use it. * src/copy.c: Include hash-triple.h. No longer include hash-pjw.h. (copy_internal): Don't pass a NULL third argument to record_file, since that function no longer accepts that. (record_file): Move this function to file-set.c. Along the way, remove the code to allow a NULL stat-buffer pointer. Adjust sole caller. (seen_file): Move this function to file-set.c. (struct F_triple): Move declaration to hash-triple.h. (triple_compare, triple_free, triple_hash, triple_hash_no_name): Move these functions to hash-triple.c. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-08-22* src/c99-to-c89.diff: Adjust offsets.Jim Meyering
2007-08-22Change "rm --verbose -r a//" not to print extra slashes in a///bJim Meyering
* src/remove.c (push_dir): Don't copy trailing slashes onto the stack. Reported by François Pinard. * tests/rm/v-slash: New file. Test for the above change. * tests/rm/Makefile.am (TESTS): Add v-slash.
2007-08-22Don't include "getline.h".Jim Meyering
That file has just been removed from gnulib; its declarations are now in <stdio.h>. * src/md5sum.c: Likewise. * src/dircolors.c: Likewise.
2007-08-22* src/copy.c (DEST_INFO_INITIAL_CAPACITY): Correct a comment.Jim Meyering
2007-08-21By default, do not install hostname anymore.Jim Meyering
* configure.ac: Add "hostname" to the list of not-installed programs. * src/Makefile.am (no_install__progs): Add "hostname" here, too. * NEWS: Mention this.
2007-08-21Clarify touch documentation of file arguments.Bob Proulx
* src/touch.c (usage): Improve wording of documentation regarding file argument handling and special handling of - argument. * doc/coreutils.texi (touch invocation): Likewise. Documentation problem reported by Vincent Lefevre.
2007-08-20Avoid consuming too much seekable input when yesno is used.Eric Blake
* bootstrap.conf (gnulib_modules): Grab closein. * src/system.h (includes): Also include closein.h. * src/mv.c (main): Use close_stdin, not close_stdout. * src/cp.c (main): Likewise. * src/ln.c (main): Likewise. * src/rm.c (main): Likewise. * src/install.c (main): Likewise. * NEWS: Document the fix.
2007-08-18Use new "idcache.h" header.Jim Meyering
* src/ls.c: Remove ancient declarations of getuser and getgroup. Include "idcache.h", instead.
2007-08-15od --skip (-j) works even on files in /proc, when the kernel liesJim Meyering
* src/od.c (skip): Don't let kernel misinformation (nonempty files in /proc with stat.st_size == 0) make "od -j N" misbehave. Patch by Paul Eggert. * NEWS: Document this work-around. * tests/misc/od-zero-len: New file, test for the above.
2007-08-15* src/printf.c (usage): Adjust summary to also mention OPTIONs.Jim Meyering
From Karl Berry.
2007-08-14od: fix a bug that arises when skipping exact length of fileJim Meyering
* NEWS: Document the bug fix. * src/od.c (skip): Call fseek even when n_skip is exactly the same as the length of the current file. Otherwise, the next iteration would use unadjusted input stream pointer, thus ignoring the desired "skip". Report and patch by Paul GHALEB.
2007-08-11Accommodate more xstrtol changes.Paul Eggert
* src/df.c (long_options): Don't bother prepending "--" to long options that OPT_STR might decode, as that hack is no longer needed. (main): Invoke xstrtol_fatal rather than STRTOL_FATAL_ERROR. * src/du.c (long_options, main): Likewise. * src/ls.c (decode_switches): Likewise. * src/od.c (long_options, main): Likewise. * src/pr.c (first_last_page, main): Likewise. * src/sort.c (long_options, specify_sort_size): Likewise. * src/pr.c (first_last_page): Accept option index and option char instead of an assembled option string. All callers changed. * src/sort.c (specify_sort_size): Likewise. * src/system.h (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): Remove.
2007-08-05Encapsulate a static variable.Jim Meyering
* src/system.h (opt_str_storage): Move static var into... (short_opt_str): ... new static inline function. (OPT_STR): Use the new function.
2007-08-04Adapt to new human and xstrtol API.Paul Eggert
* src/df.c (long_options): Prepend "--" to long options that OPT_STR might decode. * src/du.c (long_options): Likewise. * src/od.c (long_options): Likewise. * src/sort.c (long_options): Likewise. * src/df.c (main): Adjust to new human and xstrtol API. * src/du.c (main): Likewise. * src/ls.c (decode_switches): Likewise. * src/od.c (main): Likewise. * src/pr.c (first_last_page): Likewise. New argument OPTION. All callers changed. * src/sort.c (specify_sort_size): New arg OPTION. All callers changed. Adjust to new xstrtol API. * src/system.h (opt_str_storage): New static var. (OPT_STR, LONG_OPT_STR, OPT_STR_INIT): New macros.
2007-07-31du: print size (probably incomplete) of each inaccessible directoryJim Meyering
* src/du.c (process_file): Print what we know of the size of a directory even when it is inaccessible. What we print is just the size of the directory itself, not counting any of its contents. * tests/du/inacc-dir: Test for this. * NEWS: Mention this change. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-29Adjust indentation to reflect today's change.Jim Meyering
2007-07-29Attempt to copy a regular file, even if stat says it is empty.Jim Meyering
* NEWS: Document this bug fix. * src/copy.c (copy_reg): Read from a regular file, even if it appears (stat.st_size == 0) to be empty. This reverts an optimization introduced on 2005-11-23 for coreutils-6.0. Otherwise, "cp /proc/cpuinfo /tmp" creates an empty file, on e.g., linux-2.6.20. * tests/cp/proc-zero-len: New file. Test for the above. * tests/cp/Makefile.am (TESTS): Add proc-zero-len. Reported by Dan Berrangé.
2007-07-24sort: avoid unaligned access.Paul Eggert
* src/sort.c (fillbuf): When enlarging the line buffer, ensure that the new size is a multiple of "sizeof (struct line)". This avoids alignment problems when indexing from the end of the buffer. Problem reported by Andreas Schwab in <http://lists.gnu.org/archive/html/bug-coreutils/2007-07/msg00158.html>.
2007-07-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-23Update c99/c89 patch for new, copyright-change-induced offsets.Jim Meyering
* Makefile.maint (patch-check): Filter out '^Only in...' lines. * src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2007-07-20* src/sort.c (main): Don't free a pointer to non-malloc'd memory.Andreas Schwab
2007-07-19"cp -i --update older newer" no longer prompts; same for mvJim Meyering
* src/copy.c (copy_internal): Perform "update" check before the possible interactive prompt. Reported by zeno_AT_biyg_DOT_org in <http://bugzilla.redhat.com/248591> * tests/mv/update: Add tests for the above. * NEWS: Mention the bug fix.
2007-07-15ls --color: Don't stat symlinks when neither ORPHAN nor MISSING attribute ↵Jim Meyering
has a color. * src/ls.c (main): Don't set check_symlink_color when C_EXEC is colored, unless ln=target (aka color_symlink_as_referent) is set. (gobble_file): Set f->linkok = true also when !check_symlink_color. http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10608/focus=10927 Reported by Jeremy Maitin-Shepard. * tests/strace: New file, contents extracted from... * tests/mv/atomic: ...here. Source strace. * tests/ls/stat-free-symlinks: New file. Test for the above. Use strace to ensure that in this corner case, ls does not call stat. * tests/ls/Makefile.am (TESTS): Add stat-free-symlinks. * tests/Makefile.am (EXTRA_DIST): Add strace.
2007-07-14Remove long-deprecated options.Jim Meyering
* NEWS: Mention this. * src/df.c, src/ls.c: Remove --kilobytes option. * src/du.c: Remove --kilobytes and --megabytes options. * src/who.c: Remove -i and --idle options. * src/ptx.c: Remove --copyright option. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-13Warn about non-portable use of unescaped backslash at end of string,Jim Meyering
and treat it as if it were escaped. * src/tr.c (unquote): Considering that such usage would make GNU tr from coreutils-5.2.1 and earlier *fail*, the least we can do now is to warn about it. Solaris' tr ignores it. * NEWS: Mention this.
2007-07-10Skip "arch" test if it's not built.Jim Meyering
* tests/misc/Makefile.am (built_programs): Define. (TESTS_ENVIRONMENT): Add $(built_programs), for... * tests/misc/arch: ...this: skip the test if arch is not built. * src/Makefile.am (built_programs.list): New rule. * tests/Makefile.am (built_programs): Rename from all_programs. (TESTS_ENVIRONMENT): Use built_programs, not all_programs. * tests/help-version: Likewise. * NEWS: Mention that using --enable-no-install-program=X may cause "make check" to fail. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-10Add support for enabling/disabling installation of specified programs.Jim Meyering
* NEWS: Mention new configure-time options. Mention that neither arch nor su is built/installed, by default. * m4/include-exclude-prog.m4: New file. * configure.ac: Use new macro, gl_ADD_PROG, rather than manually appending to OPTIONAL_BIN_PROGS and MAN. Move the code that adds "df" to the list of programs to build from m4/jm-macros into this file. Use gl_INCLUDE_EXCLUDE_PROG, then handle special cases: ginstall, [. (NO_INSTALL_PROGS_DEFAULT): AC_SUBST it. Used by man/Makefile.am. * man/Makefile.am (dist_man_MANS): Remove from this list all man pages corresponding to "bin" programs. Add $(MAN) instead. (optional_mans): Remove all uses. (check-x-vs-1): Adapt to work even though arch and su are typically no longer built (and neither are their .1 files). * src/Makefile.am (install_su): Rename from INSTALL_SU, now that INSTALL_SU has a different meaning. Use the new $(INSTALL_SU) value.
2007-07-10New program: archKarel Zak
* NEWS: Mention arch. * README: Add arch to the list of programs. * AUTHORS: Add arch. * src/uname.c: Include "uname.h". (PROGRAM_NAME): Handle arch, too. (ARCH_AUTHORS): Define. (uname_long_options, arch_long_options): Renamed and new globals. (usage): Handle arch-mode as well as uname-mode. (decode_switches): New function, extracted from main, to handle arch-mode as well as uname-mode. (main): Handle both modes. * src/uname-arch.c: New program, alias for "uname -m". * src/uname-uname.c: New file, default uname mode. * src/uname.h: New file, uname modes. * src/Makefile.am (EXTRA_PROGRAMS): Add arch. (uname_SOURCES, arch_SOURCES): Define. * man/arch.x: New file. * man/Makefile.am (dist_man_MANS): Add arch.1. (arch.1): New dependency. * tests/misc/arch: New test, compare "arch" with "uname -m" * configure.ac (OPTIONAL_BIN_PROGS): Add arch. (MAN): Add arch.1. * .x-sc_require_config_h: Exempt uname-arch.c and uname-uname.c from the always-include-<config.h> rule. Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-07-09Compensate for new c99'isms in seq.c.Jim Meyering
* Makefile.maint (patch-check): Use -p1, not -p2, so a patch generated via "make patch-check REGEN=1" actually works. * src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2007-07-09Fix the automatic number width formatting in seq.P@draigBrady.com
* src/seq.c: Fix the -w logic. Ignore spaces and '+' characters of input numbers when determining width. Set format correctly for input numbers in scientific notation. * tests/seq/basic: Add various number width tests. Details: <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10903> Signed-off-by: Pádraig Brady <Pádraig Brady P@draigBrady.com>
2007-07-08Use <wchar.h>, not "wcwidth.h".Jim Meyering
* src/wc.c: Now that gnulib provides the POSIX-specified <wchar.h>, include it and <wctype.h>, rather than "wcwidth.h". * src/ls.c: Include <wchar.h>, rather than "wcwidth.h".