- When an error occurs processing one file, we must continue to process
the remaining files.
- Convert trailing whitespace to tabs as appropriate.
- Align backspace handling with what the verification suite expects.
Reviewed by: mike
Exit with nonzero status if a conversion failed.
Play nice if used as a shell builtin (currently disabled).
Submitted by: bde (partially)
Approved by: mike
1. The committer refused to respond to questions over the commit.
2. The servers rlogind, rshd, rexecd were not wrapped.
3. "rcmnds" as an abbreviation gets an order of magnitude less hits on
Google than the much more well known "rcmds".
to the way expand(1) allows. This brings unexpand(1) up to SUSv3 conformance,
and it now passes all relevant parts of the GNU textutils test suite.
PR: 35621
Reviewed by: mike
processing them.
- \c escape to immediately stop output (similar to echo's \c)
- \0NNN should be allowed for octal character escapes (instead of just \NNN)
- %b conversion, which is like %s but interprets \n \t etc. inside the
string is missing.
And I may not be any poet, but in lieu of an in-tree regression test:
ref5% ./printf '%s%b%b%c%s%d\n' 'PR' '\0072' '\t' '3' '56' 0x10
PR: 35616
Submitted by: tjr
MFC after: 1 week
Cast sizeof() to (int), as it's being compared against an int, not a size_t.
If i is changed to a size_t, it means the logic must be slightly changed later
in the flow, where --i is checked to be >= 0. I am not sure I want to make a
logic change to account for clearing up a warning, when an aesthetic one will
keep from modifying the logic.
Other harmless casts, that I think I've made in the right directions.
Make gpbc() an inline function, rather than an obfuscated macro, make its
scratch space local, rather than global. The previous macro used a dirty
hack (logical AND in place of a conditional) which would lead GCC to throw
a fit (rightly so) as the logical check, as well as the incrementation of
a variable, were not used for anything.
const'ify a few places where gcc3 yells. xstrdup() some global consts in
places where we xstrdup() when not using consts, but tried to assign them
to non-consts before.
Don't use execv(2) if we don't have the kind of arguments it wants.
Reviewed by: asmodai obrien tjr
Submitted by: tjr (a gcc3 build log)
Merge xargs(1) with that of xMach.
Bring in xargs(1) changes to add -L and -I as per the Single Unix Specification
version 3. Proper exit status numbers are implemented, and the manual page has
been updated to reflect reality.
The code has been ANSIfied, and a new file has been added to xargs(1) to do the
substring substitution as SUSv3 requires.
Traditional behaviour should not be affected, use of -J should be deprecated
in favor of the more portable -I (though -J has been left, for now).
Submitted by: me, tjr (the exit status stuff)
Obtained from: xMach
$FreeBSD$ identifiers, and fix initialisation to stderr to happen in a function
as stderr is not the same in CURRENT as in OpenBSD.
Reviewed by: obrien
- ifdefs around vendor sccsid were left reversed after switching to
__FBSDID().
- vertical whitespace after some of the non-FALLTHROUGH cases was lost.
- too much vertical whitespace before prototypes.
- don't use unusual indentation for 39 lines of declarations when only 2
of the lines benefit from it.
- don't use __DECONST(). This was the one use of it in the tree, and it
was just wrong. It was used to hide the warning about tgetnum() having
the wrong prototype (missing a `const') due to libncurses being
misconfigured. libncurses has been fixed, so the original code now
compiles cleanly with WARNS=4.
option (try to break at word bounaries) for SUSv3 conformance.
Partially based on the NetBSD version, with the following changes:
- style(9)
- break on <blank>s, not spaces, per POSIX (and GNU)
- when looking for last space on line, search backwards instead of
forwards; less comparisons needed this way.
- use LINE_MAX macro instead of a magic number and a comment saying it is
LINE_MAX.
PR: 36245
Reviewed by: mike
Obtained from: NetBSD (partially)