- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
lib/linebuffer.h | 8 +
|
|
|
|
|
src/cut.c | 420 +++++++++++++++++++++++++--
|
|
|
|
|
src/expand.c | 160 ++++++++++-
|
|
|
|
|
src/fold.c | 309 ++++++++++++++++++--
|
|
|
|
|
src/join.c | 347 +++++++++++++++++++---
|
|
|
|
|
src/pr.c | 431 +++++++++++++++++++++++++---
|
|
|
|
|
src/sort.c | 722 +++++++++++++++++++++++++++++++++++++++++++---
|
|
|
|
|
src/unexpand.c | 226 ++++++++++++++-
|
|
|
|
|
src/uniq.c | 259 ++++++++++++++++-
|
|
|
|
|
tests/Makefile.am | 5 +
|
|
|
|
|
tests/misc/cut | 4 +-
|
|
|
|
|
tests/misc/mb1.I | 4 +
|
|
|
|
|
tests/misc/mb1.X | 4 +
|
|
|
|
|
tests/misc/mb2.I | 4 +
|
|
|
|
|
tests/misc/mb2.X | 4 +
|
|
|
|
|
tests/misc/sort-mb-tests | 58 ++++
|
|
|
|
|
16 files changed, 2783 insertions(+), 182 deletions(-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Index: lib/linebuffer.h
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- lib/linebuffer.h.orig
|
|
|
|
|
+++ lib/linebuffer.h
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -21,6 +21,11 @@
|
|
|
|
|
|
|
|
|
|
# include <stdio.h>
|
|
|
|
|
|
|
|
|
|
+/* Get mbstate_t. */
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
+# if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+# endif
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
/* A 'struct linebuffer' holds a line of text. */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
struct linebuffer
|
|
|
|
|
@@ -28,6 +33,9 @@ struct linebuffer
|
|
|
|
|
size_t size; /* Allocated. */
|
|
|
|
|
size_t length; /* Used. */
|
|
|
|
|
char *buffer;
|
|
|
|
|
+# if HAVE_WCHAR_H
|
|
|
|
|
+ mbstate_t state;
|
|
|
|
|
+# endif
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Initialize linebuffer LINEBUFFER for use. */
|
|
|
|
|
Index: src/cut.c
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- src/cut.c.orig
|
|
|
|
|
+++ src/cut.c
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -28,6 +28,11 @@
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
+
|
|
|
|
|
+/* Get mbstate_t, mbrtowc(). */
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+#endif
|
|
|
|
|
#include "system.h"
|
|
|
|
|
|
|
|
|
|
#include "error.h"
|
|
|
|
|
@@ -37,6 +42,18 @@
|
|
|
|
|
#include "quote.h"
|
|
|
|
|
#include "xstrndup.h"
|
|
|
|
|
|
|
|
|
|
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
|
|
|
|
|
+ installation; work around this configuration error. */
|
|
|
|
|
+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
|
|
|
|
|
+# undef MB_LEN_MAX
|
|
|
|
|
+# define MB_LEN_MAX 16
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
|
|
|
|
|
+#if HAVE_MBRTOWC && defined mbstate_t
|
|
|
|
|
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* The official name of this program (e.g., no 'g' prefix). */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#define PROGRAM_NAME "cut"
|
|
|
|
|
|
|
|
|
|
@@ -72,6 +89,52 @@
|
|
|
|
|
} \
|
|
|
|
|
while (0)
|
|
|
|
|
|
|
|
|
|
+/* Refill the buffer BUF to get a multibyte character. */
|
|
|
|
|
+#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM) \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM)) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ memmove (BUF, BUFPOS, BUFLEN); \
|
|
|
|
|
+ BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \
|
|
|
|
|
+ BUFPOS = BUF; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+
|
|
|
|
|
+/* Get wide character on BUFPOS. BUFPOS is not included after that.
|
|
|
|
|
+ If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */
|
|
|
|
|
+#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ mbstate_t state_bak; \
|
|
|
|
|
+ \
|
|
|
|
|
+ if (BUFLEN < 1) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ WC = WEOF; \
|
|
|
|
|
+ break; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ \
|
|
|
|
|
+ /* Get a wide character. */ \
|
|
|
|
|
+ CONVFAIL = 0; \
|
|
|
|
|
+ state_bak = STATE; \
|
|
|
|
|
+ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \
|
|
|
|
|
+ \
|
|
|
|
|
+ switch (MBLENGTH) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ case (size_t)-1: \
|
|
|
|
|
+ case (size_t)-2: \
|
|
|
|
|
+ CONVFAIL++; \
|
|
|
|
|
+ STATE = state_bak; \
|
|
|
|
|
+ /* Fall througn. */ \
|
|
|
|
|
+ \
|
|
|
|
|
+ case 0: \
|
|
|
|
|
+ MBLENGTH = 1; \
|
|
|
|
|
+ break; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+
|
|
|
|
|
struct range_pair
|
|
|
|
|
{
|
|
|
|
|
size_t lo;
|
|
|
|
|
@@ -90,7 +153,7 @@ static char *field_1_buffer;
|
|
|
|
|
/* The number of bytes allocated for FIELD_1_BUFFER. */
|
|
|
|
|
static size_t field_1_bufsize;
|
|
|
|
|
|
|
|
|
|
-/* The largest field or byte index used as an endpoint of a closed
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+/* The largest byte, character or field index used as an endpoint of a closed
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
or degenerate range specification; this doesn't include the starting
|
|
|
|
|
index of right-open-ended ranges. For example, with either range spec
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
'2-5,9-', '2-3,5,9-' this variable would be set to 5. */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -102,10 +165,11 @@ static size_t eol_range_start;
|
|
|
|
|
|
|
|
|
|
/* This is a bit vector.
|
|
|
|
|
In byte mode, which bytes to output.
|
|
|
|
|
+ In character mode, which characters to output.
|
|
|
|
|
In field mode, which DELIM-separated fields to output.
|
|
|
|
|
- Both bytes and fields are numbered starting with 1,
|
|
|
|
|
+ Bytes, characters and fields are numbered starting with 1,
|
|
|
|
|
so the zeroth bit of this array is unused.
|
|
|
|
|
- A field or byte K has been selected if
|
|
|
|
|
+ A byte, character or field K has been selected if
|
|
|
|
|
(K <= MAX_RANGE_ENDPOINT and is_printable_field(K))
|
|
|
|
|
|| (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */
|
|
|
|
|
static unsigned char *printable_field;
|
|
|
|
|
@@ -114,15 +178,25 @@ enum operating_mode
|
|
|
|
|
{
|
|
|
|
|
undefined_mode,
|
|
|
|
|
|
|
|
|
|
- /* Output characters that are in the given bytes. */
|
|
|
|
|
+ /* Output bytes that are at the given positions. */
|
|
|
|
|
byte_mode,
|
|
|
|
|
|
|
|
|
|
+ /* Output characters that are at the given positions. */
|
|
|
|
|
+ character_mode,
|
|
|
|
|
+
|
|
|
|
|
/* Output the given delimeter-separated fields. */
|
|
|
|
|
field_mode
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static enum operating_mode operating_mode;
|
|
|
|
|
|
|
|
|
|
+/* If nonzero, when in byte mode, don't split multibyte characters. */
|
|
|
|
|
+static int byte_mode_character_aware;
|
|
|
|
|
+
|
|
|
|
|
+/* If nonzero, the function for single byte locale is work
|
|
|
|
|
+ if this program runs on multibyte locale. */
|
|
|
|
|
+static int force_singlebyte_mode;
|
|
|
|
|
+
|
|
|
|
|
/* If true do not output lines containing no delimeter characters.
|
|
|
|
|
Otherwise, all such lines are printed. This option is valid only
|
|
|
|
|
with field mode. */
|
|
|
|
|
@@ -134,6 +208,9 @@ static bool complement;
|
|
|
|
|
|
|
|
|
|
/* The delimeter character for field mode. */
|
|
|
|
|
static unsigned char delim;
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+static wchar_t wcdelim;
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
/* True if the --output-delimiter=STRING option was specified. */
|
|
|
|
|
static bool output_delimiter_specified;
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -206,7 +283,7 @@ Mandatory arguments to long options are
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
-f, --fields=LIST select only these fields; also print any line\n\
|
|
|
|
|
that contains no delimiter character, unless\n\
|
|
|
|
|
the -s option is specified\n\
|
|
|
|
|
- -n (ignored)\n\
|
|
|
|
|
+ -n with -b: don't split multibyte characters\n\
|
|
|
|
|
"), stdout);
|
|
|
|
|
fputs (_("\
|
|
|
|
|
--complement complement the set of selected bytes, characters\n\
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -365,7 +442,7 @@ set_fields (const char *fieldstr)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
in_digits = false;
|
|
|
|
|
/* Starting a range. */
|
|
|
|
|
if (dash_found)
|
|
|
|
|
- FATAL_ERROR (_("invalid byte or field list"));
|
|
|
|
|
+ FATAL_ERROR (_("invalid byte, character or field list"));
|
|
|
|
|
dash_found = true;
|
|
|
|
|
fieldstr++;
|
|
|
|
|
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -389,14 +466,16 @@ set_fields (const char *fieldstr)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
if (!rhs_specified)
|
|
|
|
|
{
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* 'n-'. From 'initial' to end of line. */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
- eol_range_start = initial;
|
|
|
|
|
+ if (eol_range_start == 0 ||
|
|
|
|
|
+ (eol_range_start != 0 && eol_range_start > initial))
|
|
|
|
|
+ eol_range_start = initial;
|
|
|
|
|
field_found = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* 'm-n' or '-n' (1-n). */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
if (value < initial)
|
|
|
|
|
- FATAL_ERROR (_("invalid decreasing range"));
|
|
|
|
|
+ FATAL_ERROR (_("invalid byte, character or field list"));
|
|
|
|
|
|
|
|
|
|
/* Is there already a range going to end of line? */
|
|
|
|
|
if (eol_range_start != 0)
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -476,6 +555,9 @@ set_fields (const char *fieldstr)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
if (operating_mode == byte_mode)
|
|
|
|
|
error (0, 0,
|
|
|
|
|
_("byte offset %s is too large"), quote (bad_num));
|
|
|
|
|
+ else if (operating_mode == character_mode)
|
|
|
|
|
+ error (0, 0,
|
|
|
|
|
+ _("character offset %s is too large"), quote (bad_num));
|
|
|
|
|
else
|
|
|
|
|
error (0, 0,
|
|
|
|
|
_("field number %s is too large"), quote (bad_num));
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -486,7 +568,7 @@ set_fields (const char *fieldstr)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
fieldstr++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
- FATAL_ERROR (_("invalid byte or field list"));
|
|
|
|
|
+ FATAL_ERROR (_("invalid byte, character or field list"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
max_range_endpoint = 0;
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -581,6 +663,77 @@ cut_bytes (FILE *stream)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+/* This function is in use for the following case.
|
|
|
|
|
+
|
|
|
|
|
+ 1. Read from the stream STREAM, printing to standard output any selected
|
|
|
|
|
+ characters.
|
|
|
|
|
+
|
|
|
|
|
+ 2. Read from stream STREAM, printing to standard output any selected bytes,
|
|
|
|
|
+ without splitting multibyte characters. */
|
|
|
|
|
+
|
|
|
|
|
+static void
|
|
|
|
|
+cut_characters_or_cut_bytes_no_split (FILE *stream)
|
|
|
|
|
+{
|
|
|
|
|
+ int idx; /* number of bytes or characters in the line so far. */
|
|
|
|
|
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
|
|
|
|
+ char *bufpos; /* Next read position of BUF. */
|
|
|
|
|
+ size_t buflen; /* The length of the byte sequence in buf. */
|
|
|
|
|
+ wint_t wc; /* A gotten wide character. */
|
|
|
|
|
+ size_t mblength; /* The byte size of a multibyte character which shows
|
|
|
|
|
+ as same character as WC. */
|
|
|
|
|
+ mbstate_t state; /* State of the stream. */
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ int convfail = 0; /* 1, when conversion is failed. Otherwise 0. */
|
|
|
|
|
+ /* Whether to begin printing delimiters between ranges for the current line.
|
|
|
|
|
+ Set after we've begun printing data corresponding to the first range. */
|
|
|
|
|
+ bool print_delimiter = false;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
|
|
|
|
+ idx = 0;
|
|
|
|
|
+ buflen = 0;
|
|
|
|
|
+ bufpos = buf;
|
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ while (1)
|
|
|
|
|
+ {
|
|
|
|
|
+ REFILL_BUFFER (buf, bufpos, buflen, stream);
|
|
|
|
|
+
|
|
|
|
|
+ GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail);
|
|
|
|
|
+
|
|
|
|
|
+ if (wc == WEOF)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (idx > 0)
|
|
|
|
|
+ putchar ('\n');
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (wc == L'\n')
|
|
|
|
|
+ {
|
|
|
|
|
+ putchar ('\n');
|
|
|
|
|
+ idx = 0;
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ print_delimiter = false;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ bool range_start;
|
|
|
|
|
+ bool *rs = output_delimiter_specified ? &range_start : NULL;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ idx += (operating_mode == byte_mode) ? mblength : 1;
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ if (print_kth (idx, rs))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (rs && *rs && print_delimiter)
|
|
|
|
|
+ {
|
|
|
|
|
+ fwrite (output_delimiter_string, sizeof (char),
|
|
|
|
|
+ output_delimiter_length, stdout);
|
|
|
|
|
+ }
|
|
|
|
|
+ print_delimiter = true;
|
|
|
|
|
+ fwrite (bufpos, mblength, sizeof(char), stdout);
|
|
|
|
|
+ }
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ buflen -= mblength;
|
|
|
|
|
+ bufpos += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Read from stream STREAM, printing to standard output any selected fields. */
|
|
|
|
|
|
|
|
|
|
static void
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -703,13 +856,195 @@ cut_fields (FILE *stream)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static void
|
|
|
|
|
+cut_fields_mb (FILE *stream)
|
|
|
|
|
+{
|
|
|
|
|
+ int c;
|
|
|
|
|
+ unsigned int field_idx;
|
|
|
|
|
+ int found_any_selected_field;
|
|
|
|
|
+ int buffer_first_field;
|
|
|
|
|
+ int empty_input;
|
|
|
|
|
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
|
|
|
|
+ char *bufpos; /* Next read position of BUF. */
|
|
|
|
|
+ size_t buflen; /* The length of the byte sequence in buf. */
|
|
|
|
|
+ wint_t wc = 0; /* A gotten wide character. */
|
|
|
|
|
+ size_t mblength; /* The byte size of a multibyte character which shows
|
|
|
|
|
+ as same character as WC. */
|
|
|
|
|
+ mbstate_t state; /* State of the stream. */
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ int convfail = 0; /* 1, when conversion is failed. Otherwise 0. */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
|
|
|
|
+ found_any_selected_field = 0;
|
|
|
|
|
+ field_idx = 1;
|
|
|
|
|
+ bufpos = buf;
|
|
|
|
|
+ buflen = 0;
|
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ c = getc (stream);
|
|
|
|
|
+ empty_input = (c == EOF);
|
|
|
|
|
+ if (c != EOF)
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ {
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ ungetc (c, stream);
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ wc = 0;
|
|
|
|
|
+ }
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ else
|
|
|
|
|
+ wc = WEOF;
|
|
|
|
|
+
|
|
|
|
|
+ /* To support the semantics of the -s flag, we may have to buffer
|
|
|
|
|
+ all of the first field to determine whether it is `delimited.'
|
|
|
|
|
+ But that is unnecessary if all non-delimited lines must be printed
|
|
|
|
|
+ and the first field has been selected, or if non-delimited lines
|
|
|
|
|
+ must be suppressed and the first field has *not* been selected.
|
|
|
|
|
+ That is because a non-delimited line has exactly one field. */
|
|
|
|
|
+ buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL));
|
|
|
|
|
+
|
|
|
|
|
+ while (1)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (field_idx == 1 && buffer_first_field)
|
|
|
|
|
+ {
|
|
|
|
|
+ int len = 0;
|
|
|
|
|
+
|
|
|
|
|
+ while (1)
|
|
|
|
|
+ {
|
|
|
|
|
+ REFILL_BUFFER (buf, bufpos, buflen, stream);
|
|
|
|
|
+
|
|
|
|
|
+ GET_NEXT_WC_FROM_BUFFER
|
|
|
|
|
+ (wc, bufpos, buflen, mblength, state, convfail);
|
|
|
|
|
+
|
|
|
|
|
+ if (wc == WEOF)
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ field_1_buffer = xrealloc (field_1_buffer, len + mblength);
|
|
|
|
|
+ memcpy (field_1_buffer + len, bufpos, mblength);
|
|
|
|
|
+ len += mblength;
|
|
|
|
|
+ buflen -= mblength;
|
|
|
|
|
+ bufpos += mblength;
|
|
|
|
|
+
|
|
|
|
|
+ if (!convfail && (wc == L'\n' || wc == wcdelim))
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ if (len <= 0 && wc == WEOF)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ /* If the first field extends to the end of line (it is not
|
|
|
|
|
+ delimited) and we are printing all non-delimited lines,
|
|
|
|
|
+ print this one. */
|
|
|
|
|
+ if (convfail || (!convfail && wc != wcdelim))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (suppress_non_delimited)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* Empty. */
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ fwrite (field_1_buffer, sizeof (char), len, stdout);
|
|
|
|
|
+ /* Make sure the output line is newline terminated. */
|
|
|
|
|
+ if (convfail || (!convfail && wc != L'\n'))
|
|
|
|
|
+ putchar ('\n');
|
|
|
|
|
+ }
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (print_kth (1, NULL))
|
|
|
|
|
+ {
|
|
|
|
|
+ /* Print the field, but not the trailing delimiter. */
|
|
|
|
|
+ fwrite (field_1_buffer, sizeof (char), len - 1, stdout);
|
|
|
|
|
+ found_any_selected_field = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ ++field_idx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (wc != WEOF)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (print_kth (field_idx, NULL))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (found_any_selected_field)
|
|
|
|
|
+ {
|
|
|
|
|
+ fwrite (output_delimiter_string, sizeof (char),
|
|
|
|
|
+ output_delimiter_length, stdout);
|
|
|
|
|
+ }
|
|
|
|
|
+ found_any_selected_field = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ while (1)
|
|
|
|
|
+ {
|
|
|
|
|
+ REFILL_BUFFER (buf, bufpos, buflen, stream);
|
|
|
|
|
+
|
|
|
|
|
+ GET_NEXT_WC_FROM_BUFFER
|
|
|
|
|
+ (wc, bufpos, buflen, mblength, state, convfail);
|
|
|
|
|
+
|
|
|
|
|
+ if (wc == WEOF)
|
|
|
|
|
+ break;
|
|
|
|
|
+ else if (!convfail && (wc == wcdelim || wc == L'\n'))
|
|
|
|
|
+ {
|
|
|
|
|
+ buflen -= mblength;
|
|
|
|
|
+ bufpos += mblength;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (print_kth (field_idx, NULL))
|
|
|
|
|
+ fwrite (bufpos, mblength, sizeof(char), stdout);
|
|
|
|
|
+
|
|
|
|
|
+ buflen -= mblength;
|
|
|
|
|
+ bufpos += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ((!convfail || wc == L'\n') && buflen < 1)
|
|
|
|
|
+ wc = WEOF;
|
|
|
|
|
+
|
|
|
|
|
+ if (!convfail && wc == wcdelim)
|
|
|
|
|
+ ++field_idx;
|
|
|
|
|
+ else if (wc == WEOF || (!convfail && wc == L'\n'))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (found_any_selected_field
|
|
|
|
|
+ || (!empty_input && !(suppress_non_delimited && field_idx == 1)))
|
|
|
|
|
+ putchar ('\n');
|
|
|
|
|
+ if (wc == WEOF)
|
|
|
|
|
+ break;
|
|
|
|
|
+ field_idx = 1;
|
|
|
|
|
+ found_any_selected_field = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
static void
|
|
|
|
|
cut_stream (FILE *stream)
|
|
|
|
|
{
|
|
|
|
|
- if (operating_mode == byte_mode)
|
|
|
|
|
- cut_bytes (stream);
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch (operating_mode)
|
|
|
|
|
+ {
|
|
|
|
|
+ case byte_mode:
|
|
|
|
|
+ if (byte_mode_character_aware)
|
|
|
|
|
+ cut_characters_or_cut_bytes_no_split (stream);
|
|
|
|
|
+ else
|
|
|
|
|
+ cut_bytes (stream);
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case character_mode:
|
|
|
|
|
+ cut_characters_or_cut_bytes_no_split (stream);
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case field_mode:
|
|
|
|
|
+ cut_fields_mb (stream);
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ abort ();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
else
|
|
|
|
|
- cut_fields (stream);
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ if (operating_mode == field_mode)
|
|
|
|
|
+ cut_fields (stream);
|
|
|
|
|
+ else
|
|
|
|
|
+ cut_bytes (stream);
|
|
|
|
|
+ }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Process file FILE to standard output.
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -761,6 +1096,8 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
bool ok;
|
|
|
|
|
bool delim_specified = false;
|
|
|
|
|
char *spec_list_string IF_LINT ( = NULL);
|
|
|
|
|
+ char mbdelim[MB_LEN_MAX + 1];
|
|
|
|
|
+ size_t delimlen = 0;
|
|
|
|
|
|
|
|
|
|
initialize_main (&argc, &argv);
|
|
|
|
|
set_program_name (argv[0]);
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -783,7 +1120,6 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
switch (optc)
|
|
|
|
|
{
|
|
|
|
|
case 'b':
|
|
|
|
|
- case 'c':
|
|
|
|
|
/* Build the byte list. */
|
|
|
|
|
if (operating_mode != undefined_mode)
|
|
|
|
|
FATAL_ERROR (_("only one type of list may be specified"));
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -791,6 +1127,14 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
spec_list_string = optarg;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
+ case 'c':
|
|
|
|
|
+ /* Build the character list. */
|
|
|
|
|
+ if (operating_mode != undefined_mode)
|
|
|
|
|
+ FATAL_ERROR (_("only one type of list may be specified"));
|
|
|
|
|
+ operating_mode = character_mode;
|
|
|
|
|
+ spec_list_string = optarg;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
case 'f':
|
|
|
|
|
/* Build the field list. */
|
|
|
|
|
if (operating_mode != undefined_mode)
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -802,10 +1146,35 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
case 'd':
|
|
|
|
|
/* New delimiter. */
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
- if (optarg[0] != '\0' && optarg[1] != '\0')
|
|
|
|
|
- FATAL_ERROR (_("the delimiter must be a single character"));
|
|
|
|
|
- delim = optarg[0];
|
|
|
|
|
- delim_specified = true;
|
|
|
|
|
+ {
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if(MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ mbstate_t state;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+ delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state);
|
|
|
|
|
+
|
|
|
|
|
+ if (delimlen == (size_t)-1 || delimlen == (size_t)-2)
|
|
|
|
|
+ ++force_singlebyte_mode;
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ delimlen = (delimlen < 1) ? 1 : delimlen;
|
|
|
|
|
+ if (wcdelim != L'\0' && *(optarg + delimlen) != '\0')
|
|
|
|
|
+ FATAL_ERROR (_("the delimiter must be a single character"));
|
|
|
|
|
+ memcpy (mbdelim, optarg, delimlen);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ if (optarg[0] != '\0' && optarg[1] != '\0')
|
|
|
|
|
+ FATAL_ERROR (_("the delimiter must be a single character"));
|
|
|
|
|
+ delim = (unsigned char) optarg[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ delim_specified = true;
|
|
|
|
|
+ }
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case OUTPUT_DELIMITER_OPTION:
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -818,6 +1187,7 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'n':
|
|
|
|
|
+ byte_mode_character_aware = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 's':
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -840,7 +1210,7 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
if (operating_mode == undefined_mode)
|
|
|
|
|
FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
|
|
|
|
|
|
|
|
|
|
- if (delim != '\0' && operating_mode != field_mode)
|
|
|
|
|
+ if (delim_specified && operating_mode != field_mode)
|
|
|
|
|
FATAL_ERROR (_("an input delimiter may be specified only\
|
|
|
|
|
when operating on fields"));
|
|
|
|
|
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -867,15 +1237,34 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!delim_specified)
|
|
|
|
|
- delim = '\t';
|
|
|
|
|
+ {
|
|
|
|
|
+ delim = '\t';
|
|
|
|
|
+#ifdef HAVE_MBRTOWC
|
|
|
|
|
+ wcdelim = L'\t';
|
|
|
|
|
+ mbdelim[0] = '\t';
|
|
|
|
|
+ mbdelim[1] = '\0';
|
|
|
|
|
+ delimlen = 1;
|
|
|
|
|
+#endif
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
if (output_delimiter_string == NULL)
|
|
|
|
|
{
|
|
|
|
|
- static char dummy[2];
|
|
|
|
|
- dummy[0] = delim;
|
|
|
|
|
- dummy[1] = '\0';
|
|
|
|
|
- output_delimiter_string = dummy;
|
|
|
|
|
- output_delimiter_length = 1;
|
|
|
|
|
+#ifdef HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
|
|
|
|
|
+ {
|
|
|
|
|
+ output_delimiter_string = xstrdup(mbdelim);
|
|
|
|
|
+ output_delimiter_length = delimlen;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ static char dummy[2];
|
|
|
|
|
+ dummy[0] = delim;
|
|
|
|
|
+ dummy[1] = '\0';
|
|
|
|
|
+ output_delimiter_string = dummy;
|
|
|
|
|
+ output_delimiter_length = 1;
|
|
|
|
|
+ }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (optind == argc)
|
|
|
|
|
Index: src/expand.c
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- src/expand.c.orig
|
|
|
|
|
+++ src/expand.c
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -37,12 +37,29 @@
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
+
|
|
|
|
|
+/* Get mbstate_t, mbrtowc(), wcwidth(). */
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "error.h"
|
|
|
|
|
#include "fadvise.h"
|
|
|
|
|
#include "quote.h"
|
|
|
|
|
#include "xstrndup.h"
|
|
|
|
|
|
|
|
|
|
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
|
|
|
|
|
+ installation; work around this configuration error. */
|
|
|
|
|
+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
|
|
|
|
|
+# define MB_LEN_MAX 16
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
|
|
|
|
|
+#if HAVE_MBRTOWC && defined mbstate_t
|
|
|
|
|
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* The official name of this program (e.g., no 'g' prefix). */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#define PROGRAM_NAME "expand"
|
|
|
|
|
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -358,6 +375,142 @@ expand (void)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static void
|
|
|
|
|
+expand_multibyte (void)
|
|
|
|
|
+{
|
|
|
|
|
+ FILE *fp; /* Input strem. */
|
|
|
|
|
+ mbstate_t i_state; /* Current shift state of the input stream. */
|
|
|
|
|
+ mbstate_t i_state_bak; /* Back up the I_STATE. */
|
|
|
|
|
+ mbstate_t o_state; /* Current shift state of the output stream. */
|
|
|
|
|
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
|
|
|
|
+ char *bufpos; /* Next read position of BUF. */
|
|
|
|
|
+ size_t buflen = 0; /* The length of the byte sequence in buf. */
|
|
|
|
|
+ wchar_t wc; /* A gotten wide character. */
|
|
|
|
|
+ size_t mblength; /* The byte size of a multibyte character
|
|
|
|
|
+ which shows as same character as WC. */
|
|
|
|
|
+ int tab_index = 0; /* Index in `tab_list' of next tabstop. */
|
|
|
|
|
+ int column = 0; /* Column on screen of the next char. */
|
|
|
|
|
+ int next_tab_column; /* Column the next tab stop is on. */
|
|
|
|
|
+ int convert = 1; /* If nonzero, perform translations. */
|
|
|
|
|
+
|
|
|
|
|
+ fp = next_file ((FILE *) NULL);
|
|
|
|
|
+ if (fp == NULL)
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&o_state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+ memset (&i_state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ for (;;)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* Refill the buffer BUF. */
|
|
|
|
|
+ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
|
|
|
|
|
+ {
|
|
|
|
|
+ memmove (buf, bufpos, buflen);
|
|
|
|
|
+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
|
|
|
|
|
+ bufpos = buf;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* No character is left in BUF. */
|
|
|
|
|
+ if (buflen < 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ fp = next_file (fp);
|
|
|
|
|
+
|
|
|
|
|
+ if (fp == NULL)
|
|
|
|
|
+ break; /* No more files. */
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ memset (&i_state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* Get a wide character. */
|
|
|
|
|
+ i_state_bak = i_state;
|
|
|
|
|
+ mblength = mbrtowc (&wc, bufpos, buflen, &i_state);
|
|
|
|
|
+
|
|
|
|
|
+ switch (mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ case (size_t)-1: /* illegal byte sequence. */
|
|
|
|
|
+ case (size_t)-2:
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ i_state = i_state_bak;
|
|
|
|
|
+ if (convert)
|
|
|
|
|
+ {
|
|
|
|
|
+ ++column;
|
|
|
|
|
+ if (convert_entire_line == 0)
|
|
|
|
|
+ convert = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ putchar (*bufpos);
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case 0: /* null. */
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ if (convert && convert_entire_line == 0)
|
|
|
|
|
+ convert = 0;
|
|
|
|
|
+ putchar ('\0');
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ if (wc == L'\n') /* LF. */
|
|
|
|
|
+ {
|
|
|
|
|
+ tab_index = 0;
|
|
|
|
|
+ column = 0;
|
|
|
|
|
+ convert = 1;
|
|
|
|
|
+ putchar ('\n');
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (wc == L'\t' && convert) /* Tab. */
|
|
|
|
|
+ {
|
|
|
|
|
+ if (tab_size == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* Do not let tab_index == first_free_tab;
|
|
|
|
|
+ stop when it is 1 less. */
|
|
|
|
|
+ while (tab_index < first_free_tab - 1
|
|
|
|
|
+ && column >= tab_list[tab_index])
|
|
|
|
|
+ tab_index++;
|
|
|
|
|
+ next_tab_column = tab_list[tab_index];
|
|
|
|
|
+ if (tab_index < first_free_tab - 1)
|
|
|
|
|
+ tab_index++;
|
|
|
|
|
+ if (column >= next_tab_column)
|
|
|
|
|
+ next_tab_column = column + 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ next_tab_column = column + tab_size - column % tab_size;
|
|
|
|
|
+
|
|
|
|
|
+ while (column < next_tab_column)
|
|
|
|
|
+ {
|
|
|
|
|
+ putchar (' ');
|
|
|
|
|
+ ++column;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else /* Others. */
|
|
|
|
|
+ {
|
|
|
|
|
+ if (convert)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (wc == L'\b')
|
|
|
|
|
+ {
|
|
|
|
|
+ if (column > 0)
|
|
|
|
|
+ --column;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ int width; /* The width of WC. */
|
|
|
|
|
+
|
|
|
|
|
+ width = wcwidth (wc);
|
|
|
|
|
+ column += (width > 0) ? width : 0;
|
|
|
|
|
+ if (convert_entire_line == 0)
|
|
|
|
|
+ convert = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ fwrite (bufpos, sizeof(char), mblength, stdout);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ buflen -= mblength;
|
|
|
|
|
+ bufpos += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
int
|
|
|
|
|
main (int argc, char **argv)
|
|
|
|
|
{
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -422,7 +575,12 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
file_list = (optind < argc ? &argv[optind] : stdin_argv);
|
|
|
|
|
|
|
|
|
|
- expand ();
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ expand_multibyte ();
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ expand ();
|
|
|
|
|
|
|
|
|
|
if (have_read_stdin && fclose (stdin) != 0)
|
|
|
|
|
error (EXIT_FAILURE, errno, "-");
|
|
|
|
|
Index: src/fold.c
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- src/fold.c.orig
|
|
|
|
|
+++ src/fold.c
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -22,12 +22,34 @@
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
+/* Get mbstate_t, mbrtowc(), wcwidth(). */
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Get iswprint(), iswblank(), wcwidth(). */
|
|
|
|
|
+#if HAVE_WCTYPE_H
|
|
|
|
|
+# include <wctype.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "error.h"
|
|
|
|
|
#include "fadvise.h"
|
|
|
|
|
#include "quote.h"
|
|
|
|
|
#include "xstrtol.h"
|
|
|
|
|
|
|
|
|
|
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
|
|
|
|
|
+ installation; work around this configuration error. */
|
|
|
|
|
+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
|
|
|
|
|
+# undef MB_LEN_MAX
|
|
|
|
|
+# define MB_LEN_MAX 16
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
|
|
|
|
|
+#if HAVE_MBRTOWC && defined mbstate_t
|
|
|
|
|
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#define TAB_WIDTH 8
|
|
|
|
|
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* The official name of this program (e.g., no 'g' prefix). */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -35,20 +57,41 @@
|
|
|
|
|
|
|
|
|
|
#define AUTHORS proper_name ("David MacKenzie")
|
|
|
|
|
|
|
|
|
|
+#define FATAL_ERROR(Message) \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ error (0, 0, (Message)); \
|
|
|
|
|
+ usage (2); \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+
|
|
|
|
|
+enum operating_mode
|
|
|
|
|
+{
|
|
|
|
|
+ /* Fold texts by columns that are at the given positions. */
|
|
|
|
|
+ column_mode,
|
|
|
|
|
+
|
|
|
|
|
+ /* Fold texts by bytes that are at the given positions. */
|
|
|
|
|
+ byte_mode,
|
|
|
|
|
+
|
|
|
|
|
+ /* Fold texts by characters that are at the given positions. */
|
|
|
|
|
+ character_mode,
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/* The argument shows current mode. (Default: column_mode) */
|
|
|
|
|
+static enum operating_mode operating_mode;
|
|
|
|
|
+
|
|
|
|
|
/* If nonzero, try to break on whitespace. */
|
|
|
|
|
static bool break_spaces;
|
|
|
|
|
|
|
|
|
|
-/* If nonzero, count bytes, not column positions. */
|
|
|
|
|
-static bool count_bytes;
|
|
|
|
|
-
|
|
|
|
|
/* If nonzero, at least one of the files we read was standard input. */
|
|
|
|
|
static bool have_read_stdin;
|
|
|
|
|
|
|
|
|
|
-static char const shortopts[] = "bsw:0::1::2::3::4::5::6::7::8::9::";
|
|
|
|
|
+static char const shortopts[] = "bcsw:0::1::2::3::4::5::6::7::8::9::";
|
|
|
|
|
|
|
|
|
|
static struct option const longopts[] =
|
|
|
|
|
{
|
|
|
|
|
{"bytes", no_argument, NULL, 'b'},
|
|
|
|
|
+ {"characters", no_argument, NULL, 'c'},
|
|
|
|
|
{"spaces", no_argument, NULL, 's'},
|
|
|
|
|
{"width", required_argument, NULL, 'w'},
|
|
|
|
|
{GETOPT_HELP_OPTION_DECL},
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -77,6 +120,7 @@ Mandatory arguments to long options are
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
"), stdout);
|
|
|
|
|
fputs (_("\
|
|
|
|
|
-b, --bytes count bytes rather than columns\n\
|
|
|
|
|
+ -c, --characters count characters rather than columns\n\
|
|
|
|
|
-s, --spaces break at spaces\n\
|
|
|
|
|
-w, --width=WIDTH use WIDTH columns instead of 80\n\
|
|
|
|
|
"), stdout);
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -94,7 +138,7 @@ Mandatory arguments to long options are
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static size_t
|
|
|
|
|
adjust_column (size_t column, char c)
|
|
|
|
|
{
|
|
|
|
|
- if (!count_bytes)
|
|
|
|
|
+ if (operating_mode != byte_mode)
|
|
|
|
|
{
|
|
|
|
|
if (c == '\b')
|
|
|
|
|
{
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -117,30 +161,14 @@ adjust_column (size_t column, char c)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
to stdout, with maximum line length WIDTH.
|
|
|
|
|
Return true if successful. */
|
|
|
|
|
|
|
|
|
|
-static bool
|
|
|
|
|
-fold_file (char const *filename, size_t width)
|
|
|
|
|
+static void
|
|
|
|
|
+fold_text (FILE *istream, size_t width, int *saved_errno)
|
|
|
|
|
{
|
|
|
|
|
- FILE *istream;
|
|
|
|
|
int c;
|
|
|
|
|
size_t column = 0; /* Screen column where next char will go. */
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
size_t offset_out = 0; /* Index in 'line_out' for next char. */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static char *line_out = NULL;
|
|
|
|
|
static size_t allocated_out = 0;
|
|
|
|
|
- int saved_errno;
|
|
|
|
|
-
|
|
|
|
|
- if (STREQ (filename, "-"))
|
|
|
|
|
- {
|
|
|
|
|
- istream = stdin;
|
|
|
|
|
- have_read_stdin = true;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- istream = fopen (filename, "r");
|
|
|
|
|
-
|
|
|
|
|
- if (istream == NULL)
|
|
|
|
|
- {
|
|
|
|
|
- error (0, errno, "%s", filename);
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
2011-01-03 20:39:07 +01:00
|
|
|
|
fadvise (istream, FADVISE_SEQUENTIAL);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -170,6 +198,15 @@ fold_file (char const *filename, size_t
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
bool found_blank = false;
|
|
|
|
|
size_t logical_end = offset_out;
|
|
|
|
|
|
|
|
|
|
+ /* If LINE_OUT has no wide character,
|
|
|
|
|
+ put a new wide character in LINE_OUT
|
|
|
|
|
+ if column is bigger than width. */
|
|
|
|
|
+ if (offset_out == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ line_out[offset_out++] = c;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
/* Look for the last blank. */
|
|
|
|
|
while (logical_end)
|
|
|
|
|
{
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -216,11 +253,222 @@ fold_file (char const *filename, size_t
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
line_out[offset_out++] = c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- saved_errno = errno;
|
|
|
|
|
+ *saved_errno = errno;
|
|
|
|
|
+
|
|
|
|
|
+ if (offset_out)
|
|
|
|
|
+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static void
|
|
|
|
|
+fold_multibyte_text (FILE *istream, size_t width, int *saved_errno)
|
|
|
|
|
+{
|
|
|
|
|
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
|
|
|
|
+ size_t buflen = 0; /* The length of the byte sequence in buf. */
|
|
|
|
|
+ char *bufpos = NULL; /* Next read position of BUF. */
|
|
|
|
|
+ wint_t wc; /* A gotten wide character. */
|
|
|
|
|
+ size_t mblength; /* The byte size of a multibyte character which shows
|
|
|
|
|
+ as same character as WC. */
|
|
|
|
|
+ mbstate_t state, state_bak; /* State of the stream. */
|
|
|
|
|
+ int convfail; /* 1, when conversion is failed. Otherwise 0. */
|
|
|
|
|
+
|
|
|
|
|
+ static char *line_out = NULL;
|
|
|
|
|
+ size_t offset_out = 0; /* Index in `line_out' for next char. */
|
|
|
|
|
+ static size_t allocated_out = 0;
|
|
|
|
|
+
|
|
|
|
|
+ int increment;
|
|
|
|
|
+ size_t column = 0;
|
|
|
|
|
+
|
|
|
|
|
+ size_t last_blank_pos;
|
|
|
|
|
+ size_t last_blank_column;
|
|
|
|
|
+ int is_blank_seen;
|
|
|
|
|
+ int last_blank_increment = 0;
|
|
|
|
|
+ int is_bs_following_last_blank;
|
|
|
|
|
+ size_t bs_following_last_blank_num;
|
|
|
|
|
+ int is_cr_after_last_blank;
|
|
|
|
|
+
|
|
|
|
|
+#define CLEAR_FLAGS \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ last_blank_pos = 0; \
|
|
|
|
|
+ last_blank_column = 0; \
|
|
|
|
|
+ is_blank_seen = 0; \
|
|
|
|
|
+ is_bs_following_last_blank = 0; \
|
|
|
|
|
+ bs_following_last_blank_num = 0; \
|
|
|
|
|
+ is_cr_after_last_blank = 0; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+
|
|
|
|
|
+#define START_NEW_LINE \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ putchar ('\n'); \
|
|
|
|
|
+ column = 0; \
|
|
|
|
|
+ offset_out = 0; \
|
|
|
|
|
+ CLEAR_FLAGS; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+
|
|
|
|
|
+ CLEAR_FLAGS;
|
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ for (;; bufpos += mblength, buflen -= mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (buflen < MB_LEN_MAX && !feof (istream) && !ferror (istream))
|
|
|
|
|
+ {
|
|
|
|
|
+ memmove (buf, bufpos, buflen);
|
|
|
|
|
+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, istream);
|
|
|
|
|
+ bufpos = buf;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (buflen < 1)
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ /* Get a wide character. */
|
|
|
|
|
+ convfail = 0;
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state);
|
|
|
|
|
+
|
|
|
|
|
+ switch (mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ case (size_t)-1:
|
|
|
|
|
+ case (size_t)-2:
|
|
|
|
|
+ convfail++;
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ /* Fall through. */
|
|
|
|
|
+
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+rescan:
|
|
|
|
|
+ if (operating_mode == byte_mode) /* byte mode */
|
|
|
|
|
+ increment = mblength;
|
|
|
|
|
+ else if (operating_mode == character_mode) /* character mode */
|
|
|
|
|
+ increment = 1;
|
|
|
|
|
+ else /* column mode */
|
|
|
|
|
+ {
|
|
|
|
|
+ if (convfail)
|
|
|
|
|
+ increment = 1;
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ switch (wc)
|
|
|
|
|
+ {
|
|
|
|
|
+ case L'\n':
|
|
|
|
|
+ fwrite (line_out, sizeof(char), offset_out, stdout);
|
|
|
|
|
+ START_NEW_LINE;
|
|
|
|
|
+ continue;
|
|
|
|
|
+
|
|
|
|
|
+ case L'\b':
|
|
|
|
|
+ increment = (column > 0) ? -1 : 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case L'\r':
|
|
|
|
|
+ increment = -1 * column;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case L'\t':
|
|
|
|
|
+ increment = 8 - column % 8;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ increment = wcwidth (wc);
|
|
|
|
|
+ increment = (increment < 0) ? 0 : increment;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (column + increment > width && break_spaces && last_blank_pos)
|
|
|
|
|
+ {
|
|
|
|
|
+ fwrite (line_out, sizeof(char), last_blank_pos, stdout);
|
|
|
|
|
+ putchar ('\n');
|
|
|
|
|
+
|
|
|
|
|
+ offset_out = offset_out - last_blank_pos;
|
|
|
|
|
+ column = column - last_blank_column + ((is_cr_after_last_blank)
|
|
|
|
|
+ ? last_blank_increment : bs_following_last_blank_num);
|
|
|
|
|
+ memmove (line_out, line_out + last_blank_pos, offset_out);
|
|
|
|
|
+ CLEAR_FLAGS;
|
|
|
|
|
+ goto rescan;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (column + increment > width && column != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ fwrite (line_out, sizeof(char), offset_out, stdout);
|
|
|
|
|
+ START_NEW_LINE;
|
|
|
|
|
+ goto rescan;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (allocated_out < offset_out + mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ line_out = X2REALLOC (line_out, &allocated_out);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ memcpy (line_out + offset_out, bufpos, mblength);
|
|
|
|
|
+ offset_out += mblength;
|
|
|
|
|
+ column += increment;
|
|
|
|
|
+
|
|
|
|
|
+ if (is_blank_seen && !convfail && wc == L'\r')
|
|
|
|
|
+ is_cr_after_last_blank = 1;
|
|
|
|
|
+
|
|
|
|
|
+ if (is_bs_following_last_blank && !convfail && wc == L'\b')
|
|
|
|
|
+ ++bs_following_last_blank_num;
|
|
|
|
|
+ else
|
|
|
|
|
+ is_bs_following_last_blank = 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (break_spaces && !convfail && iswblank (wc))
|
|
|
|
|
+ {
|
|
|
|
|
+ last_blank_pos = offset_out;
|
|
|
|
|
+ last_blank_column = column;
|
|
|
|
|
+ is_blank_seen = 1;
|
|
|
|
|
+ last_blank_increment = increment;
|
|
|
|
|
+ is_bs_following_last_blank = 1;
|
|
|
|
|
+ bs_following_last_blank_num = 0;
|
|
|
|
|
+ is_cr_after_last_blank = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ *saved_errno = errno;
|
|
|
|
|
|
|
|
|
|
if (offset_out)
|
|
|
|
|
fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
|
|
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Fold file FILENAME, or standard input if FILENAME is "-",
|
|
|
|
|
+ to stdout, with maximum line length WIDTH.
|
|
|
|
|
+ Return 0 if successful, 1 if an error occurs. */
|
|
|
|
|
+
|
|
|
|
|
+static bool
|
|
|
|
|
+fold_file (char *filename, size_t width)
|
|
|
|
|
+{
|
|
|
|
|
+ FILE *istream;
|
|
|
|
|
+ int saved_errno;
|
|
|
|
|
+
|
|
|
|
|
+ if (STREQ (filename, "-"))
|
|
|
|
|
+ {
|
|
|
|
|
+ istream = stdin;
|
|
|
|
|
+ have_read_stdin = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ istream = fopen (filename, "r");
|
|
|
|
|
+
|
|
|
|
|
+ if (istream == NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ error (0, errno, "%s", filename);
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* Define how ISTREAM is being folded. */
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ fold_multibyte_text (istream, width, &saved_errno);
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ fold_text (istream, width, &saved_errno);
|
|
|
|
|
+
|
|
|
|
|
if (ferror (istream))
|
|
|
|
|
{
|
|
|
|
|
error (0, saved_errno, "%s", filename);
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -253,7 +501,8 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
atexit (close_stdout);
|
|
|
|
|
|
|
|
|
|
- break_spaces = count_bytes = have_read_stdin = false;
|
|
|
|
|
+ operating_mode = column_mode;
|
|
|
|
|
+ break_spaces = have_read_stdin = false;
|
|
|
|
|
|
|
|
|
|
while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
|
|
|
|
|
{
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -262,7 +511,15 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
switch (optc)
|
|
|
|
|
{
|
|
|
|
|
case 'b': /* Count bytes rather than columns. */
|
|
|
|
|
- count_bytes = true;
|
|
|
|
|
+ if (operating_mode != column_mode)
|
|
|
|
|
+ FATAL_ERROR (_("only one way of folding may be specified"));
|
|
|
|
|
+ operating_mode = byte_mode;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case 'c':
|
|
|
|
|
+ if (operating_mode != column_mode)
|
|
|
|
|
+ FATAL_ERROR (_("only one way of folding may be specified"));
|
|
|
|
|
+ operating_mode = character_mode;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 's': /* Break at word boundaries. */
|
|
|
|
|
Index: src/join.c
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- src/join.c.orig
|
|
|
|
|
+++ src/join.c
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -22,18 +22,32 @@
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
|
|
|
|
|
+/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth(). */
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Get iswblank(), towupper. */
|
|
|
|
|
+#if HAVE_WCTYPE_H
|
|
|
|
|
+# include <wctype.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "error.h"
|
|
|
|
|
#include "fadvise.h"
|
|
|
|
|
#include "hard-locale.h"
|
|
|
|
|
#include "linebuffer.h"
|
|
|
|
|
-#include "memcasecmp.h"
|
|
|
|
|
#include "quote.h"
|
|
|
|
|
#include "stdio--.h"
|
|
|
|
|
#include "xmemcoll.h"
|
|
|
|
|
#include "xstrtol.h"
|
|
|
|
|
#include "argmatch.h"
|
|
|
|
|
|
|
|
|
|
+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
|
|
|
|
|
+#if HAVE_MBRTOWC && defined mbstate_t
|
|
|
|
|
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* The official name of this program (e.g., no 'g' prefix). */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#define PROGRAM_NAME "join"
|
|
|
|
|
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
@@ -135,10 +149,12 @@ static struct outlist outlist_head;
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* Last element in 'outlist', where a new element can be added. */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static struct outlist *outlist_end = &outlist_head;
|
|
|
|
|
|
|
|
|
|
-/* Tab character separating fields. If negative, fields are separated
|
|
|
|
|
- by any nonempty string of blanks, otherwise by exactly one
|
|
|
|
|
- tab character whose value (when cast to unsigned char) equals TAB. */
|
|
|
|
|
-static int tab = -1;
|
|
|
|
|
+/* Tab character separating fields. If NULL, fields are separated
|
|
|
|
|
+ by any nonempty string of blanks. */
|
|
|
|
|
+static char *tab = NULL;
|
|
|
|
|
+
|
|
|
|
|
+/* The number of bytes used for tab. */
|
|
|
|
|
+static size_t tablen = 0;
|
|
|
|
|
|
|
|
|
|
/* If nonzero, check that the input is correctly ordered. */
|
|
|
|
|
static enum
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -262,13 +278,14 @@ xfields (struct line *line)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
if (ptr == lim)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
- if (0 <= tab && tab != '\n')
|
|
|
|
|
+ if (tab != NULL)
|
|
|
|
|
{
|
|
|
|
|
+ unsigned char t = tab[0];
|
|
|
|
|
char *sep;
|
|
|
|
|
- for (; (sep = memchr (ptr, tab, lim - ptr)) != NULL; ptr = sep + 1)
|
|
|
|
|
+ for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1)
|
|
|
|
|
extract_field (line, ptr, sep - ptr);
|
|
|
|
|
}
|
|
|
|
|
- else if (tab < 0)
|
|
|
|
|
+ else
|
|
|
|
|
{
|
|
|
|
|
/* Skip leading blanks before the first field. */
|
|
|
|
|
while (isblank (to_uchar (*ptr)))
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -292,6 +309,148 @@ xfields (struct line *line)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
extract_field (line, ptr, lim - ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static void
|
|
|
|
|
+xfields_multibyte (struct line *line)
|
|
|
|
|
+{
|
|
|
|
|
+ char *ptr = line->buf.buffer;
|
|
|
|
|
+ char const *lim = ptr + line->buf.length - 1;
|
|
|
|
|
+ wchar_t wc = 0;
|
|
|
|
|
+ size_t mblength = 1;
|
|
|
|
|
+ mbstate_t state, state_bak;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, 0, sizeof (mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ if (ptr >= lim)
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ if (tab != NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ unsigned char t = tab[0];
|
|
|
|
|
+ char *sep = ptr;
|
|
|
|
|
+ for (; ptr < lim; ptr = sep + mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ sep = ptr;
|
|
|
|
|
+ while (sep < lim)
|
|
|
|
|
+ {
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
|
|
|
|
|
+
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ }
|
|
|
|
|
+ mblength = (mblength < 1) ? 1 : mblength;
|
|
|
|
|
+
|
|
|
|
|
+ if (mblength == tablen && !memcmp (sep, tab, mblength))
|
|
|
|
|
+ break;
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ sep += mblength;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (sep >= lim)
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ extract_field (line, ptr, sep - ptr);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ /* Skip leading blanks before the first field. */
|
|
|
|
|
+ while(ptr < lim)
|
|
|
|
|
+ {
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
|
|
|
|
|
+
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ mblength = (mblength < 1) ? 1 : mblength;
|
|
|
|
|
+
|
|
|
|
|
+ if (!iswblank(wc))
|
|
|
|
|
+ break;
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ do
|
|
|
|
|
+ {
|
|
|
|
|
+ char *sep;
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ mblength = (mblength < 1) ? 1 : mblength;
|
|
|
|
|
+
|
|
|
|
|
+ sep = ptr + mblength;
|
|
|
|
|
+ while (sep < lim)
|
|
|
|
|
+ {
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ mblength = (mblength < 1) ? 1 : mblength;
|
|
|
|
|
+
|
|
|
|
|
+ if (iswblank (wc))
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ sep += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ extract_field (line, ptr, sep - ptr);
|
|
|
|
|
+ if (sep >= lim)
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ mblength = (mblength < 1) ? 1 : mblength;
|
|
|
|
|
+
|
|
|
|
|
+ ptr = sep + mblength;
|
|
|
|
|
+ while (ptr < lim)
|
|
|
|
|
+ {
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ mblength = (mblength < 1) ? 1 : mblength;
|
|
|
|
|
+
|
|
|
|
|
+ if (!iswblank (wc))
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ while (ptr < lim);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ extract_field (line, ptr, lim - ptr);
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
static void
|
|
|
|
|
freeline (struct line *line)
|
|
|
|
|
{
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -313,56 +472,130 @@ keycmp (struct line const *line1, struct
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
size_t jf_1, size_t jf_2)
|
|
|
|
|
{
|
|
|
|
|
/* Start of field to compare in each file. */
|
|
|
|
|
- char *beg1;
|
|
|
|
|
- char *beg2;
|
|
|
|
|
-
|
|
|
|
|
- size_t len1;
|
|
|
|
|
- size_t len2; /* Length of fields to compare. */
|
|
|
|
|
+ char *beg[2];
|
|
|
|
|
+ char *copy[2];
|
|
|
|
|
+ size_t len[2]; /* Length of fields to compare. */
|
|
|
|
|
int diff;
|
|
|
|
|
+ int i, j;
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ int mallocd = 0;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
if (jf_1 < line1->nfields)
|
|
|
|
|
{
|
|
|
|
|
- beg1 = line1->fields[jf_1].beg;
|
|
|
|
|
- len1 = line1->fields[jf_1].len;
|
|
|
|
|
+ beg[0] = line1->fields[jf_1].beg;
|
|
|
|
|
+ len[0] = line1->fields[jf_1].len;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
- beg1 = NULL;
|
|
|
|
|
- len1 = 0;
|
|
|
|
|
+ beg[0] = NULL;
|
|
|
|
|
+ len[0] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (jf_2 < line2->nfields)
|
|
|
|
|
{
|
|
|
|
|
- beg2 = line2->fields[jf_2].beg;
|
|
|
|
|
- len2 = line2->fields[jf_2].len;
|
|
|
|
|
+ beg[1] = line2->fields[jf_2].beg;
|
|
|
|
|
+ len[1] = line2->fields[jf_2].len;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
- beg2 = NULL;
|
|
|
|
|
- len2 = 0;
|
|
|
|
|
+ beg[1] = NULL;
|
|
|
|
|
+ len[1] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- if (len1 == 0)
|
|
|
|
|
- return len2 == 0 ? 0 : -1;
|
|
|
|
|
- if (len2 == 0)
|
|
|
|
|
+ if (len[0] == 0)
|
|
|
|
|
+ return len[1] == 0 ? 0 : -1;
|
|
|
|
|
+ if (len[1] == 0)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
if (ignore_case)
|
|
|
|
|
{
|
|
|
|
|
- /* FIXME: ignore_case does not work with NLS (in particular,
|
|
|
|
|
- with multibyte chars). */
|
|
|
|
|
- diff = memcasecmp (beg1, beg2, MIN (len1, len2));
|
|
|
|
|
+#ifdef HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ wchar_t wc, uwc;
|
|
|
|
|
+ mbstate_t state, state_bak;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, '\0', sizeof (mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < 2; i++)
|
|
|
|
|
+ {
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ mallocd = 1;
|
|
|
|
|
+ copy[i] = xmalloc (len[i] + 1);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
|
|
|
|
+ for (j = 0; j < MIN (len[0], len[1]);)
|
|
|
|
|
+ {
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mblength = mbrtowc (&wc, beg[i] + j, len[i] - j, &state);
|
|
|
|
|
+
|
|
|
|
|
+ switch (mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ case (size_t) -1:
|
|
|
|
|
+ case (size_t) -2:
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ /* Fall through */
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ uwc = towupper (wc);
|
|
|
|
|
+
|
|
|
|
|
+ if (uwc != wc)
|
|
|
|
|
+ {
|
|
|
|
|
+ mbstate_t state_wc;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state_wc, '\0', sizeof (mbstate_t));
|
|
|
|
|
+ wcrtomb (copy[i] + j, uwc, &state_wc);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ memcpy (copy[i] + j, beg[i] + j, mblength);
|
|
|
|
|
+ }
|
|
|
|
|
+ j += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ copy[i][j] = '\0';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ for (i = 0; i < 2; i++)
|
|
|
|
|
+ {
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ mallocd = 1;
|
|
|
|
|
+ copy[i] = xmalloc (len[i] + 1);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
|
|
|
|
+ for (j = 0; j < MIN (len[0], len[1]); j++)
|
|
|
|
|
+ copy[i][j] = toupper (beg[i][j]);
|
|
|
|
|
+
|
|
|
|
|
+ copy[i][j] = '\0';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
- if (hard_LC_COLLATE)
|
|
|
|
|
- return xmemcoll (beg1, len1, beg2, len2);
|
|
|
|
|
- diff = memcmp (beg1, beg2, MIN (len1, len2));
|
|
|
|
|
+ copy[0] = (unsigned char *) beg[0];
|
|
|
|
|
+ copy[1] = (unsigned char *) beg[1];
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (hard_LC_COLLATE)
|
|
|
|
|
+ {
|
|
|
|
|
+ diff = xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]);
|
|
|
|
|
+
|
|
|
|
|
+ if (mallocd)
|
|
|
|
|
+ for (i = 0; i < 2; i++)
|
|
|
|
|
+ free (copy[i]);
|
|
|
|
|
+
|
|
|
|
|
+ return diff;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ diff = memcmp (copy[0], copy[1], MIN (len[0], len[1]));
|
|
|
|
|
+
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ if (mallocd)
|
|
|
|
|
+ for (i = 0; i < 2; i++)
|
|
|
|
|
+ free (copy[i]);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
|
|
|
|
if (diff)
|
|
|
|
|
return diff;
|
|
|
|
|
- return len1 < len2 ? -1 : len1 != len2;
|
|
|
|
|
+ return len[0] - len[1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Check that successive input lines PREV and CURRENT from input file
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -454,6 +687,12 @@ get_line (FILE *fp, struct line **linep,
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
++line_no[which - 1];
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ xfields_multibyte (line);
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
+
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
xfields (line);
|
|
|
|
|
|
|
|
|
|
if (prevline[which - 1])
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -552,22 +791,29 @@ prfield (size_t n, struct line const *li
|
2011-02-10 17:07:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Output all the fields in line, other than the join field. */
|
|
|
|
|
+#define PUT_TAB_CHAR \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ (tab != NULL) ? \
|
|
|
|
|
+ fwrite(tab, sizeof(char), tablen, stdout) : putchar (' '); \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
prfields (struct line const *line, size_t join_field, size_t autocount)
|
|
|
|
|
{
|
|
|
|
|
size_t i;
|
|
|
|
|
size_t nfields = autoformat ? autocount : line->nfields;
|
|
|
|
|
- char output_separator = tab < 0 ? ' ' : tab;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < join_field && i < nfields; ++i)
|
|
|
|
|
{
|
|
|
|
|
- putchar (output_separator);
|
|
|
|
|
+ PUT_TAB_CHAR;
|
|
|
|
|
prfield (i, line);
|
|
|
|
|
}
|
|
|
|
|
for (i = join_field + 1; i < nfields; ++i)
|
|
|
|
|
{
|
|
|
|
|
- putchar (output_separator);
|
|
|
|
|
+ PUT_TAB_CHAR;
|
|
|
|
|
prfield (i, line);
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -578,7 +824,6 @@ static void
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
prjoin (struct line const *line1, struct line const *line2)
|
|
|
|
|
{
|
|
|
|
|
const struct outlist *outlist;
|
|
|
|
|
- char output_separator = tab < 0 ? ' ' : tab;
|
- Update to 8.10:
* Bug fixes
- du would abort with a failed assertion when two conditions are
met: part of the hierarchy being traversed is moved to a higher
level in the directory tree, and there is at least one more
command line directory argument following the one containing
the moved sub-tree. [bug introduced in coreutils-5.1.0]
- join --header now skips the ordering check for the first line
even if the other file is empty. [bug introduced in
coreutils-8.5]
- rm -f no longer fails for EINVAL or EILSEQ on file systems that
reject file names invalid for that file system.
- uniq -f NUM no longer tries to process fields after end of
line. [bug introduced in coreutils-7.0]
* New features
- cp now copies sparse files efficiently on file systems with
FIEMAP support (ext4, btrfs, xfs, ocfs2). Before, it had to
read 2^20 bytes when copying a 1MiB sparse file. Now, it
copies bytes only for the non-sparse sections of a file.
Similarly, to induce a hole in the output file, it had to
detect a long sequence of zero bytes. Now, it knows precisely
where each hole in an input file is, and can reproduce them
efficiently in the output file. mv also benefits when it
resorts to copying, e.g., between file systems.
- join now supports -o 'auto' which will automatically infer the
output format from the first line in each file, to ensure the
same number of fields are output for each line.
* Changes in behavior
- join no longer reports disorder when one of the files is empty.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=85
2011-02-10 11:50:29 +01:00
|
|
|
|
size_t field;
|
|
|
|
|
struct line const *line;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -612,7 +857,7 @@ prjoin (struct line const *line1, struct
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
o = o->next;
|
|
|
|
|
if (o == NULL)
|
|
|
|
|
break;
|
|
|
|
|
- putchar (output_separator);
|
|
|
|
|
+ PUT_TAB_CHAR;
|
|
|
|
|
}
|
|
|
|
|
putchar ('\n');
|
|
|
|
|
}
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -1090,21 +1335,46 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
case 't':
|
|
|
|
|
{
|
|
|
|
|
- unsigned char newtab = optarg[0];
|
|
|
|
|
+ char *newtab;
|
|
|
|
|
+ size_t newtablen;
|
|
|
|
|
+ newtab = xstrdup (optarg);
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ mbstate_t state;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, 0, sizeof (mbstate_t));
|
|
|
|
|
+ newtablen = mbrtowc (NULL, newtab,
|
|
|
|
|
+ strnlen (newtab, MB_LEN_MAX),
|
|
|
|
|
+ &state);
|
|
|
|
|
+ if (newtablen == (size_t) 0
|
|
|
|
|
+ || newtablen == (size_t) -1
|
|
|
|
|
+ || newtablen == (size_t) -2)
|
|
|
|
|
+ newtablen = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ newtablen = 1;
|
|
|
|
|
if (! newtab)
|
|
|
|
|
+ {
|
|
|
|
|
newtab = '\n'; /* '' => process the whole line. */
|
|
|
|
|
+ }
|
|
|
|
|
else if (optarg[1])
|
|
|
|
|
{
|
|
|
|
|
- if (STREQ (optarg, "\\0"))
|
|
|
|
|
- newtab = '\0';
|
|
|
|
|
- else
|
|
|
|
|
- error (EXIT_FAILURE, 0, _("multi-character tab %s"),
|
|
|
|
|
- quote (optarg));
|
|
|
|
|
+ if (newtablen == 1 && newtab[1])
|
|
|
|
|
+ {
|
|
|
|
|
+ if (STREQ (newtab, "\\0"))
|
|
|
|
|
+ newtab[0] = '\0';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (tab != NULL && strcmp (tab, newtab))
|
|
|
|
|
+ {
|
|
|
|
|
+ free (newtab);
|
|
|
|
|
+ error (EXIT_FAILURE, 0, _("incompatible tabs"));
|
|
|
|
|
}
|
|
|
|
|
- if (0 <= tab && tab != newtab)
|
|
|
|
|
- error (EXIT_FAILURE, 0, _("incompatible tabs"));
|
|
|
|
|
tab = newtab;
|
|
|
|
|
- }
|
|
|
|
|
+ tablen = newtablen;
|
|
|
|
|
+ }
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NOCHECK_ORDER_OPTION:
|
|
|
|
|
Index: src/pr.c
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- src/pr.c.orig
|
|
|
|
|
+++ src/pr.c
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -312,6 +312,32 @@
|
|
|
|
|
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
+
|
|
|
|
|
+/* Get MB_LEN_MAX. */
|
|
|
|
|
+#include <limits.h>
|
|
|
|
|
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
|
|
|
|
|
+ installation; work around this configuration error. */
|
|
|
|
|
+#if !defined MB_LEN_MAX || MB_LEN_MAX == 1
|
|
|
|
|
+# define MB_LEN_MAX 16
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Get MB_CUR_MAX. */
|
|
|
|
|
+#include <stdlib.h>
|
|
|
|
|
+
|
|
|
|
|
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
|
|
|
|
|
+/* Get mbstate_t, mbrtowc(), wcwidth(). */
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Get iswprint(). -- for wcwidth(). */
|
|
|
|
|
+#if HAVE_WCTYPE_H
|
|
|
|
|
+# include <wctype.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+#if !defined iswprint && !HAVE_ISWPRINT
|
|
|
|
|
+# define iswprint(wc) 1
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "error.h"
|
|
|
|
|
#include "fadvise.h"
|
|
|
|
|
@@ -323,6 +349,18 @@
|
|
|
|
|
#include "strftime.h"
|
|
|
|
|
#include "xstrtol.h"
|
|
|
|
|
|
|
|
|
|
+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
|
|
|
|
|
+#if HAVE_MBRTOWC && defined mbstate_t
|
|
|
|
|
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+#ifndef HAVE_DECL_WCWIDTH
|
|
|
|
|
+"this configure-time declaration test was not run"
|
|
|
|
|
+#endif
|
|
|
|
|
+#if !HAVE_DECL_WCWIDTH
|
|
|
|
|
+extern int wcwidth ();
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* The official name of this program (e.g., no 'g' prefix). */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#define PROGRAM_NAME "pr"
|
|
|
|
|
|
|
|
|
|
@@ -415,7 +453,20 @@ struct COLUMN
|
|
|
|
|
|
|
|
|
|
typedef struct COLUMN COLUMN;
|
|
|
|
|
|
|
|
|
|
-static int char_to_clump (char c);
|
|
|
|
|
+/* Funtion pointers to switch functions for single byte locale or for
|
|
|
|
|
+ multibyte locale. If multibyte functions do not exist in your sysytem,
|
|
|
|
|
+ these pointers always point the function for single byte locale. */
|
|
|
|
|
+static void (*print_char) (char c);
|
|
|
|
|
+static int (*char_to_clump) (char c);
|
|
|
|
|
+
|
|
|
|
|
+/* Functions for single byte locale. */
|
|
|
|
|
+static void print_char_single (char c);
|
|
|
|
|
+static int char_to_clump_single (char c);
|
|
|
|
|
+
|
|
|
|
|
+/* Functions for multibyte locale. */
|
|
|
|
|
+static void print_char_multi (char c);
|
|
|
|
|
+static int char_to_clump_multi (char c);
|
|
|
|
|
+
|
|
|
|
|
static bool read_line (COLUMN *p);
|
|
|
|
|
static bool print_page (void);
|
|
|
|
|
static bool print_stored (COLUMN *p);
|
|
|
|
|
@@ -425,6 +476,7 @@ static void print_header (void);
|
|
|
|
|
static void pad_across_to (int position);
|
|
|
|
|
static void add_line_number (COLUMN *p);
|
|
|
|
|
static void getoptarg (char *arg, char switch_char, char *character,
|
|
|
|
|
+ int *character_length, int *character_width,
|
|
|
|
|
int *number);
|
|
|
|
|
static void print_files (int number_of_files, char **av);
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
static void init_parameters (int number_of_files);
|
|
|
|
|
@@ -438,7 +490,6 @@ static void store_char (char c);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static void pad_down (int lines);
|
|
|
|
|
static void read_rest_of_line (COLUMN *p);
|
|
|
|
|
static void skip_read (COLUMN *p, int column_number);
|
|
|
|
|
-static void print_char (char c);
|
|
|
|
|
static void cleanup (void);
|
|
|
|
|
static void print_sep_string (void);
|
|
|
|
|
static void separator_string (const char *optarg_S);
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -450,7 +501,7 @@ static COLUMN *column_vector;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
we store the leftmost columns contiguously in buff.
|
|
|
|
|
To print a line from buff, get the index of the first character
|
|
|
|
|
from line_vector[i], and print up to line_vector[i + 1]. */
|
|
|
|
|
-static char *buff;
|
|
|
|
|
+static unsigned char *buff;
|
|
|
|
|
|
|
|
|
|
/* Index of the position in buff where the next character
|
|
|
|
|
will be stored. */
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -554,7 +605,7 @@ static int chars_per_column;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static bool untabify_input = false;
|
|
|
|
|
|
|
|
|
|
/* (-e) The input tab character. */
|
|
|
|
|
-static char input_tab_char = '\t';
|
|
|
|
|
+static char input_tab_char[MB_LEN_MAX] = "\t";
|
|
|
|
|
|
|
|
|
|
/* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
|
|
|
|
|
where the leftmost column is 1. */
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -564,7 +615,10 @@ static int chars_per_input_tab = 8;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static bool tabify_output = false;
|
|
|
|
|
|
|
|
|
|
/* (-i) The output tab character. */
|
|
|
|
|
-static char output_tab_char = '\t';
|
|
|
|
|
+static char output_tab_char[MB_LEN_MAX] = "\t";
|
|
|
|
|
+
|
|
|
|
|
+/* (-i) The byte length of output tab character. */
|
|
|
|
|
+static int output_tab_char_length = 1;
|
|
|
|
|
|
|
|
|
|
/* (-i) The width of the output tab. */
|
|
|
|
|
static int chars_per_output_tab = 8;
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -638,7 +692,13 @@ static int power_10;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static bool numbered_lines = false;
|
|
|
|
|
|
|
|
|
|
/* (-n) Character which follows each line number. */
|
|
|
|
|
-static char number_separator = '\t';
|
|
|
|
|
+static char number_separator[MB_LEN_MAX] = "\t";
|
|
|
|
|
+
|
|
|
|
|
+/* (-n) The byte length of the character which follows each line number. */
|
|
|
|
|
+static int number_separator_length = 1;
|
|
|
|
|
+
|
|
|
|
|
+/* (-n) The character width of the character which follows each line number. */
|
|
|
|
|
+static int number_separator_width = 0;
|
|
|
|
|
|
|
|
|
|
/* (-n) line counting starts with 1st line of input file (not with 1st
|
|
|
|
|
line of 1st page printed). */
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -691,6 +751,7 @@ static bool use_col_separator = false;
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
-a|COLUMN|-m is a 'space' and with the -J option a 'tab'. */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static char *col_sep_string = (char *) "";
|
|
|
|
|
static int col_sep_length = 0;
|
|
|
|
|
+static int col_sep_width = 0;
|
|
|
|
|
static char *column_separator = (char *) " ";
|
|
|
|
|
static char *line_separator = (char *) "\t";
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -847,6 +908,13 @@ separator_string (const char *optarg_S)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
col_sep_length = (int) strlen (optarg_S);
|
|
|
|
|
col_sep_string = xmalloc (col_sep_length + 1);
|
|
|
|
|
strcpy (col_sep_string, optarg_S);
|
|
|
|
|
+
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ col_sep_width = mbswidth (col_sep_string, 0);
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ col_sep_width = col_sep_length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -871,6 +939,21 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
atexit (close_stdout);
|
|
|
|
|
|
|
|
|
|
+/* Define which functions are used, the ones for single byte locale or the ones
|
|
|
|
|
+ for multibyte locale. */
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ print_char = print_char_multi;
|
|
|
|
|
+ char_to_clump = char_to_clump_multi;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ print_char = print_char_single;
|
|
|
|
|
+ char_to_clump = char_to_clump_single;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
n_files = 0;
|
|
|
|
|
file_names = (argc > 1
|
|
|
|
|
? xmalloc ((argc - 1) * sizeof (char *))
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -947,8 +1030,12 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
break;
|
|
|
|
|
case 'e':
|
|
|
|
|
if (optarg)
|
|
|
|
|
- getoptarg (optarg, 'e', &input_tab_char,
|
|
|
|
|
- &chars_per_input_tab);
|
|
|
|
|
+ {
|
|
|
|
|
+ int dummy_length, dummy_width;
|
|
|
|
|
+
|
|
|
|
|
+ getoptarg (optarg, 'e', input_tab_char, &dummy_length,
|
|
|
|
|
+ &dummy_width, &chars_per_input_tab);
|
|
|
|
|
+ }
|
|
|
|
|
/* Could check tab width > 0. */
|
|
|
|
|
untabify_input = true;
|
|
|
|
|
break;
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -961,8 +1048,12 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
break;
|
|
|
|
|
case 'i':
|
|
|
|
|
if (optarg)
|
|
|
|
|
- getoptarg (optarg, 'i', &output_tab_char,
|
|
|
|
|
- &chars_per_output_tab);
|
|
|
|
|
+ {
|
|
|
|
|
+ int dummy_width;
|
|
|
|
|
+
|
|
|
|
|
+ getoptarg (optarg, 'i', output_tab_char, &output_tab_char_length,
|
|
|
|
|
+ &dummy_width, &chars_per_output_tab);
|
|
|
|
|
+ }
|
|
|
|
|
/* Could check tab width > 0. */
|
|
|
|
|
tabify_output = true;
|
|
|
|
|
break;
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -989,8 +1080,8 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
case 'n':
|
|
|
|
|
numbered_lines = true;
|
|
|
|
|
if (optarg)
|
|
|
|
|
- getoptarg (optarg, 'n', &number_separator,
|
|
|
|
|
- &chars_per_number);
|
|
|
|
|
+ getoptarg (optarg, 'n', number_separator, &number_separator_length,
|
|
|
|
|
+ &number_separator_width, &chars_per_number);
|
|
|
|
|
break;
|
|
|
|
|
case 'N':
|
|
|
|
|
skip_count = false;
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -1029,7 +1120,7 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
old_s = false;
|
|
|
|
|
/* Reset an additional input of -s, -S dominates -s */
|
|
|
|
|
col_sep_string = bad_cast ("");
|
|
|
|
|
- col_sep_length = 0;
|
|
|
|
|
+ col_sep_length = col_sep_width = 0;
|
|
|
|
|
use_col_separator = true;
|
|
|
|
|
if (optarg)
|
|
|
|
|
separator_string (optarg);
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -1186,10 +1277,45 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
a number. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
-getoptarg (char *arg, char switch_char, char *character, int *number)
|
|
|
|
|
+getoptarg (char *arg, char switch_char, char *character, int *character_length,
|
|
|
|
|
+ int *character_width, int *number)
|
|
|
|
|
{
|
|
|
|
|
if (!ISDIGIT (*arg))
|
|
|
|
|
- *character = *arg++;
|
|
|
|
|
+ {
|
|
|
|
|
+#ifdef HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1) /* for multibyte locale. */
|
|
|
|
|
+ {
|
|
|
|
|
+ wchar_t wc;
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ int width;
|
|
|
|
|
+ mbstate_t state = {'\0'};
|
|
|
|
|
+
|
|
|
|
|
+ mblength = mbrtowc (&wc, arg, strnlen(arg, MB_LEN_MAX), &state);
|
|
|
|
|
+
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ *character_length = 1;
|
|
|
|
|
+ *character_width = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ *character_length = (mblength < 1) ? 1 : mblength;
|
|
|
|
|
+ width = wcwidth (wc);
|
|
|
|
|
+ *character_width = (width < 0) ? 0 : width;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ strncpy (character, arg, *character_length);
|
|
|
|
|
+ arg += *character_length;
|
|
|
|
|
+ }
|
|
|
|
|
+ else /* for single byte locale. */
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ *character = *arg++;
|
|
|
|
|
+ *character_length = 1;
|
|
|
|
|
+ *character_width = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
if (*arg)
|
|
|
|
|
{
|
|
|
|
|
long int tmp_long;
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -1248,7 +1374,7 @@ init_parameters (int number_of_files)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
else
|
|
|
|
|
col_sep_string = column_separator;
|
|
|
|
|
|
|
|
|
|
- col_sep_length = 1;
|
|
|
|
|
+ col_sep_length = col_sep_width = 1;
|
|
|
|
|
use_col_separator = true;
|
|
|
|
|
}
|
|
|
|
|
/* It's rather pointless to define a TAB separator with column
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -1279,11 +1405,11 @@ init_parameters (int number_of_files)
|
2012-06-19 14:54:24 +02:00
|
|
|
|
+ TAB_WIDTH (chars_per_input_tab, chars_per_number); */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
/* Estimate chars_per_text without any margin and keep it constant. */
|
|
|
|
|
- if (number_separator == '\t')
|
|
|
|
|
+ if (number_separator[0] == '\t')
|
2012-06-19 14:54:24 +02:00
|
|
|
|
number_width = (chars_per_number
|
|
|
|
|
+ TAB_WIDTH (chars_per_default_tab, chars_per_number));
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
else
|
|
|
|
|
- number_width = chars_per_number + 1;
|
|
|
|
|
+ number_width = chars_per_number + number_separator_width;
|
|
|
|
|
|
|
|
|
|
/* The number is part of the column width unless we are
|
|
|
|
|
printing files in parallel. */
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -1298,7 +1424,7 @@ init_parameters (int number_of_files)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-19 14:54:24 +02:00
|
|
|
|
chars_per_column = (chars_per_line - chars_used_by_number
|
|
|
|
|
- - (columns - 1) * col_sep_length) / columns;
|
|
|
|
|
+ - (columns - 1) * col_sep_width) / columns;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
if (chars_per_column < 1)
|
|
|
|
|
error (EXIT_FAILURE, 0, _("page width too narrow"));
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -1423,7 +1549,7 @@ init_funcs (void)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
/* Enlarge p->start_position of first column to use the same form of
|
|
|
|
|
padding_not_printed with all columns. */
|
|
|
|
|
- h = h + col_sep_length;
|
|
|
|
|
+ h = h + col_sep_width;
|
|
|
|
|
|
|
|
|
|
/* This loop takes care of all but the rightmost column. */
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -1457,7 +1583,7 @@ init_funcs (void)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
- h = h_next + col_sep_length;
|
|
|
|
|
+ h = h_next + col_sep_width;
|
|
|
|
|
h_next = h + chars_per_column;
|
|
|
|
|
}
|
|
|
|
|
}
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -1748,9 +1874,9 @@ static void
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
align_column (COLUMN *p)
|
|
|
|
|
{
|
|
|
|
|
padding_not_printed = p->start_position;
|
|
|
|
|
- if (padding_not_printed - col_sep_length > 0)
|
|
|
|
|
+ if (padding_not_printed - col_sep_width > 0)
|
|
|
|
|
{
|
|
|
|
|
- pad_across_to (padding_not_printed - col_sep_length);
|
|
|
|
|
+ pad_across_to (padding_not_printed - col_sep_width);
|
|
|
|
|
padding_not_printed = ANYWHERE;
|
|
|
|
|
}
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2021,13 +2147,13 @@ store_char (char c)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
/* May be too generous. */
|
|
|
|
|
buff = X2REALLOC (buff, &buff_allocated);
|
|
|
|
|
}
|
|
|
|
|
- buff[buff_current++] = c;
|
|
|
|
|
+ buff[buff_current++] = (unsigned char) c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
add_line_number (COLUMN *p)
|
|
|
|
|
{
|
|
|
|
|
- int i;
|
|
|
|
|
+ int i, j;
|
|
|
|
|
char *s;
|
|
|
|
|
int left_cut;
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2050,22 +2176,24 @@ add_line_number (COLUMN *p)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
/* Tabification is assumed for multiple columns, also for n-separators,
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
but 'default n-separator = TAB' hasn't been given priority over
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
equal column_width also specified by POSIX. */
|
|
|
|
|
- if (number_separator == '\t')
|
|
|
|
|
+ if (number_separator[0] == '\t')
|
|
|
|
|
{
|
|
|
|
|
i = number_width - chars_per_number;
|
|
|
|
|
while (i-- > 0)
|
|
|
|
|
(p->char_func) (' ');
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
- (p->char_func) (number_separator);
|
|
|
|
|
+ for (j = 0; j < number_separator_length; j++)
|
|
|
|
|
+ (p->char_func) (number_separator[j]);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
/* To comply with POSIX, we avoid any expansion of default TAB
|
|
|
|
|
separator with a single column output. No column_width requirement
|
|
|
|
|
has to be considered. */
|
|
|
|
|
{
|
|
|
|
|
- (p->char_func) (number_separator);
|
|
|
|
|
- if (number_separator == '\t')
|
|
|
|
|
+ for (j = 0; j < number_separator_length; j++)
|
|
|
|
|
+ (p->char_func) (number_separator[j]);
|
|
|
|
|
+ if (number_separator[0] == '\t')
|
|
|
|
|
output_position = POS_AFTER_TAB (chars_per_output_tab,
|
|
|
|
|
output_position);
|
|
|
|
|
}
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2226,7 +2354,7 @@ print_white_space (void)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
while (goal - h_old > 1
|
|
|
|
|
&& (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
|
|
|
|
|
{
|
|
|
|
|
- putchar (output_tab_char);
|
|
|
|
|
+ fwrite (output_tab_char, sizeof(char), output_tab_char_length, stdout);
|
|
|
|
|
h_old = h_new;
|
|
|
|
|
}
|
|
|
|
|
while (++h_old <= goal)
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2246,6 +2374,7 @@ print_sep_string (void)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
{
|
|
|
|
|
char *s;
|
|
|
|
|
int l = col_sep_length;
|
|
|
|
|
+ int not_space_flag;
|
|
|
|
|
|
|
|
|
|
s = col_sep_string;
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2259,6 +2388,7 @@ print_sep_string (void)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
{
|
|
|
|
|
for (; separators_not_printed > 0; --separators_not_printed)
|
|
|
|
|
{
|
|
|
|
|
+ not_space_flag = 0;
|
|
|
|
|
while (l-- > 0)
|
|
|
|
|
{
|
|
|
|
|
/* 3 types of sep_strings: spaces only, spaces and chars,
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2272,12 +2402,15 @@ print_sep_string (void)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
+ not_space_flag = 1;
|
|
|
|
|
if (spaces_not_printed > 0)
|
|
|
|
|
print_white_space ();
|
|
|
|
|
putchar (*s++);
|
|
|
|
|
- ++output_position;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
+ if (not_space_flag)
|
|
|
|
|
+ output_position += col_sep_width;
|
|
|
|
|
+
|
|
|
|
|
/* sep_string ends with some spaces */
|
|
|
|
|
if (spaces_not_printed > 0)
|
|
|
|
|
print_white_space ();
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2305,7 +2438,7 @@ print_clump (COLUMN *p, int n, char *clu
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
required number of tabs and spaces. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
-print_char (char c)
|
|
|
|
|
+print_char_single (char c)
|
|
|
|
|
{
|
|
|
|
|
if (tabify_output)
|
|
|
|
|
{
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2329,6 +2462,74 @@ print_char (char c)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
putchar (c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#ifdef HAVE_MBRTOWC
|
|
|
|
|
+static void
|
|
|
|
|
+print_char_multi (char c)
|
|
|
|
|
+{
|
|
|
|
|
+ static size_t mbc_pos = 0;
|
|
|
|
|
+ static char mbc[MB_LEN_MAX] = {'\0'};
|
|
|
|
|
+ static mbstate_t state = {'\0'};
|
|
|
|
|
+ mbstate_t state_bak;
|
|
|
|
|
+ wchar_t wc;
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ int width;
|
|
|
|
|
+
|
|
|
|
|
+ if (tabify_output)
|
|
|
|
|
+ {
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mbc[mbc_pos++] = c;
|
|
|
|
|
+ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
|
|
|
|
|
+
|
|
|
|
|
+ while (mbc_pos > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch (mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ case (size_t)-2:
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ case (size_t)-1:
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ ++output_position;
|
|
|
|
|
+ putchar (mbc[0]);
|
|
|
|
|
+ memmove (mbc, mbc + 1, MB_CUR_MAX - 1);
|
|
|
|
|
+ --mbc_pos;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ if (wc == L' ')
|
|
|
|
|
+ {
|
|
|
|
|
+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
|
|
|
|
|
+ --mbc_pos;
|
|
|
|
|
+ ++spaces_not_printed;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (spaces_not_printed > 0)
|
|
|
|
|
+ print_white_space ();
|
|
|
|
|
+
|
|
|
|
|
+ /* Nonprintables are assumed to have width 0, except L'\b'. */
|
|
|
|
|
+ if ((width = wcwidth (wc)) < 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (wc == L'\b')
|
|
|
|
|
+ --output_position;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ output_position += width;
|
|
|
|
|
+
|
|
|
|
|
+ fwrite (mbc, sizeof(char), mblength, stdout);
|
|
|
|
|
+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
|
|
|
|
|
+ mbc_pos -= mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ putchar (c);
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Skip to page PAGE before printing.
|
|
|
|
|
PAGE may be larger than total number of pages. */
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2508,9 +2709,9 @@ read_line (COLUMN *p)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
align_empty_cols = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- if (padding_not_printed - col_sep_length > 0)
|
|
|
|
|
+ if (padding_not_printed - col_sep_width > 0)
|
|
|
|
|
{
|
|
|
|
|
- pad_across_to (padding_not_printed - col_sep_length);
|
|
|
|
|
+ pad_across_to (padding_not_printed - col_sep_width);
|
|
|
|
|
padding_not_printed = ANYWHERE;
|
|
|
|
|
}
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2611,9 +2812,9 @@ print_stored (COLUMN *p)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- if (padding_not_printed - col_sep_length > 0)
|
|
|
|
|
+ if (padding_not_printed - col_sep_width > 0)
|
|
|
|
|
{
|
|
|
|
|
- pad_across_to (padding_not_printed - col_sep_length);
|
|
|
|
|
+ pad_across_to (padding_not_printed - col_sep_width);
|
|
|
|
|
padding_not_printed = ANYWHERE;
|
|
|
|
|
}
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2626,8 +2827,8 @@ print_stored (COLUMN *p)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
if (spaces_not_printed == 0)
|
|
|
|
|
{
|
|
|
|
|
output_position = p->start_position + end_vector[line];
|
|
|
|
|
- if (p->start_position - col_sep_length == chars_per_margin)
|
|
|
|
|
- output_position -= col_sep_length;
|
|
|
|
|
+ if (p->start_position - col_sep_width == chars_per_margin)
|
|
|
|
|
+ output_position -= col_sep_width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2646,7 +2847,7 @@ print_stored (COLUMN *p)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
number of characters is 1.) */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
-char_to_clump (char c)
|
|
|
|
|
+char_to_clump_single (char c)
|
|
|
|
|
{
|
|
|
|
|
unsigned char uc = c;
|
|
|
|
|
char *s = clump_buff;
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2656,10 +2857,10 @@ char_to_clump (char c)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
int chars;
|
|
|
|
|
int chars_per_c = 8;
|
|
|
|
|
|
|
|
|
|
- if (c == input_tab_char)
|
|
|
|
|
+ if (c == input_tab_char[0])
|
|
|
|
|
chars_per_c = chars_per_input_tab;
|
|
|
|
|
|
|
|
|
|
- if (c == input_tab_char || c == '\t')
|
|
|
|
|
+ if (c == input_tab_char[0] || c == '\t')
|
|
|
|
|
{
|
|
|
|
|
width = TAB_WIDTH (chars_per_c, input_position);
|
|
|
|
|
|
- Update to 8.15:
** New programs
realpath: print resolved file names.
** Bug fixes
du --one-file-system (-x) would ignore any non-directory specified on
the command line. For example, "touch f; du -x f" would print nothing.
[bug introduced in coreutils-8.14]
du -x no longer counts root directories of other file systems.
[bug introduced in coreutils-5.1.0]
ls --color many-entry-directory was uninterruptible for too long
[bug introduced in coreutils-5.2.1]
ls's -k option no longer affects how ls -l outputs file sizes.
It now affects only the per-directory block counts written by -l,
and the sizes written by -s. This is for compatibility with BSD
and with POSIX 2008. Because -k is no longer equivalent to
--block-size=1KiB, a new long option --kibibyte stands for -k.
[bug introduced in coreutils-4.5.4]
ls -l would leak a little memory (security context string) for each
nonempty directory listed on the command line, when using SELinux.
[bug probably introduced in coreutils-6.10 with SELinux support]
split -n 1/2 FILE no longer fails when operating on a growing file, or
(on some systems) when operating on a non-regular file like /dev/zero.
It would report "/dev/zero: No such file or directory" even though
the file obviously exists. Same for -n l/2.
[bug introduced in coreutils-8.8, with the addition of the -n option]
stat -f now recognizes the FhGFS and PipeFS file system types.
tac no longer fails to handle two or more non-seekable inputs
[bug introduced in coreutils-5.3.0]
tail -f no longer tries to use inotify on GPFS or FhGFS file systems
[you might say this was introduced in coreutils-7.5, along with inotify
support, but the new magic numbers weren't in the usual places then.]
** Changes in behavior
df avoids long UUID-including file system names in the default listing.
With recent enough kernel/tools, these long names would be used, pushing
second and subsequent columns far to the right. Now, when a long name
refers to a symlink, and no file systems are specified, df prints the
usually-short referent instead.
tail -f now uses polling (not inotify) when any of its file arguments
resides on a file system of unknown type. In addition, for each such
argument, tail -f prints a warning with the FS type magic number and a
request to report it to the bug-reporting address.
- Bring german message catalog up to date.
- Include upstream fix for du.
- Include upstream patch fixing basename documentation.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=144
2012-03-09 19:02:35 +01:00
|
|
|
|
@@ -2740,6 +2941,154 @@ char_to_clump (char c)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
return chars;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#ifdef HAVE_MBRTOWC
|
|
|
|
|
+static int
|
|
|
|
|
+char_to_clump_multi (char c)
|
|
|
|
|
+{
|
|
|
|
|
+ static size_t mbc_pos = 0;
|
|
|
|
|
+ static char mbc[MB_LEN_MAX] = {'\0'};
|
|
|
|
|
+ static mbstate_t state = {'\0'};
|
|
|
|
|
+ mbstate_t state_bak;
|
|
|
|
|
+ wchar_t wc;
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ int wc_width;
|
|
|
|
|
+ register char *s = clump_buff;
|
|
|
|
|
+ register int i, j;
|
|
|
|
|
+ char esc_buff[4];
|
|
|
|
|
+ int width;
|
|
|
|
|
+ int chars;
|
|
|
|
|
+ int chars_per_c = 8;
|
|
|
|
|
+
|
|
|
|
|
+ state_bak = state;
|
|
|
|
|
+ mbc[mbc_pos++] = c;
|
|
|
|
|
+ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
|
|
|
|
|
+
|
|
|
|
|
+ width = 0;
|
|
|
|
|
+ chars = 0;
|
|
|
|
|
+ while (mbc_pos > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch (mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ case (size_t)-2:
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
|
|
|
|
+ case (size_t)-1:
|
|
|
|
|
+ state = state_bak;
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+
|
|
|
|
|
+ if (use_esc_sequence || use_cntrl_prefix)
|
|
|
|
|
+ {
|
|
|
|
|
+ width = +4;
|
|
|
|
|
+ chars = +4;
|
|
|
|
|
+ *s++ = '\\';
|
|
|
|
|
+ sprintf (esc_buff, "%03o", mbc[0]);
|
|
|
|
|
+ for (i = 0; i <= 2; ++i)
|
|
|
|
|
+ *s++ = (int) esc_buff[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ width += 1;
|
|
|
|
|
+ chars += 1;
|
|
|
|
|
+ *s++ = mbc[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ /* Fall through */
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ if (memcmp (mbc, input_tab_char, mblength) == 0)
|
|
|
|
|
+ chars_per_c = chars_per_input_tab;
|
|
|
|
|
+
|
|
|
|
|
+ if (memcmp (mbc, input_tab_char, mblength) == 0 || c == '\t')
|
|
|
|
|
+ {
|
|
|
|
|
+ int width_inc;
|
|
|
|
|
+
|
|
|
|
|
+ width_inc = TAB_WIDTH (chars_per_c, input_position);
|
|
|
|
|
+ width += width_inc;
|
|
|
|
|
+
|
|
|
|
|
+ if (untabify_input)
|
|
|
|
|
+ {
|
|
|
|
|
+ for (i = width_inc; i; --i)
|
|
|
|
|
+ *s++ = ' ';
|
|
|
|
|
+ chars += width_inc;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ for (i = 0; i < mblength; i++)
|
|
|
|
|
+ *s++ = mbc[i];
|
|
|
|
|
+ chars += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if ((wc_width = wcwidth (wc)) < 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (use_esc_sequence)
|
|
|
|
|
+ {
|
|
|
|
|
+ for (i = 0; i < mblength; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ width += 4;
|
|
|
|
|
+ chars += 4;
|
|
|
|
|
+ *s++ = '\\';
|
|
|
|
|
+ sprintf (esc_buff, "%03o", c);
|
|
|
|
|
+ for (j = 0; j <= 2; ++j)
|
|
|
|
|
+ *s++ = (int) esc_buff[j];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (use_cntrl_prefix)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (wc < 0200)
|
|
|
|
|
+ {
|
|
|
|
|
+ width += 2;
|
|
|
|
|
+ chars += 2;
|
|
|
|
|
+ *s++ = '^';
|
|
|
|
|
+ *s++ = wc ^ 0100;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ for (i = 0; i < mblength; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ width += 4;
|
|
|
|
|
+ chars += 4;
|
|
|
|
|
+ *s++ = '\\';
|
|
|
|
|
+ sprintf (esc_buff, "%03o", c);
|
|
|
|
|
+ for (j = 0; j <= 2; ++j)
|
|
|
|
|
+ *s++ = (int) esc_buff[j];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (wc == L'\b')
|
|
|
|
|
+ {
|
|
|
|
|
+ width += -1;
|
|
|
|
|
+ chars += 1;
|
|
|
|
|
+ *s++ = c;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ width += 0;
|
|
|
|
|
+ chars += mblength;
|
|
|
|
|
+ for (i = 0; i < mblength; i++)
|
|
|
|
|
+ *s++ = mbc[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ width += wc_width;
|
|
|
|
|
+ chars += mblength;
|
|
|
|
|
+ for (i = 0; i < mblength; i++)
|
|
|
|
|
+ *s++ = mbc[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
|
|
|
|
|
+ mbc_pos -= mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ input_position += width;
|
|
|
|
|
+ return chars;
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* We've just printed some files and need to clean up things before
|
|
|
|
|
looking for more options and printing the next batch of files.
|
|
|
|
|
|
|
|
|
|
Index: src/sort.c
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- src/sort.c.orig
|
|
|
|
|
+++ src/sort.c
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -22,12 +22,21 @@
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
+#include <assert.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <pthread.h>
|
2012-06-19 14:54:24 +02:00
|
|
|
|
#include <sys/resource.h>
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/wait.h>
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+/* Get isw* functions. */
|
|
|
|
|
+#if HAVE_WCTYPE_H
|
|
|
|
|
+# include <wctype.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "argmatch.h"
|
|
|
|
|
#include "error.h"
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -165,12 +174,34 @@ static int thousands_sep;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
/* Nonzero if the corresponding locales are hard. */
|
|
|
|
|
static bool hard_LC_COLLATE;
|
|
|
|
|
-#if HAVE_NL_LANGINFO
|
|
|
|
|
+#if HAVE_LANGINFO_CODESET
|
|
|
|
|
static bool hard_LC_TIME;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define NONZERO(x) ((x) != 0)
|
|
|
|
|
|
|
|
|
|
+/* get a multibyte character's byte length. */
|
|
|
|
|
+#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE) \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ wchar_t wc; \
|
|
|
|
|
+ mbstate_t state_bak; \
|
|
|
|
|
+ \
|
|
|
|
|
+ state_bak = STATE; \
|
|
|
|
|
+ mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE); \
|
|
|
|
|
+ \
|
|
|
|
|
+ switch (MBLENGTH) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ case (size_t)-1: \
|
|
|
|
|
+ case (size_t)-2: \
|
|
|
|
|
+ STATE = state_bak; \
|
|
|
|
|
+ /* Fall through. */ \
|
|
|
|
|
+ case 0: \
|
|
|
|
|
+ MBLENGTH = 1; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+
|
|
|
|
|
/* The kind of blanks for '-b' to skip in various options. */
|
|
|
|
|
enum blanktype { bl_start, bl_end, bl_both };
|
|
|
|
|
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -341,13 +372,11 @@ static bool reverse;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
they were read if all keys compare equal. */
|
|
|
|
|
static bool stable;
|
|
|
|
|
|
|
|
|
|
-/* If TAB has this value, blanks separate fields. */
|
|
|
|
|
-enum { TAB_DEFAULT = CHAR_MAX + 1 };
|
|
|
|
|
-
|
|
|
|
|
-/* Tab character separating fields. If TAB_DEFAULT, then fields are
|
|
|
|
|
+/* Tab character separating fields. If tab_length is 0, then fields are
|
|
|
|
|
separated by the empty string between a non-blank character and a blank
|
|
|
|
|
character. */
|
|
|
|
|
-static int tab = TAB_DEFAULT;
|
|
|
|
|
+static char tab[MB_LEN_MAX + 1];
|
|
|
|
|
+static size_t tab_length = 0;
|
|
|
|
|
|
|
|
|
|
/* Flag to remove consecutive duplicate lines from the output.
|
|
|
|
|
Only the last of a sequence of equal lines will be output. */
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -780,6 +809,46 @@ reap_all (void)
|
2011-01-03 20:39:07 +01:00
|
|
|
|
reap (-1);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* Function pointers. */
|
|
|
|
|
+static void
|
|
|
|
|
+(*inittables) (void);
|
|
|
|
|
+static char *
|
|
|
|
|
+(*begfield) (const struct line*, const struct keyfield *);
|
|
|
|
|
+static char *
|
|
|
|
|
+(*limfield) (const struct line*, const struct keyfield *);
|
|
|
|
|
+static void
|
|
|
|
|
+(*skipblanks) (char **ptr, char *lim);
|
|
|
|
|
+static int
|
|
|
|
|
+(*getmonth) (char const *, size_t, char **);
|
|
|
|
|
+static int
|
|
|
|
|
+(*keycompare) (const struct line *, const struct line *);
|
|
|
|
|
+static int
|
|
|
|
|
+(*numcompare) (const char *, const char *);
|
|
|
|
|
+
|
|
|
|
|
+/* Test for white space multibyte character.
|
|
|
|
|
+ Set LENGTH the byte length of investigated multibyte character. */
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static int
|
|
|
|
|
+ismbblank (const char *str, size_t len, size_t *length)
|
|
|
|
|
+{
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ wchar_t wc;
|
|
|
|
|
+ mbstate_t state;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+ mblength = mbrtowc (&wc, str, len, &state);
|
|
|
|
|
+
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ *length = 1;
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ *length = (mblength < 1) ? 1 : mblength;
|
|
|
|
|
+ return iswblank (wc);
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Clean up any remaining temporary files. */
|
|
|
|
|
|
|
|
|
|
static void
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1212,7 +1281,7 @@ zaptemp (char const *name)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
free (node);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-#if HAVE_NL_LANGINFO
|
|
|
|
|
+#if HAVE_LANGINFO_CODESET
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
struct_month_cmp (void const *m1, void const *m2)
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1227,7 +1296,7 @@ struct_month_cmp (void const *m1, void c
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
/* Initialize the character class tables. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
-inittables (void)
|
|
|
|
|
+inittables_uni (void)
|
|
|
|
|
{
|
|
|
|
|
size_t i;
|
|
|
|
|
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1239,7 +1308,7 @@ inittables (void)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
fold_toupper[i] = toupper (i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-#if HAVE_NL_LANGINFO
|
|
|
|
|
+#if HAVE_LANGINFO_CODESET
|
|
|
|
|
/* If we're not in the "C" locale, read different names for months. */
|
|
|
|
|
if (hard_LC_TIME)
|
|
|
|
|
{
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1321,6 +1390,84 @@ specify_nmerge (int oi, char c, char con
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
xstrtol_fatal (e, oi, c, long_options, s);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static void
|
|
|
|
|
+inittables_mb (void)
|
|
|
|
|
+{
|
|
|
|
|
+ int i, j, k, l;
|
|
|
|
|
+ char *name, *s, *lc_time, *lc_ctype;
|
|
|
|
|
+ size_t s_len, mblength;
|
|
|
|
|
+ char mbc[MB_LEN_MAX];
|
|
|
|
|
+ wchar_t wc, pwc;
|
|
|
|
|
+ mbstate_t state_mb, state_wc;
|
|
|
|
|
+
|
|
|
|
|
+ lc_time = setlocale (LC_TIME, "");
|
|
|
|
|
+ if (lc_time)
|
|
|
|
|
+ lc_time = xstrdup (lc_time);
|
|
|
|
|
+
|
|
|
|
|
+ lc_ctype = setlocale (LC_CTYPE, "");
|
|
|
|
|
+ if (lc_ctype)
|
|
|
|
|
+ lc_ctype = xstrdup (lc_ctype);
|
|
|
|
|
+
|
|
|
|
|
+ if (lc_time && lc_ctype)
|
|
|
|
|
+ /* temporarily set LC_CTYPE to match LC_TIME, so that we can convert
|
|
|
|
|
+ * the names of months to upper case */
|
|
|
|
|
+ setlocale (LC_CTYPE, lc_time);
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < MONTHS_PER_YEAR; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ s = (char *) nl_langinfo (ABMON_1 + i);
|
|
|
|
|
+ s_len = strlen (s);
|
|
|
|
|
+ monthtab[i].name = name = (char *) xmalloc (s_len + 1);
|
|
|
|
|
+ monthtab[i].val = i + 1;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state_mb, '\0', sizeof (mbstate_t));
|
|
|
|
|
+ memset (&state_wc, '\0', sizeof (mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ for (j = 0; j < s_len;)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!ismbblank (s + j, s_len - j, &mblength))
|
|
|
|
|
+ break;
|
|
|
|
|
+ j += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (k = 0; j < s_len;)
|
|
|
|
|
+ {
|
|
|
|
|
+ mblength = mbrtowc (&wc, (s + j), (s_len - j), &state_mb);
|
|
|
|
|
+ assert (mblength != (size_t)-1 && mblength != (size_t)-2);
|
|
|
|
|
+ if (mblength == 0)
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ pwc = towupper (wc);
|
|
|
|
|
+ if (pwc == wc)
|
|
|
|
|
+ {
|
|
|
|
|
+ memcpy (mbc, s + j, mblength);
|
|
|
|
|
+ j += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ j += mblength;
|
|
|
|
|
+ mblength = wcrtomb (mbc, pwc, &state_wc);
|
|
|
|
|
+ assert (mblength != (size_t)0 && mblength != (size_t)-1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (l = 0; l < mblength; l++)
|
|
|
|
|
+ name[k++] = mbc[l];
|
|
|
|
|
+ }
|
|
|
|
|
+ name[k] = '\0';
|
|
|
|
|
+ }
|
|
|
|
|
+ qsort ((void *) monthtab, MONTHS_PER_YEAR,
|
|
|
|
|
+ sizeof (struct month), struct_month_cmp);
|
|
|
|
|
+
|
|
|
|
|
+ if (lc_time && lc_ctype)
|
|
|
|
|
+ /* restore the original locales */
|
|
|
|
|
+ setlocale (LC_CTYPE, lc_ctype);
|
|
|
|
|
+
|
|
|
|
|
+ free (lc_ctype);
|
|
|
|
|
+ free (lc_time);
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Specify the amount of main memory to use when sorting. */
|
|
|
|
|
static void
|
|
|
|
|
specify_sort_size (int oi, char c, char const *s)
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1549,7 +1696,7 @@ buffer_linelim (struct buffer const *buf
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
by KEY in LINE. */
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
|
-begfield (struct line const *line, struct keyfield const *key)
|
|
|
|
|
+begfield_uni (const struct line *line, const struct keyfield *key)
|
|
|
|
|
{
|
|
|
|
|
char *ptr = line->text, *lim = ptr + line->length - 1;
|
|
|
|
|
size_t sword = key->sword;
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1558,10 +1705,10 @@ begfield (struct line const *line, struc
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
/* The leading field separator itself is included in a field when -t
|
|
|
|
|
is absent. */
|
|
|
|
|
|
|
|
|
|
- if (tab != TAB_DEFAULT)
|
|
|
|
|
+ if (tab_length)
|
|
|
|
|
while (ptr < lim && sword--)
|
|
|
|
|
{
|
|
|
|
|
- while (ptr < lim && *ptr != tab)
|
|
|
|
|
+ while (ptr < lim && *ptr != tab[0])
|
|
|
|
|
++ptr;
|
|
|
|
|
if (ptr < lim)
|
|
|
|
|
++ptr;
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1587,11 +1734,70 @@ begfield (struct line const *line, struc
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static char *
|
|
|
|
|
+begfield_mb (const struct line *line, const struct keyfield *key)
|
|
|
|
|
+{
|
|
|
|
|
+ int i;
|
|
|
|
|
+ char *ptr = line->text, *lim = ptr + line->length - 1;
|
|
|
|
|
+ size_t sword = key->sword;
|
|
|
|
|
+ size_t schar = key->schar;
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ mbstate_t state;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ if (tab_length)
|
|
|
|
|
+ while (ptr < lim && sword--)
|
|
|
|
|
+ {
|
|
|
|
|
+ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ptr < lim)
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ while (ptr < lim && sword--)
|
|
|
|
|
+ {
|
|
|
|
|
+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ if (ptr < lim)
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (key->skipsblanks)
|
|
|
|
|
+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < schar; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+
|
|
|
|
|
+ if (ptr + mblength > lim)
|
|
|
|
|
+ break;
|
|
|
|
|
+ else
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return ptr;
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Return the limit of (a pointer to the first character after) the field
|
|
|
|
|
in LINE specified by KEY. */
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
|
-limfield (struct line const *line, struct keyfield const *key)
|
|
|
|
|
+limfield_uni (const struct line *line, const struct keyfield *key)
|
|
|
|
|
{
|
|
|
|
|
char *ptr = line->text, *lim = ptr + line->length - 1;
|
|
|
|
|
size_t eword = key->eword, echar = key->echar;
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1606,10 +1812,10 @@ limfield (struct line const *line, struc
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
'beginning' is the first character following the delimiting TAB.
|
|
|
|
|
Otherwise, leave PTR pointing at the first 'blank' character after
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
the preceding field. */
|
|
|
|
|
- if (tab != TAB_DEFAULT)
|
|
|
|
|
+ if (tab_length)
|
|
|
|
|
while (ptr < lim && eword--)
|
|
|
|
|
{
|
|
|
|
|
- while (ptr < lim && *ptr != tab)
|
|
|
|
|
+ while (ptr < lim && *ptr != tab[0])
|
|
|
|
|
++ptr;
|
|
|
|
|
if (ptr < lim && (eword || echar))
|
|
|
|
|
++ptr;
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1655,10 +1861,10 @@ limfield (struct line const *line, struc
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* Make LIM point to the end of (one byte past) the current field. */
|
|
|
|
|
- if (tab != TAB_DEFAULT)
|
|
|
|
|
+ if (tab_length)
|
|
|
|
|
{
|
|
|
|
|
char *newlim;
|
|
|
|
|
- newlim = memchr (ptr, tab, lim - ptr);
|
|
|
|
|
+ newlim = memchr (ptr, tab[0], lim - ptr);
|
|
|
|
|
if (newlim)
|
|
|
|
|
lim = newlim;
|
|
|
|
|
}
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1689,6 +1895,130 @@ limfield (struct line const *line, struc
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static char *
|
|
|
|
|
+limfield_mb (const struct line *line, const struct keyfield *key)
|
|
|
|
|
+{
|
|
|
|
|
+ char *ptr = line->text, *lim = ptr + line->length - 1;
|
|
|
|
|
+ size_t eword = key->eword, echar = key->echar;
|
|
|
|
|
+ int i;
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ mbstate_t state;
|
|
|
|
|
+
|
|
|
|
|
+ if (echar == 0)
|
|
|
|
|
+ eword++; /* skip all of end field. */
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ if (tab_length)
|
|
|
|
|
+ while (ptr < lim && eword--)
|
|
|
|
|
+ {
|
|
|
|
|
+ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ptr < lim && (eword | echar))
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ while (ptr < lim && eword--)
|
|
|
|
|
+ {
|
|
|
|
|
+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ if (ptr < lim)
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+# ifdef POSIX_UNSPECIFIED
|
|
|
|
|
+ /* Make LIM point to the end of (one byte past) the current field. */
|
|
|
|
|
+ if (tab_length)
|
|
|
|
|
+ {
|
|
|
|
|
+ char *newlim, *p;
|
|
|
|
|
+
|
|
|
|
|
+ newlim = NULL;
|
|
|
|
|
+ for (p = ptr; p < lim;)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (memcmp (p, tab, tab_length) == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ newlim = p;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+ p += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ char *newlim;
|
|
|
|
|
+ newlim = ptr;
|
|
|
|
|
+
|
|
|
|
|
+ while (newlim < lim && ismbblank (newlim, lim - newlim, &mblength))
|
|
|
|
|
+ newlim += mblength;
|
|
|
|
|
+ if (ptr < lim)
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ while (newlim < lim && !ismbblank (newlim, lim - newlim, &mblength))
|
|
|
|
|
+ newlim += mblength;
|
|
|
|
|
+ lim = newlim;
|
|
|
|
|
+ }
|
|
|
|
|
+# endif
|
|
|
|
|
+
|
|
|
|
|
+ if (echar != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* If we're skipping leading blanks, don't start counting characters
|
|
|
|
|
+ * until after skipping past any leading blanks. */
|
|
|
|
|
+ if (key->skipsblanks)
|
|
|
|
|
+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
|
|
|
|
|
+ for (i = 0; i < echar; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
|
|
|
|
+
|
|
|
|
|
+ if (ptr + mblength > lim)
|
|
|
|
|
+ break;
|
|
|
|
|
+ else
|
|
|
|
|
+ ptr += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return ptr;
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+static void
|
|
|
|
|
+skipblanks_uni (char **ptr, char *lim)
|
|
|
|
|
+{
|
|
|
|
|
+ while (*ptr < lim && blanks[to_uchar (**ptr)])
|
|
|
|
|
+ ++(*ptr);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static void
|
|
|
|
|
+skipblanks_mb (char **ptr, char *lim)
|
|
|
|
|
+{
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ while (*ptr < lim && ismbblank (*ptr, lim - *ptr, &mblength))
|
|
|
|
|
+ (*ptr) += mblength;
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Fill BUF reading from FP, moving buf->left bytes from the end
|
|
|
|
|
of buf->buf to the beginning first. If EOF is reached and the
|
|
|
|
|
file wasn't terminated by a newline, supply one. Set up BUF's line
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1775,8 +2105,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (key->skipsblanks)
|
|
|
|
|
- while (blanks[to_uchar (*line_start)])
|
|
|
|
|
- line_start++;
|
|
|
|
|
+ {
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ while (line_start < line->keylim &&
|
|
|
|
|
+ ismbblank (line_start,
|
|
|
|
|
+ line->keylim - line_start,
|
|
|
|
|
+ &mblength))
|
|
|
|
|
+ line_start += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ while (blanks[to_uchar (*line_start)])
|
|
|
|
|
+ line_start++;
|
|
|
|
|
+ }
|
|
|
|
|
line->keybeg = line_start;
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1897,7 +2241,7 @@ human_numcompare (char const *a, char co
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
hideously fast. */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
-numcompare (char const *a, char const *b)
|
|
|
|
|
+numcompare_uni (const char *a, const char *b)
|
|
|
|
|
{
|
|
|
|
|
while (blanks[to_uchar (*a)])
|
|
|
|
|
a++;
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1925,6 +2269,25 @@ nan_compare (char const *sa, char const
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
return memcmp (&a, &b, sizeof a);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static int
|
|
|
|
|
+numcompare_mb (const char *a, const char *b)
|
|
|
|
|
+{
|
|
|
|
|
+ size_t mblength, len;
|
|
|
|
|
+ len = strlen (a); /* okay for UTF-8 */
|
|
|
|
|
+ while (*a && ismbblank (a, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
|
|
|
|
|
+ {
|
|
|
|
|
+ a += mblength;
|
|
|
|
|
+ len -= mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ len = strlen (b); /* okay for UTF-8 */
|
|
|
|
|
+ while (*b && ismbblank (b, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
|
|
|
|
|
+ b += mblength;
|
|
|
|
|
+
|
|
|
|
|
+ return strnumcmp (a, b, decimal_point, thousands_sep);
|
|
|
|
|
+}
|
|
|
|
|
+#endif /* HAV_EMBRTOWC */
|
|
|
|
|
+
|
|
|
|
|
static int
|
|
|
|
|
general_numcompare (char const *sa, char const *sb)
|
|
|
|
|
{
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -1957,7 +2320,7 @@ general_numcompare (char const *sa, char
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
Return 0 if the name in S is not recognized. */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
-getmonth (char const *month, char **ea)
|
|
|
|
|
+getmonth_uni (char const *month, size_t len, char **ea)
|
|
|
|
|
{
|
|
|
|
|
size_t lo = 0;
|
|
|
|
|
size_t hi = MONTHS_PER_YEAR;
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -2232,15 +2595,14 @@ debug_key (struct line const *line, stru
|
2011-01-03 20:39:07 +01:00
|
|
|
|
char saved = *lim;
|
|
|
|
|
*lim = '\0';
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
- while (blanks[to_uchar (*beg)])
|
|
|
|
|
- beg++;
|
|
|
|
|
+ skipblanks (&beg, lim);
|
|
|
|
|
|
|
|
|
|
char *tighter_lim = beg;
|
|
|
|
|
|
- Update to 8.10:
* Bug fixes
- du would abort with a failed assertion when two conditions are
met: part of the hierarchy being traversed is moved to a higher
level in the directory tree, and there is at least one more
command line directory argument following the one containing
the moved sub-tree. [bug introduced in coreutils-5.1.0]
- join --header now skips the ordering check for the first line
even if the other file is empty. [bug introduced in
coreutils-8.5]
- rm -f no longer fails for EINVAL or EILSEQ on file systems that
reject file names invalid for that file system.
- uniq -f NUM no longer tries to process fields after end of
line. [bug introduced in coreutils-7.0]
* New features
- cp now copies sparse files efficiently on file systems with
FIEMAP support (ext4, btrfs, xfs, ocfs2). Before, it had to
read 2^20 bytes when copying a 1MiB sparse file. Now, it
copies bytes only for the non-sparse sections of a file.
Similarly, to induce a hole in the output file, it had to
detect a long sequence of zero bytes. Now, it knows precisely
where each hole in an input file is, and can reproduce them
efficiently in the output file. mv also benefits when it
resorts to copying, e.g., between file systems.
- join now supports -o 'auto' which will automatically infer the
output format from the first line in each file, to ensure the
same number of fields are output for each line.
* Changes in behavior
- join no longer reports disorder when one of the files is empty.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=85
2011-02-10 11:50:29 +01:00
|
|
|
|
if (lim < beg)
|
|
|
|
|
tighter_lim = lim;
|
|
|
|
|
else if (key->month)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
- getmonth (beg, &tighter_lim);
|
|
|
|
|
+ getmonth (beg, lim-beg, &tighter_lim);
|
|
|
|
|
else if (key->general_numeric)
|
|
|
|
|
ignore_value (strtold (beg, &tighter_lim));
|
|
|
|
|
else if (key->numeric || key->human_numeric)
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -2384,7 +2746,7 @@ key_warnings (struct keyfield const *gke
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key)
|
|
|
|
|
&& !(key->schar || key->echar);
|
|
|
|
|
bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */
|
|
|
|
|
- if (!gkey_only && tab == TAB_DEFAULT && !line_offset
|
|
|
|
|
+ if (!gkey_only && !tab_length && !line_offset
|
|
|
|
|
&& ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned))
|
|
|
|
|
|| (!key->skipsblanks && key->schar)
|
|
|
|
|
|| (!key->skipeblanks && key->echar)))
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -2442,11 +2804,87 @@ key_warnings (struct keyfield const *gke
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
error (0, 0, _("option '-r' only applies to last-resort comparison"));
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static int
|
|
|
|
|
+getmonth_mb (const char *s, size_t len, char **ea)
|
|
|
|
|
+{
|
|
|
|
|
+ char *month;
|
|
|
|
|
+ register size_t i;
|
|
|
|
|
+ register int lo = 0, hi = MONTHS_PER_YEAR, result;
|
|
|
|
|
+ char *tmp;
|
|
|
|
|
+ size_t wclength, mblength;
|
|
|
|
|
+ const char **pp;
|
|
|
|
|
+ const wchar_t **wpp;
|
|
|
|
|
+ wchar_t *month_wcs;
|
|
|
|
|
+ mbstate_t state;
|
|
|
|
|
+
|
|
|
|
|
+ while (len > 0 && ismbblank (s, len, &mblength))
|
|
|
|
|
+ {
|
|
|
|
|
+ s += mblength;
|
|
|
|
|
+ len -= mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (len == 0)
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ month = (char *) xmalloc (len + 1);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ tmp = (char *) xmalloc (len + 1);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ memcpy (tmp, s, len);
|
|
|
|
|
+ tmp[len] = '\0';
|
|
|
|
|
+ pp = (const char **)&tmp;
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ month_wcs = (wchar_t *) xmalloc ((len + 1) * sizeof (wchar_t));
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ memset (&state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ wclength = mbsrtowcs (month_wcs, pp, len + 1, &state);
|
|
|
|
|
+ if (wclength == (size_t)-1 || *pp != NULL)
|
|
|
|
|
+ error (SORT_FAILURE, 0, _("Invalid multibyte input %s."), quote(s));
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < wclength; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ month_wcs[i] = towupper(month_wcs[i]);
|
|
|
|
|
+ if (iswblank (month_wcs[i]))
|
|
|
|
|
+ {
|
|
|
|
|
+ month_wcs[i] = L'\0';
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ wpp = (const wchar_t **)&month_wcs;
|
|
|
|
|
+
|
|
|
|
|
+ mblength = wcsrtombs (month, wpp, len + 1, &state);
|
|
|
|
|
+ assert (mblength != (-1) && *wpp == NULL);
|
|
|
|
|
+
|
|
|
|
|
+ do
|
|
|
|
|
+ {
|
|
|
|
|
+ int ix = (lo + hi) / 2;
|
|
|
|
|
+
|
|
|
|
|
+ if (strncmp (month, monthtab[ix].name, strlen (monthtab[ix].name)) < 0)
|
|
|
|
|
+ hi = ix;
|
|
|
|
|
+ else
|
|
|
|
|
+ lo = ix;
|
|
|
|
|
+ }
|
|
|
|
|
+ while (hi - lo > 1);
|
|
|
|
|
+
|
|
|
|
|
+ if (ea)
|
|
|
|
|
+ *ea = (char *) month;
|
|
|
|
|
+
|
|
|
|
|
+ result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
|
|
|
|
|
+ ? monthtab[lo].val : 0);
|
|
|
|
|
+
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ free (month);
|
|
|
|
|
+ free (tmp);
|
|
|
|
|
+ free (month_wcs);
|
|
|
|
|
+
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ return result;
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Compare two lines A and B trying every key in sequence until there
|
|
|
|
|
are no more keys or a difference is found. */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
-keycompare (struct line const *a, struct line const *b)
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
+keycompare_uni (struct line const *a, struct line const *b)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
{
|
|
|
|
|
struct keyfield *key = keylist;
|
|
|
|
|
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -2531,7 +2969,7 @@ keycompare (struct line const *a, struct
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
else if (key->human_numeric)
|
|
|
|
|
diff = human_numcompare (ta, tb);
|
|
|
|
|
else if (key->month)
|
|
|
|
|
- diff = getmonth (ta, NULL) - getmonth (tb, NULL);
|
|
|
|
|
+ diff = getmonth (ta, tlena, NULL) - getmonth (tb, tlenb, NULL);
|
|
|
|
|
else if (key->random)
|
|
|
|
|
diff = compare_random (ta, tlena, tb, tlenb);
|
|
|
|
|
else if (key->version)
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -2647,6 +3085,181 @@ keycompare (struct line const *a, struct
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
return key->reverse ? -diff : diff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static int
|
|
|
|
|
+keycompare_mb (const struct line *a, const struct line *b)
|
|
|
|
|
+{
|
|
|
|
|
+ struct keyfield *key = keylist;
|
|
|
|
|
+
|
|
|
|
|
+ /* For the first iteration only, the key positions have been
|
|
|
|
|
+ precomputed for us. */
|
|
|
|
|
+ char *texta = a->keybeg;
|
|
|
|
|
+ char *textb = b->keybeg;
|
|
|
|
|
+ char *lima = a->keylim;
|
|
|
|
|
+ char *limb = b->keylim;
|
|
|
|
|
+
|
|
|
|
|
+ size_t mblength_a, mblength_b;
|
|
|
|
|
+ wchar_t wc_a, wc_b;
|
|
|
|
|
+ mbstate_t state_a, state_b;
|
|
|
|
|
+
|
|
|
|
|
+ int diff;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state_a, '\0', sizeof(mbstate_t));
|
|
|
|
|
+ memset (&state_b, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ for (;;)
|
|
|
|
|
+ {
|
|
|
|
|
+ char const *translate = key->translate;
|
|
|
|
|
+ bool const *ignore = key->ignore;
|
|
|
|
|
+
|
|
|
|
|
+ /* Find the lengths. */
|
|
|
|
|
+ size_t lena = lima <= texta ? 0 : lima - texta;
|
|
|
|
|
+ size_t lenb = limb <= textb ? 0 : limb - textb;
|
|
|
|
|
+
|
|
|
|
|
+ /* Actually compare the fields. */
|
|
|
|
|
+ if (key->random)
|
|
|
|
|
+ diff = compare_random (texta, lena, textb, lenb);
|
|
|
|
|
+ else if (key->numeric | key->general_numeric | key->human_numeric)
|
|
|
|
|
+ {
|
|
|
|
|
+ char savea = *lima, saveb = *limb;
|
|
|
|
|
+
|
|
|
|
|
+ *lima = *limb = '\0';
|
|
|
|
|
+ diff = (key->numeric ? numcompare (texta, textb)
|
|
|
|
|
+ : key->general_numeric ? general_numcompare (texta, textb)
|
|
|
|
|
+ : human_numcompare (texta, textb));
|
|
|
|
|
+ *lima = savea, *limb = saveb;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (key->version)
|
|
|
|
|
+ diff = filevercmp (texta, textb);
|
|
|
|
|
+ else if (key->month)
|
|
|
|
|
+ diff = getmonth (texta, lena, NULL) - getmonth (textb, lenb, NULL);
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (ignore || translate)
|
|
|
|
|
+ {
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ char *copy_a = xmalloc (lena + 1 + lenb + 1);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ char *copy_b = copy_a + lena + 1;
|
|
|
|
|
+ size_t new_len_a, new_len_b;
|
|
|
|
|
+ size_t i, j;
|
|
|
|
|
+
|
|
|
|
|
+ /* Ignore and/or translate chars before comparing. */
|
|
|
|
|
+# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ wchar_t uwc; \
|
|
|
|
|
+ char mbc[MB_LEN_MAX]; \
|
|
|
|
|
+ mbstate_t state_wc; \
|
|
|
|
|
+ \
|
|
|
|
|
+ for (NEW_LEN = i = 0; i < LEN;) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ mbstate_t state_bak; \
|
|
|
|
|
+ \
|
|
|
|
|
+ state_bak = STATE; \
|
|
|
|
|
+ MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE); \
|
|
|
|
|
+ \
|
|
|
|
|
+ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1 \
|
|
|
|
|
+ || MBLENGTH == 0) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \
|
|
|
|
|
+ STATE = state_bak; \
|
|
|
|
|
+ if (!ignore) \
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ COPY[NEW_LEN++] = TEXT[i]; \
|
|
|
|
|
+ i++; \
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ continue; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ \
|
|
|
|
|
+ if (ignore) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ if ((ignore == nonprinting && !iswprint (WC)) \
|
|
|
|
|
+ || (ignore == nondictionary \
|
|
|
|
|
+ && !iswalnum (WC) && !iswblank (WC))) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ i += MBLENGTH; \
|
|
|
|
|
+ continue; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ } \
|
|
|
|
|
+ \
|
|
|
|
|
+ if (translate) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ \
|
|
|
|
|
+ uwc = towupper(WC); \
|
|
|
|
|
+ if (WC == uwc) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ memcpy (mbc, TEXT + i, MBLENGTH); \
|
|
|
|
|
+ i += MBLENGTH; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ else \
|
|
|
|
|
+ { \
|
|
|
|
|
+ i += MBLENGTH; \
|
|
|
|
|
+ WC = uwc; \
|
|
|
|
|
+ memset (&state_wc, '\0', sizeof (mbstate_t)); \
|
|
|
|
|
+ \
|
|
|
|
|
+ MBLENGTH = wcrtomb (mbc, WC, &state_wc); \
|
|
|
|
|
+ assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0); \
|
|
|
|
|
+ } \
|
|
|
|
|
+ \
|
|
|
|
|
+ for (j = 0; j < MBLENGTH; j++) \
|
|
|
|
|
+ COPY[NEW_LEN++] = mbc[j]; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ else \
|
|
|
|
|
+ for (j = 0; j < MBLENGTH; j++) \
|
|
|
|
|
+ COPY[NEW_LEN++] = TEXT[i++]; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ COPY[NEW_LEN] = '\0'; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+ IGNORE_CHARS (new_len_a, lena, texta, copy_a,
|
|
|
|
|
+ wc_a, mblength_a, state_a);
|
|
|
|
|
+ IGNORE_CHARS (new_len_b, lenb, textb, copy_b,
|
|
|
|
|
+ wc_b, mblength_b, state_b);
|
|
|
|
|
+ diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b);
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ free(copy_a);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+ }
|
|
|
|
|
+ else if (lena == 0)
|
|
|
|
|
+ diff = - NONZERO (lenb);
|
|
|
|
|
+ else if (lenb == 0)
|
|
|
|
|
+ goto greater;
|
|
|
|
|
+ else
|
|
|
|
|
+ diff = xmemcoll (texta, lena, textb, lenb);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (diff)
|
|
|
|
|
+ goto not_equal;
|
|
|
|
|
+
|
|
|
|
|
+ key = key->next;
|
|
|
|
|
+ if (! key)
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ /* Find the beginning and limit of the next field. */
|
|
|
|
|
+ if (key->eword != -1)
|
|
|
|
|
+ lima = limfield (a, key), limb = limfield (b, key);
|
|
|
|
|
+ else
|
|
|
|
|
+ lima = a->text + a->length - 1, limb = b->text + b->length - 1;
|
|
|
|
|
+
|
|
|
|
|
+ if (key->sword != -1)
|
|
|
|
|
+ texta = begfield (a, key), textb = begfield (b, key);
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ texta = a->text, textb = b->text;
|
|
|
|
|
+ if (key->skipsblanks)
|
|
|
|
|
+ {
|
|
|
|
|
+ while (texta < lima && ismbblank (texta, lima - texta, &mblength_a))
|
|
|
|
|
+ texta += mblength_a;
|
|
|
|
|
+ while (textb < limb && ismbblank (textb, limb - textb, &mblength_b))
|
|
|
|
|
+ textb += mblength_b;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
|
|
|
|
+greater:
|
|
|
|
|
+ diff = 1;
|
|
|
|
|
+not_equal:
|
|
|
|
|
+ return key->reverse ? -diff : diff;
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Compare two lines A and B, returning negative, zero, or positive
|
|
|
|
|
depending on whether A compares less than, equal to, or greater than B. */
|
|
|
|
|
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -4107,7 +4720,7 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
initialize_exit_failure (SORT_FAILURE);
|
|
|
|
|
|
|
|
|
|
hard_LC_COLLATE = hard_locale (LC_COLLATE);
|
|
|
|
|
-#if HAVE_NL_LANGINFO
|
|
|
|
|
+#if HAVE_LANGINFO_CODESET
|
|
|
|
|
hard_LC_TIME = hard_locale (LC_TIME);
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -4128,6 +4741,29 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
thousands_sep = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ inittables = inittables_mb;
|
|
|
|
|
+ begfield = begfield_mb;
|
|
|
|
|
+ limfield = limfield_mb;
|
|
|
|
|
+ skipblanks = skipblanks_mb;
|
|
|
|
|
+ getmonth = getmonth_mb;
|
|
|
|
|
+ keycompare = keycompare_mb;
|
|
|
|
|
+ numcompare = numcompare_mb;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ inittables = inittables_uni;
|
|
|
|
|
+ begfield = begfield_uni;
|
|
|
|
|
+ limfield = limfield_uni;
|
|
|
|
|
+ skipblanks = skipblanks_uni;
|
|
|
|
|
+ getmonth = getmonth_uni;
|
|
|
|
|
+ keycompare = keycompare_uni;
|
|
|
|
|
+ numcompare = numcompare_uni;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
have_read_stdin = false;
|
|
|
|
|
inittables ();
|
|
|
|
|
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -4398,13 +5034,34 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
case 't':
|
|
|
|
|
{
|
|
|
|
|
- char newtab = optarg[0];
|
|
|
|
|
- if (! newtab)
|
|
|
|
|
+ char newtab[MB_LEN_MAX + 1];
|
|
|
|
|
+ size_t newtab_length = 1;
|
|
|
|
|
+ strncpy (newtab, optarg, MB_LEN_MAX);
|
|
|
|
|
+ if (! newtab[0])
|
|
|
|
|
error (SORT_FAILURE, 0, _("empty tab"));
|
|
|
|
|
- if (optarg[1])
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ wchar_t wc;
|
|
|
|
|
+ mbstate_t state;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state, '\0', sizeof (mbstate_t));
|
|
|
|
|
+ newtab_length = mbrtowc (&wc, newtab, strnlen (newtab,
|
|
|
|
|
+ MB_LEN_MAX),
|
|
|
|
|
+ &state);
|
|
|
|
|
+ switch (newtab_length)
|
|
|
|
|
+ {
|
|
|
|
|
+ case (size_t) -1:
|
|
|
|
|
+ case (size_t) -2:
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ newtab_length = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (newtab_length == 1 && optarg[1])
|
|
|
|
|
{
|
|
|
|
|
if (STREQ (optarg, "\\0"))
|
|
|
|
|
- newtab = '\0';
|
|
|
|
|
+ newtab[0] = '\0';
|
|
|
|
|
else
|
|
|
|
|
{
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* Provoke with 'sort -txx'. Complain about
|
2013-01-17 17:45:17 +01:00
|
|
|
|
@@ -4415,9 +5072,12 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
quote (optarg));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
- if (tab != TAB_DEFAULT && tab != newtab)
|
|
|
|
|
+ if (tab_length
|
|
|
|
|
+ && (tab_length != newtab_length
|
|
|
|
|
+ || memcmp (tab, newtab, tab_length) != 0))
|
|
|
|
|
error (SORT_FAILURE, 0, _("incompatible tabs"));
|
|
|
|
|
- tab = newtab;
|
|
|
|
|
+ memcpy (tab, newtab, newtab_length);
|
|
|
|
|
+ tab_length = newtab_length;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
Index: src/unexpand.c
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- src/unexpand.c.orig
|
|
|
|
|
+++ src/unexpand.c
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -38,12 +38,29 @@
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
+
|
|
|
|
|
+/* Get mbstate_t, mbrtowc(), wcwidth(). */
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "error.h"
|
|
|
|
|
#include "fadvise.h"
|
|
|
|
|
#include "quote.h"
|
|
|
|
|
#include "xstrndup.h"
|
|
|
|
|
|
|
|
|
|
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
|
|
|
|
|
+ installation; work around this configuration error. */
|
|
|
|
|
+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
|
|
|
|
|
+# define MB_LEN_MAX 16
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
|
|
|
|
|
+#if HAVE_MBRTOWC && defined mbstate_t
|
|
|
|
|
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* The official name of this program (e.g., no 'g' prefix). */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#define PROGRAM_NAME "unexpand"
|
|
|
|
|
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -103,6 +120,208 @@ static struct option const longopts[] =
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
{NULL, 0, NULL, 0}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
+static FILE *next_file (FILE *fp);
|
|
|
|
|
+
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static void
|
|
|
|
|
+unexpand_multibyte (void)
|
|
|
|
|
+{
|
|
|
|
|
+ FILE *fp; /* Input stream. */
|
|
|
|
|
+ mbstate_t i_state; /* Current shift state of the input stream. */
|
|
|
|
|
+ mbstate_t i_state_bak; /* Back up the I_STATE. */
|
|
|
|
|
+ mbstate_t o_state; /* Current shift state of the output stream. */
|
|
|
|
|
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
|
|
|
|
+ char *bufpos; /* Next read position of BUF. */
|
|
|
|
|
+ size_t buflen = 0; /* The length of the byte sequence in buf. */
|
|
|
|
|
+ wint_t wc; /* A gotten wide character. */
|
|
|
|
|
+ size_t mblength; /* The byte size of a multibyte character
|
|
|
|
|
+ which shows as same character as WC. */
|
|
|
|
|
+
|
|
|
|
|
+ /* Index in `tab_list' of next tabstop: */
|
|
|
|
|
+ int tab_index = 0; /* For calculating width of pending tabs. */
|
|
|
|
|
+ int print_tab_index = 0; /* For printing as many tabs as possible. */
|
|
|
|
|
+ unsigned int column = 0; /* Column on screen of next char. */
|
|
|
|
|
+ int next_tab_column; /* Column the next tab stop is on. */
|
|
|
|
|
+ int convert = 1; /* If nonzero, perform translations. */
|
|
|
|
|
+ unsigned int pending = 0; /* Pending columns of blanks. */
|
|
|
|
|
+
|
|
|
|
|
+ fp = next_file ((FILE *) NULL);
|
|
|
|
|
+ if (fp == NULL)
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&o_state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+ memset (&i_state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+
|
|
|
|
|
+ for (;;)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
|
|
|
|
|
+ {
|
|
|
|
|
+ memmove (buf, bufpos, buflen);
|
|
|
|
|
+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
|
|
|
|
|
+ bufpos = buf;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* Get a wide character. */
|
|
|
|
|
+ if (buflen < 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ wc = WEOF;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ i_state_bak = i_state;
|
|
|
|
|
+ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ i_state = i_state_bak;
|
|
|
|
|
+ wc = L'\0';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (wc == L' ' && convert && column < INT_MAX)
|
|
|
|
|
+ {
|
|
|
|
|
+ ++pending;
|
|
|
|
|
+ ++column;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (wc == L'\t' && convert)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (tab_size == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* Do not let tab_index == first_free_tab;
|
|
|
|
|
+ stop when it is 1 less. */
|
|
|
|
|
+ while (tab_index < first_free_tab - 1
|
|
|
|
|
+ && column >= tab_list[tab_index])
|
|
|
|
|
+ tab_index++;
|
|
|
|
|
+ next_tab_column = tab_list[tab_index];
|
|
|
|
|
+ if (tab_index < first_free_tab - 1)
|
|
|
|
|
+ tab_index++;
|
|
|
|
|
+ if (column >= next_tab_column)
|
|
|
|
|
+ {
|
|
|
|
|
+ convert = 0; /* Ran out of tab stops. */
|
|
|
|
|
+ goto flush_pend_mb;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ next_tab_column = column + tab_size - column % tab_size;
|
|
|
|
|
+ }
|
|
|
|
|
+ pending += next_tab_column - column;
|
|
|
|
|
+ column = next_tab_column;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+flush_pend_mb:
|
|
|
|
|
+ /* Flush pending spaces. Print as many tabs as possible,
|
|
|
|
|
+ then print the rest as spaces. */
|
|
|
|
|
+ if (pending == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ putchar (' ');
|
|
|
|
|
+ pending = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ column -= pending;
|
|
|
|
|
+ while (pending > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (tab_size == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* Do not let print_tab_index == first_free_tab;
|
|
|
|
|
+ stop when it is 1 less. */
|
|
|
|
|
+ while (print_tab_index < first_free_tab - 1
|
|
|
|
|
+ && column >= tab_list[print_tab_index])
|
|
|
|
|
+ print_tab_index++;
|
|
|
|
|
+ next_tab_column = tab_list[print_tab_index];
|
|
|
|
|
+ if (print_tab_index < first_free_tab - 1)
|
|
|
|
|
+ print_tab_index++;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ next_tab_column =
|
|
|
|
|
+ column + tab_size - column % tab_size;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (next_tab_column - column <= pending)
|
|
|
|
|
+ {
|
|
|
|
|
+ putchar ('\t');
|
|
|
|
|
+ pending -= next_tab_column - column;
|
|
|
|
|
+ column = next_tab_column;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ --print_tab_index;
|
|
|
|
|
+ column += pending;
|
|
|
|
|
+ while (pending != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ putchar (' ');
|
|
|
|
|
+ pending--;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (wc == WEOF)
|
|
|
|
|
+ {
|
|
|
|
|
+ fp = next_file (fp);
|
|
|
|
|
+ if (fp == NULL)
|
|
|
|
|
+ break; /* No more files. */
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ memset (&i_state, '\0', sizeof(mbstate_t));
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (convert)
|
|
|
|
|
+ {
|
|
|
|
|
+ ++column;
|
|
|
|
|
+ if (convert_entire_line == 0)
|
|
|
|
|
+ convert = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ putchar (buf[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (mblength == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (convert && convert_entire_line == 0)
|
|
|
|
|
+ convert = 0;
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ putchar ('\0');
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (convert)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (wc == L'\b')
|
|
|
|
|
+ {
|
|
|
|
|
+ if (column > 0)
|
|
|
|
|
+ --column;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ int width; /* The width of WC. */
|
|
|
|
|
+
|
|
|
|
|
+ width = wcwidth (wc);
|
|
|
|
|
+ column += (width > 0) ? width : 0;
|
|
|
|
|
+ if (convert_entire_line == 0)
|
|
|
|
|
+ convert = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (wc == L'\n')
|
|
|
|
|
+ {
|
|
|
|
|
+ tab_index = print_tab_index = 0;
|
|
|
|
|
+ column = pending = 0;
|
|
|
|
|
+ convert = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ fwrite (bufpos, sizeof(char), mblength, stdout);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ buflen -= mblength;
|
|
|
|
|
+ bufpos += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
void
|
|
|
|
|
usage (int status)
|
|
|
|
|
{
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -524,7 +743,12 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
file_list = (optind < argc ? &argv[optind] : stdin_argv);
|
|
|
|
|
|
|
|
|
|
- unexpand ();
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ unexpand_multibyte ();
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ unexpand ();
|
|
|
|
|
|
|
|
|
|
if (have_read_stdin && fclose (stdin) != 0)
|
|
|
|
|
error (EXIT_FAILURE, errno, "-");
|
|
|
|
|
Index: src/uniq.c
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- src/uniq.c.orig
|
|
|
|
|
+++ src/uniq.c
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -21,6 +21,16 @@
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
+/* Get mbstate_t, mbrtowc(). */
|
|
|
|
|
+#if HAVE_WCHAR_H
|
|
|
|
|
+# include <wchar.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Get isw* functions. */
|
|
|
|
|
+#if HAVE_WCTYPE_H
|
|
|
|
|
+# include <wctype.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "argmatch.h"
|
|
|
|
|
#include "linebuffer.h"
|
|
|
|
|
@@ -32,7 +42,19 @@
|
|
|
|
|
#include "stdio--.h"
|
|
|
|
|
#include "xmemcoll.h"
|
|
|
|
|
#include "xstrtol.h"
|
|
|
|
|
-#include "memcasecmp.h"
|
|
|
|
|
+#include "xmemcoll.h"
|
|
|
|
|
+
|
|
|
|
|
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
|
|
|
|
|
+ installation; work around this configuration error. */
|
|
|
|
|
+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
|
|
|
|
|
+# define MB_LEN_MAX 16
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
|
|
|
|
|
+#if HAVE_MBRTOWC && defined mbstate_t
|
|
|
|
|
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
/* The official name of this program (e.g., no 'g' prefix). */
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
#define PROGRAM_NAME "uniq"
|
|
|
|
|
@@ -108,6 +130,10 @@ static enum delimit_method const delimit
|
|
|
|
|
/* Select whether/how to delimit groups of duplicate lines. */
|
|
|
|
|
static enum delimit_method delimit_groups;
|
|
|
|
|
|
|
|
|
|
+/* Function pointers. */
|
|
|
|
|
+static char *
|
|
|
|
|
+(*find_field) (struct linebuffer *line);
|
|
|
|
|
+
|
|
|
|
|
static struct option const longopts[] =
|
|
|
|
|
{
|
|
|
|
|
{"count", no_argument, NULL, 'c'},
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -206,7 +232,7 @@ size_opt (char const *opt, char const *m
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
return a pointer to the beginning of the line's field to be compared. */
|
|
|
|
|
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
static char * _GL_ATTRIBUTE_PURE
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
-find_field (struct linebuffer const *line)
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
+find_field_uni (struct linebuffer const *line)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
{
|
|
|
|
|
size_t count;
|
|
|
|
|
char const *lp = line->buffer;
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -226,6 +252,83 @@ find_field (struct linebuffer const *lin
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
return line->buffer + i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+
|
|
|
|
|
+# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL) \
|
|
|
|
|
+ do \
|
|
|
|
|
+ { \
|
|
|
|
|
+ mbstate_t state_bak; \
|
|
|
|
|
+ \
|
|
|
|
|
+ CONVFAIL = 0; \
|
|
|
|
|
+ state_bak = *STATEP; \
|
|
|
|
|
+ \
|
|
|
|
|
+ MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP); \
|
|
|
|
|
+ \
|
|
|
|
|
+ switch (MBLENGTH) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ case (size_t)-2: \
|
|
|
|
|
+ case (size_t)-1: \
|
|
|
|
|
+ *STATEP = state_bak; \
|
|
|
|
|
+ CONVFAIL++; \
|
|
|
|
|
+ /* Fall through */ \
|
|
|
|
|
+ case 0: \
|
|
|
|
|
+ MBLENGTH = 1; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ } \
|
|
|
|
|
+ while (0)
|
|
|
|
|
+
|
|
|
|
|
+static char *
|
|
|
|
|
+find_field_multi (struct linebuffer *line)
|
|
|
|
|
+{
|
|
|
|
|
+ size_t count;
|
|
|
|
|
+ char *lp = line->buffer;
|
|
|
|
|
+ size_t size = line->length - 1;
|
|
|
|
|
+ size_t pos;
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ wchar_t wc;
|
|
|
|
|
+ mbstate_t *statep;
|
|
|
|
|
+ int convfail;
|
|
|
|
|
+
|
|
|
|
|
+ pos = 0;
|
|
|
|
|
+ statep = &(line->state);
|
|
|
|
|
+
|
|
|
|
|
+ /* skip fields. */
|
|
|
|
|
+ for (count = 0; count < skip_fields && pos < size; count++)
|
|
|
|
|
+ {
|
|
|
|
|
+ while (pos < size)
|
|
|
|
|
+ {
|
|
|
|
|
+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
|
|
|
|
|
+
|
|
|
|
|
+ if (convfail || !iswblank (wc))
|
|
|
|
|
+ {
|
|
|
|
|
+ pos += mblength;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ pos += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ while (pos < size)
|
|
|
|
|
+ {
|
|
|
|
|
+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
|
|
|
|
|
+
|
|
|
|
|
+ if (!convfail && iswblank (wc))
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ pos += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* skip fields. */
|
|
|
|
|
+ for (count = 0; count < skip_chars && pos < size; count++)
|
|
|
|
|
+ {
|
|
|
|
|
+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
|
|
|
|
|
+ pos += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return lp + pos;
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
/* Return false if two strings OLD and NEW match, true if not.
|
|
|
|
|
OLD and NEW point not to the beginnings of the lines
|
|
|
|
|
but rather to the beginnings of the fields to compare.
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
@@ -234,6 +337,8 @@ find_field (struct linebuffer const *lin
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
static bool
|
|
|
|
|
different (char *old, char *new, size_t oldlen, size_t newlen)
|
|
|
|
|
{
|
|
|
|
|
+ char *copy_old, *copy_new;
|
|
|
|
|
+
|
|
|
|
|
if (check_chars < oldlen)
|
|
|
|
|
oldlen = check_chars;
|
|
|
|
|
if (check_chars < newlen)
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -241,14 +346,100 @@ different (char *old, char *new, size_t
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
if (ignore_case)
|
|
|
|
|
{
|
|
|
|
|
- /* FIXME: This should invoke strcoll somehow. */
|
|
|
|
|
- return oldlen != newlen || memcasecmp (old, new, oldlen);
|
|
|
|
|
+ size_t i;
|
|
|
|
|
+
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ copy_old = xmalloc (sizeof(char) * (oldlen + 1));
|
|
|
|
|
+ copy_new = xmalloc (sizeof(char) * (oldlen + 1));
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < oldlen; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ copy_old[i] = toupper (old[i]);
|
|
|
|
|
+ copy_new[i] = toupper (new[i]);
|
|
|
|
|
+ }
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+
|
|
|
|
|
+ bool rc = xmemcoll (copy_old, oldlen, copy_new, newlen);
|
|
|
|
|
+ free (copy_old);
|
|
|
|
|
+ free (copy_new);
|
|
|
|
|
+ return rc;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
- else if (hard_LC_COLLATE)
|
|
|
|
|
- return xmemcoll (old, oldlen, new, newlen) != 0;
|
|
|
|
|
else
|
|
|
|
|
- return oldlen != newlen || memcmp (old, new, oldlen);
|
|
|
|
|
+ {
|
|
|
|
|
+ copy_old = (char *)old;
|
|
|
|
|
+ copy_new = (char *)new;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return xmemcoll (copy_old, oldlen, copy_new, newlen);
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
+}
|
|
|
|
|
+
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+static int
|
|
|
|
|
+different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
|
|
|
|
|
+{
|
|
|
|
|
+ size_t i, j, chars;
|
|
|
|
|
+ const char *str[2];
|
|
|
|
|
+ char *copy[2];
|
|
|
|
|
+ size_t len[2];
|
|
|
|
|
+ mbstate_t state[2];
|
|
|
|
|
+ size_t mblength;
|
|
|
|
|
+ wchar_t wc, uwc;
|
|
|
|
|
+ mbstate_t state_bak;
|
|
|
|
|
+
|
|
|
|
|
+ str[0] = old;
|
|
|
|
|
+ str[1] = new;
|
|
|
|
|
+ len[0] = oldlen;
|
|
|
|
|
+ len[1] = newlen;
|
|
|
|
|
+ state[0] = oldstate;
|
|
|
|
|
+ state[1] = newstate;
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < 2; i++)
|
|
|
|
|
+ {
|
2013-01-17 17:45:17 +01:00
|
|
|
|
+ copy[i] = xmalloc (len[i] + 1);
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+
|
|
|
|
|
+ for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++)
|
|
|
|
|
+ {
|
|
|
|
|
+ state_bak = state[i];
|
|
|
|
|
+ mblength = mbrtowc (&wc, str[i] + j, len[i] - j, &(state[i]));
|
|
|
|
|
+
|
|
|
|
|
+ switch (mblength)
|
|
|
|
|
+ {
|
|
|
|
|
+ case (size_t)-1:
|
|
|
|
|
+ case (size_t)-2:
|
|
|
|
|
+ state[i] = state_bak;
|
|
|
|
|
+ /* Fall through */
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ mblength = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ if (ignore_case)
|
|
|
|
|
+ {
|
|
|
|
|
+ uwc = towupper (wc);
|
|
|
|
|
+
|
|
|
|
|
+ if (uwc != wc)
|
|
|
|
|
+ {
|
|
|
|
|
+ mbstate_t state_wc;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&state_wc, '\0', sizeof(mbstate_t));
|
|
|
|
|
+ wcrtomb (copy[i] + j, uwc, &state_wc);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ memcpy (copy[i] + j, str[i] + j, mblength);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ memcpy (copy[i] + j, str[i] + j, mblength);
|
|
|
|
|
+ }
|
|
|
|
|
+ j += mblength;
|
|
|
|
|
+ }
|
|
|
|
|
+ copy[i][j] = '\0';
|
|
|
|
|
+ len[i] = j;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
2013-01-16 20:09:57 +01:00
|
|
|
|
+ int rc = xmemcoll (copy[0], len[0], copy[1], len[1]);
|
|
|
|
|
+ free (copy[0]);
|
|
|
|
|
+ free (copy[1]);
|
|
|
|
|
+ return rc;
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
}
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
+#endif
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
/* Output the line in linebuffer LINE to standard output
|
|
|
|
|
provided that the switches say it should be output.
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -304,15 +495,43 @@ check_file (const char *infile, const ch
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
{
|
|
|
|
|
char *prevfield IF_LINT ( = NULL);
|
|
|
|
|
size_t prevlen IF_LINT ( = 0);
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ mbstate_t prevstate;
|
|
|
|
|
+
|
|
|
|
|
+ memset (&prevstate, '\0', sizeof (mbstate_t));
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
while (!feof (stdin))
|
|
|
|
|
{
|
|
|
|
|
char *thisfield;
|
|
|
|
|
size_t thislen;
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ mbstate_t thisstate;
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
|
|
|
|
|
break;
|
|
|
|
|
thisfield = find_field (thisline);
|
|
|
|
|
thislen = thisline->length - 1 - (thisfield - thisline->buffer);
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ thisstate = thisline->state;
|
|
|
|
|
+
|
|
|
|
|
+ if (prevline->length == 0 || different_multi
|
|
|
|
|
+ (thisfield, prevfield, thislen, prevlen, thisstate, prevstate))
|
|
|
|
|
+ {
|
|
|
|
|
+ fwrite (thisline->buffer, sizeof (char),
|
|
|
|
|
+ thisline->length, stdout);
|
|
|
|
|
+
|
|
|
|
|
+ SWAP_LINES (prevline, thisline);
|
|
|
|
|
+ prevfield = thisfield;
|
|
|
|
|
+ prevlen = thislen;
|
|
|
|
|
+ prevstate = thisstate;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
if (prevline->length == 0
|
|
|
|
|
|| different (thisfield, prevfield, thislen, prevlen))
|
|
|
|
|
{
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -331,17 +550,26 @@ check_file (const char *infile, const ch
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
size_t prevlen;
|
|
|
|
|
uintmax_t match_count = 0;
|
|
|
|
|
bool first_delimiter = true;
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ mbstate_t prevstate;
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
if (readlinebuffer_delim (prevline, stdin, delimiter) == 0)
|
|
|
|
|
goto closefiles;
|
|
|
|
|
prevfield = find_field (prevline);
|
|
|
|
|
prevlen = prevline->length - 1 - (prevfield - prevline->buffer);
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ prevstate = prevline->state;
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
while (!feof (stdin))
|
|
|
|
|
{
|
|
|
|
|
bool match;
|
|
|
|
|
char *thisfield;
|
|
|
|
|
size_t thislen;
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ mbstate_t thisstate;
|
|
|
|
|
+#endif
|
|
|
|
|
if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
|
|
|
|
|
{
|
|
|
|
|
if (ferror (stdin))
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -350,6 +578,15 @@ check_file (const char *infile, const ch
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
}
|
|
|
|
|
thisfield = find_field (thisline);
|
|
|
|
|
thislen = thisline->length - 1 - (thisfield - thisline->buffer);
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ thisstate = thisline->state;
|
|
|
|
|
+ match = !different_multi (thisfield, prevfield,
|
|
|
|
|
+ thislen, prevlen, thisstate, prevstate);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
match = !different (thisfield, prevfield, thislen, prevlen);
|
|
|
|
|
match_count += match;
|
|
|
|
|
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -382,6 +619,9 @@ check_file (const char *infile, const ch
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
SWAP_LINES (prevline, thisline);
|
|
|
|
|
prevfield = thisfield;
|
|
|
|
|
prevlen = thislen;
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ prevstate = thisstate;
|
|
|
|
|
+#endif
|
|
|
|
|
if (!match)
|
|
|
|
|
match_count = 0;
|
|
|
|
|
}
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -427,6 +667,19 @@ main (int argc, char **argv)
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
atexit (close_stdout);
|
|
|
|
|
|
|
|
|
|
+#if HAVE_MBRTOWC
|
|
|
|
|
+ if (MB_CUR_MAX > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ find_field = find_field_multi;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ find_field = find_field_uni;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
skip_chars = 0;
|
|
|
|
|
skip_fields = 0;
|
|
|
|
|
check_chars = SIZE_MAX;
|
|
|
|
|
Index: tests/Makefile.am
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- tests/Makefile.am.orig
|
|
|
|
|
+++ tests/Makefile.am
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -247,6 +247,7 @@ TESTS = \
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
misc/sort-debug-warn \
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
misc/sort-discrim \
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
misc/sort-files0-from \
|
|
|
|
|
+ misc/sort-mb-tests \
|
|
|
|
|
misc/sort-float \
|
|
|
|
|
misc/sort-merge \
|
|
|
|
|
misc/sort-merge-fdlimit \
|
2012-06-19 14:54:24 +02:00
|
|
|
|
@@ -543,6 +544,10 @@ TESTS = \
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
$(root_tests)
|
|
|
|
|
|
|
|
|
|
pr_data = \
|
|
|
|
|
+ misc/mb1.X \
|
|
|
|
|
+ misc/mb1.I \
|
|
|
|
|
+ misc/mb2.X \
|
|
|
|
|
+ misc/mb2.I \
|
|
|
|
|
pr/0F \
|
|
|
|
|
pr/0FF \
|
|
|
|
|
pr/0FFnt \
|
|
|
|
|
Index: tests/misc/cut
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- tests/misc/cut.orig
|
|
|
|
|
+++ tests/misc/cut
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
@@ -30,7 +30,7 @@ my $mb_locale = $ENV{LOCALE_FR_UTF8};
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
my $prog = 'cut';
|
- Update to 8.16:
- Improvements:
* As a GNU extension, 'chmod', 'mkdir', and 'install' now accept
operators '-', '+', '=' followed by octal modes;
* Also, ordinary numeric modes with five or more digits no longer
preserve setuid and setgid bits, so that 'chmod 00755 FOO' now
clears FOO's setuid and setgid bits.
* dd now accepts the count_bytes, skip_bytes iflags and the
seek_bytes oflag, to more easily allow processing portions of a
file.
* dd now accepts the conv=sparse flag to attempt to create sparse
output, by seeking rather than writing to the output file.
* ln now accepts the --relative option, to generate a relative
symbolic link to a target, irrespective of how the target is
specified.
* split now accepts an optional "from" argument to
--numeric-suffixes, which changes the start number from the
default of 0.
* split now accepts the --additional-suffix option, to append an
additional static suffix to output file names.
* basename now supports the -a and -s options, which allow
processing of more than one argument at a time. Also the
complementary -z option was added to delimit output items with
the NUL character.
* dirname now supports more than one argument. Also the complementary
z option was added to delimit output items with the NUL character.
- Bug fixes
* du --one-file-system (-x) would ignore any non-directory
specified on the command line. For example, "touch f; du -x f"
would print nothing. [bug introduced in coreutils-8.15]
* mv now lets you move a symlink onto a same-inode destination
file that has two or more hard links.
* "mv A B" could succeed, yet A would remain.
* realpath no longer mishandles a root directory.
- Improvements
* ls can be much more efficient, especially with large directories
on file systems for which getfilecon-, ACL-check- and XATTR-
check-induced syscalls fail with ENOTSUP or similar.
* 'realpath --relative-base=dir' in isolation now implies
'--relative-to=dir' instead of causing a usage failure.
* split now supports an unlimited number of split files as default
behavior.
For a detaild list se NEWS in the documentation.
- Add up-to-date german translation.
- Add two upstream patches that speed up ls (bnc#752943):
* Cache (l)getfilecon calls to avoid the vast majority of the failing
underlying getxattr syscalls.
* Avoids always-failing queries for whether a file has a nontrivial
ACL and for whether a file has certain "capabilities".
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=147
2012-04-16 17:12:46 +02:00
|
|
|
|
my $try = "Try '$prog --help' for more information.\n";
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
my $from_1 = "$prog: fields and positions are numbered from 1\n$try";
|
|
|
|
|
-my $inval = "$prog: invalid byte or field list\n$try";
|
|
|
|
|
+my $inval = "$prog: invalid byte, character or field list\n$try";
|
|
|
|
|
my $no_endpoint = "$prog: invalid range with no endpoint: -\n$try";
|
|
|
|
|
|
|
|
|
|
my @Tests =
|
- Update to 8.14. Changes since 8.12:
Bug fixes:
- ls --dereference no longer outputs erroneous "argetm" strings for
dangling symlinks when an 'ln=target' entry is in $LS_COLORS.
[bug introduced in fileutils-4.0]
- ls -lL symlink once again properly prints "+" when the referent has
an ACL. [bug introduced in coreutils-8.13]
- sort -g no longer infloops for certain inputs containing NaNs [bug
introduced in coreutils-8.5]
- chown and chgrp with the -v --from= options, now output the correct
owner. I.E. for skipped files, the original ownership is output,
not the new one. [bug introduced in sh-utils-2.0g]
- cp -r could mistakenly change the permissions of an existing
destination directory. [bug introduced in coreutils-6.8]
- cp -u -p would fail to preserve one hard link for each up-to-date
copy of a src-hard-linked name in the destination tree. I.e., if
s/a and s/b are hard-linked and dst/s/a is up to date, "cp -up s
dst" would copy s/b to dst/s/b rather than simply linking dst/s/b
to dst/s/a. [This bug appears to have been present in "the
beginning".]
- fts-using tools (rm, du, chmod, chgrp, chown, chcon) no longer use
memory proportional to the number of entries in each directory they
process. Before, rm -rf 4-million-entry-directory would consume
about 1GiB of memory. Now, it uses less than 30MB, no matter how
many entries there are. [this bug was inherent in the use of fts:
thus, for rm the bug was introduced in coreutils-8.0. The prior
implementation of rm did not use as much memory. du, chmod, chgrp
and chown started using fts in 6.0. chcon was added in
coreutils-6.9.91 with fts support. ]
- pr -T no longer ignores a specified LAST_PAGE to stop at. [bug
introduced in textutils-1.19q]
- printf '%d' '"' no longer accesses out-of-bounds memory in the
diagnostic. [bug introduced in sh-utils-1.16]
- split --number l/... no longer creates extraneous files in certain
cases. [bug introduced in coreutils-8.8]
- timeout now sends signals to commands that create their own process
group. timeout is no longer confused when starting off with a
child process. [bugs introduced in coreutils-7.0]
- unexpand -a now aligns correctly when there are spaces spanning a
tabstop, followed by a tab. In that case a space was dropped,
causing misalignment. We also now ensure that a space never
precedes a tab. [bug introduced in coreutils-5.3.0]
New features:
- date now accepts ISO 8601 date-time strings with "T" as the
separator. It has long parsed dates like "2004-02-29 16:21:42"
with a space between the date and time strings. Now it also parses
"2004-02-29T16:21:42" and fractional-second and time-zone-annotated
variants like "2004-02-29T16:21:42.333-07:00"
- md5sum accepts the new --strict option. With --check, it makes the
tool exit non-zero for any invalid input line, rather than just warning.
This also affects sha1sum, sha224sum, sha384sum and sha512sum.
- split accepts a new --filter=CMD option. With it, split filters
output through CMD. CMD may use the $FILE environment variable,
which is set to the nominal output file name for each invocation of
CMD. For example, to split a file into 3 approximately equal
parts, which are then compressed:
split -n3 --filter='xz > $FILE.xz' big
Note the use of single quotes, not double quotes. That creates
files named xaa.xz, xab.xz and xac.xz.
- timeout accepts a new --foreground option, to support commands not
started directly from a shell prompt, where the command is
interactive or needs to receive signals initiated from the
terminal.
Improvements:
- md5sum --check now supports the -r format from the corresponding
BSD tool. This also affects sha1sum, sha224sum, sha384sum and
sha512sum.
- pwd now works also on systems without openat. On such systems, pwd
would fail when run from a directory whose absolute name contained
more than PATH_MAX / 3 components. The df, stat and readlink
programs are also affected due to their use of the canonicalize_*
functions.
- join --check-order now prints "join: FILE:LINE_NUMBER: bad_line"
for an unsorted input, rather than e.g., "join: file 1 is not in
sorted order".
- shuf outputs small subsets of large permutations much more
efficiently. For example `shuf -i1-$((2**32-1)) -n2` no longer
exhausts memory.
- stat -f now recognizes the GPFS, MQUEUE and PSTOREFS file system
types.
- timeout now supports sub-second timeouts.
Changes in behavior:
- chmod, chown and chgrp now output the original attributes in
messages, when -v or -c specified.
- cp -au (where --preserve=links is implicit) may now replace newer
files in the destination, to mirror hard links from the source.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=128
2011-10-14 12:07:06 +02:00
|
|
|
|
@@ -147,7 +147,7 @@ my @Tests =
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
|
|
|
|
|
# None of the following invalid ranges provoked an error up to coreutils-6.9.
|
|
|
|
|
['inval1', qw(-f 2-0), {IN=>''}, {OUT=>''}, {EXIT=>1},
|
|
|
|
|
- {ERR=>"$prog: invalid decreasing range\n$try"}],
|
|
|
|
|
+ {ERR=>"$prog: invalid byte, character or field list\n$try"}],
|
|
|
|
|
['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
|
|
|
|
|
['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
|
2011-01-05 14:31:58 +01:00
|
|
|
|
['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1},
|
2013-01-16 20:09:57 +01:00
|
|
|
|
@@ -176,13 +176,13 @@ if ($mb_locale ne 'C')
|
|
|
|
|
# non-MB: invalid byte or field list
|
|
|
|
|
# MB: invalid byte, character or field list
|
|
|
|
|
# Adjust the expected error output accordingly.
|
|
|
|
|
- if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval}
|
|
|
|
|
- (@new_t))
|
|
|
|
|
- {
|
|
|
|
|
- my $sub = {ERR_SUBST => 's/, character//'};
|
|
|
|
|
- push @new_t, $sub;
|
|
|
|
|
- push @$t, $sub;
|
|
|
|
|
- }
|
|
|
|
|
+# if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval}
|
|
|
|
|
+# (@new_t))
|
|
|
|
|
+# {
|
|
|
|
|
+# my $sub = {ERR_SUBST => 's/, character//'};
|
|
|
|
|
+# push @new_t, $sub;
|
|
|
|
|
+# push @$t, $sub;
|
|
|
|
|
+# }
|
|
|
|
|
push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}];
|
|
|
|
|
}
|
|
|
|
|
push @Tests, @new;
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
Index: tests/misc/mb1.I
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ tests/misc/mb1.I
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
|
|
+Apple@10
|
|
|
|
|
+Banana@5
|
|
|
|
|
+Citrus@20
|
|
|
|
|
+Cherry@30
|
|
|
|
|
Index: tests/misc/mb1.X
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ tests/misc/mb1.X
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
|
|
+Banana@5
|
|
|
|
|
+Apple@10
|
|
|
|
|
+Citrus@20
|
|
|
|
|
+Cherry@30
|
|
|
|
|
Index: tests/misc/mb2.I
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ tests/misc/mb2.I
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
|
|
+Apple@AA10@@20
|
|
|
|
|
+Banana@AA5@@30
|
|
|
|
|
+Citrus@AA20@@5
|
|
|
|
|
+Cherry@AA30@@10
|
|
|
|
|
Index: tests/misc/mb2.X
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ tests/misc/mb2.X
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
|
|
+Citrus@AA20@@5
|
|
|
|
|
+Cherry@AA30@@10
|
|
|
|
|
+Apple@AA10@@20
|
|
|
|
|
+Banana@AA5@@30
|
|
|
|
|
Index: tests/misc/sort-mb-tests
|
|
|
|
|
===================================================================
|
2013-01-16 20:09:57 +01:00
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ tests/misc/sort-mb-tests
|
- Update to 8.6:
o bugfixes
* du no longer multiply counts a file that is a directory or whose
link count is 1.
* du -H and -L now consistently count pointed-to files instead of
symbolic links, and correctly diagnose dangling symlinks.
* du --ignore=D now ignores directory D even when that directory is
found to be part of a directory cycle.
* split now diagnoses read errors rather than silently exiting.
* tac would perform a double-free when given an input line longer
than 16KiB.
* tail -F once again notices changes in a currently unavailable
directory, and works around a Linux kernel bug where inotify runs
out of resources.
* tr now consistently handles case conversion character classes.
o New features
* cp now accepts the --attributes-only option to not copy file data.
* du recognizes -d N as equivalent to --max-depth=N
* sort now accepts the --debug option, to highlight the part of the
line significant in the sort, and warns about questionable options.
* sort now supports -d, -f, -i, -R, and -V in any combination.
* stat now accepts the %m format directive to output the mount point
for a file. It also accepts the %w and %W format directives for
outputting the birth time of a file, if one is available.
o Changes in behavior
* df now consistently prints the device name for a bind mounted file,
rather than its aliased target.
* du now uses less than half as much memory when operating on trees
with many hard-linked files.
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=18
2010-11-11 18:25:53 +01:00
|
|
|
|
@@ -0,0 +1,58 @@
|
|
|
|
|
+#! /bin/sh
|
|
|
|
|
+case $# in
|
|
|
|
|
+ 0) xx='../src/sort';;
|
|
|
|
|
+ *) xx="$1";;
|
|
|
|
|
+esac
|
|
|
|
|
+test "$VERBOSE" && echo=echo || echo=:
|
|
|
|
|
+$echo testing program: $xx
|
|
|
|
|
+errors=0
|
|
|
|
|
+test "$srcdir" || srcdir=.
|
|
|
|
|
+test "$VERBOSE" && $xx --version 2> /dev/null
|
|
|
|
|
+
|
|
|
|
|
+export LC_ALL=en_US.UTF-8
|
|
|
|
|
+locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77
|
|
|
|
|
+errors=0
|
|
|
|
|
+
|
|
|
|
|
+$xx -t @ -k2 -n misc/mb1.I > misc/mb1.O
|
|
|
|
|
+code=$?
|
|
|
|
|
+if test $code != 0; then
|
|
|
|
|
+ $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2
|
|
|
|
|
+ errors=`expr $errors + 1`
|
|
|
|
|
+else
|
|
|
|
|
+ cmp misc/mb1.O $srcdir/misc/mb1.X > /dev/null 2>&1
|
|
|
|
|
+ case $? in
|
|
|
|
|
+ 0) if test "$VERBOSE"; then $echo "passed mb1"; fi;;
|
|
|
|
|
+ 1) $echo "Test mb1 failed: files misc/mb1.O and $srcdir/misc/mb1.X differ" 1>&2
|
|
|
|
|
+ (diff -c misc/mb1.O $srcdir/misc/mb1.X) 2> /dev/null
|
|
|
|
|
+ errors=`expr $errors + 1`;;
|
|
|
|
|
+ 2) $echo "Test mb1 may have failed." 1>&2
|
|
|
|
|
+ $echo The command "cmp misc/mb1.O $srcdir/misc/mb1.X" failed. 1>&2
|
|
|
|
|
+ errors=`expr $errors + 1`;;
|
|
|
|
|
+ esac
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
+$xx -t @ -k4 -n misc/mb2.I > misc/mb2.O
|
|
|
|
|
+code=$?
|
|
|
|
|
+if test $code != 0; then
|
|
|
|
|
+ $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2
|
|
|
|
|
+ errors=`expr $errors + 1`
|
|
|
|
|
+else
|
|
|
|
|
+ cmp misc/mb2.O $srcdir/misc/mb2.X > /dev/null 2>&1
|
|
|
|
|
+ case $? in
|
|
|
|
|
+ 0) if test "$VERBOSE"; then $echo "passed mb2"; fi;;
|
|
|
|
|
+ 1) $echo "Test mb2 failed: files misc/mb2.O and $srcdir/misc/mb2.X differ" 1>&2
|
|
|
|
|
+ (diff -c misc/mb2.O $srcdir/misc/mb2.X) 2> /dev/null
|
|
|
|
|
+ errors=`expr $errors + 1`;;
|
|
|
|
|
+ 2) $echo "Test mb2 may have failed." 1>&2
|
|
|
|
|
+ $echo The command "cmp misc/mb2.O $srcdir/misc/mb2.X" failed. 1>&2
|
|
|
|
|
+ errors=`expr $errors + 1`;;
|
|
|
|
|
+ esac
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
+if test $errors = 0; then
|
|
|
|
|
+ $echo Passed all 113 tests. 1>&2
|
|
|
|
|
+else
|
|
|
|
|
+ $echo Failed $errors tests. 1>&2
|
|
|
|
|
+fi
|
|
|
|
|
+test $errors = 0 || errors=1
|
|
|
|
|
+exit $errors
|