Commit Graph

5183 Commits

Author SHA1 Message Date
Bruce Evans
0b94059ea3 Fixed 5 style bugs in VCS ids. 2002-05-12 04:02:57 +00:00
Mike Barcroft
b2c80b69eb Finish converting the rest of the function declaration and prototypes
to ANSI C.  Use new source ID scheme.
2002-05-12 03:56:34 +00:00
Bruce Evans
a8f9c5c794 Fixed printing the the strip binary's name in error messages. 2002-05-12 03:47:23 +00:00
Brian S. Dean
73f899cae1 To perform even basic error checking, one must have an exit code that
indicates that not everything worked as expected.  Exit non-zero if we
timed out while transmitting or receiving a file or if the file did
not exist, etc.

MFC After:	3 days (re@ willing)
2002-05-12 01:47:50 +00:00
Marcel Moolenaar
441b1ec776 Add support for stripping non-native object files by using an
environment variable that specifies the name of the strip(1)
program to use. The envvar is "STRIPBIN". The more natural
choice would be "STRIP", but that one is taken already.
2002-05-11 19:15:15 +00:00
Alfred Perlstein
3a9818f926 unbreak build:
K&R style main() makes gcc emit a warning about missing prototypes so
switch to ANSI.
2002-05-11 03:29:04 +00:00
Chris D. Faulhaber
753d42d2ea #include <stdlib.h> for exit(3) prototype. 2002-05-11 03:18:14 +00:00
David E. O'Brien
498e57a7a4 BWK awk appears to work for world builds just fine now. We want to make
sparc64 the same as the other platforms -- so do it by moving the other
platforms toward the sparc64.
2002-05-10 20:36:21 +00:00
Ruslan Ermilov
8e0a87c1b3 xargs.c,v 1.33 broke the upgrade path from old versions of 4.x and 5.0. 2002-05-10 13:06:34 +00:00
Thomas Gellekum
486730f7fd Cast the uc_mcontext member to regcontext *, not the whole ucontext_t.
PR:		35449
Submitted by:	Stefan Farfeleder <e0026813@stud3.tuwien.ac.at>
2002-05-10 10:40:46 +00:00
Thomas Gellekum
ca25eaf630 Fix wrong bitmask. 2002-05-10 10:37:57 +00:00
Tim J. Robbins
c17fd4b5cf According to POSIX, exit status must be 127 if the requested utility was not
found, 126 if the execvp() failed for any other reason.

Similar to rev. 1.6 to src/usr.bin/env/env.c

Reviewed by:	mike
2002-05-10 06:39:16 +00:00
Tim J. Robbins
38a9994201 Reimplement the who(1) utility to add some features required by SUSv3:
-H option (show column headings),
-T (show mesg(1) state),
-m (same as "am I"),
-u (show idle time),
-q (quick mode; list names in columns).

PR:		36128
Reviewed by:	mike
2002-05-09 23:04:40 +00:00
Josef Karthauser
1063e12617 Replace /kernel with /boot/kernel/kernel.
PR:		docs/37757
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-05-09 11:47:42 +00:00
Dag-Erling Smørgrav
7dac28cfc3 Back out part of previous commit - K&R doesn't have const. 2002-05-09 11:24:58 +00:00
Dag-Erling Smørgrav
0081eff379 Make _msgout take a const char * rather than a char *.
Sponsored by:	DARPA, NAI Labs
2002-05-08 14:50:28 +00:00
Jun Kuriyama
18ddb1400d Change whtespace indent in format string to fit new output form of
timestamp.

Reviewed by:	markm
2002-05-08 11:23:45 +00:00
Dag-Erling Smørgrav
f882171a2e These files haven't been used in a while. 2002-05-08 01:35:22 +00:00
Dag-Erling Smørgrav
f1d0592537 Use libutil and libypclnt for all passwd manipulation and NIS needs.
Sponsored by:	DARPA, NAI Labs
2002-05-08 00:54:29 +00:00
Dag-Erling Smørgrav
c8466cf99c Really include <paths.h> (it seems it was brought in indirectly) 2002-05-08 00:47:02 +00:00
Dag-Erling Smørgrav
99b82bb76a Use <paths.h> rather than "pathnames.h", and fix a couple of whitespace nits.
Sponsored by:	DARPA, NAI Labs
2002-05-08 00:47:01 +00:00
Juli Mallett
90f7fe63e9 Oops, update usage() to have -i. 2002-05-07 23:33:44 +00:00
Juli Mallett
5d16412db7 Add handling for any nil-length string passed to -i for the backup extension.
Add a note that this is kinda-sorta dangerous to the manual page.
2002-05-07 23:32:26 +00:00
Juli Mallett
d88e9d841a Un-shadow the `fname' variable. 2002-05-07 23:06:47 +00:00
Juli Mallett
839af0c103 Add a -i option to sed(1) to do inplace editing, to give us an alternative to
Perl for such things.  The key difference to Perl is that a backup extension
*MUST* be specified, because on one hand it isn't recommended to have options
which optionally take a parameter, and on the other hand, it'd be slightly
unpleasent to implement proper handling for that.

The difference between this and the version posted to developers@ is that it
does handle multiple files in argv after the getopt(3) handling "correctly",
in that the inplace editing-specific code has been moved out to a function,
and that function is used beyond the first file in our linked list.

This option has been documented as FreeBSD-specific in the manpage.

Reviewed by:	developers@ (got feedback from: des, fanf, sobomax, roberto,
		obrien)
MFC after:	1 week
2002-05-07 18:32:18 +00:00
Tony Finch
bf9a017589 Add myself.
Reviewed by:	dwmalone (mentor)
2002-05-07 11:09:40 +00:00
Ruslan Ermilov
b7a6ce1b2f Make sure the file in Attic is really "dead".
Problem found by:	ken
2002-05-07 06:57:04 +00:00
Tim J. Robbins
17b3efd432 Affect the first of stdin, stdout and stderr that is attached to a terminal.
Write status information to stdout instead of stderr.
Exit status when an error occurs musn't be 1, that is reserved for
indicating that messages are disabled.

These changes bring mesg(1) up to SUSv3 conformance.

Reviewed by:	mike
2002-05-06 04:33:04 +00:00
Juli Mallett
b23de8a352 -I and -J both set the same variable, replstr, to the string to replace with
a line of input, and both work differently, so prevent them from both being
passed to xargs(1).
2002-05-06 03:38:28 +00:00
Mark Peek
802e753167 - Properly initialize the count_win when the user turns the info window
back on (and count_win is recreated).
- Create info_win as the same size for all invocations.

PR:             37552
Submitted by:   Mark Valentine <mark@thuvia.demon.co.uk>
MFC after:      1 week
2002-05-06 00:25:36 +00:00
Juli Mallett
417485c74a Fix make(1) behaviour regarding SysV-style substitution when given a nil
left-hand-side.

PR:		bin/5297
Submitted by:	"Matthew Emmerton" <matt@gsicomp.on.ca>
MFC after:	1 week
2002-05-05 19:04:58 +00:00
Juli Mallett
305e39f49b Modify the -p implementation to use a user's locale, so they can respond to
the prompt in their native language.

Also make the prompt fit what POSIX asks for (?...).

This should not affect use of -p with yes(1) [as every locale I know of matches
'y' as YESEXPR as well], but that's what -t is for anyway.  -p is meant to be
really used interactively.

Submitted by:	tjr, jmallett
2002-05-05 06:42:44 +00:00
Juli Mallett
5eb40323b0 Fix a typo.
Submitted by:	Carl Schmidt <cschmidt@slackerbsd.org>

Wrap an obscenely long line while I'm here.
2002-05-05 05:15:16 +00:00
Juli Mallett
9104507502 In an effort to make this utility easier to work with at a source level, move
out the parse loop to a seperate function, and move local variables around as
is needed.  To keep the state of some variables and keep from having huge arg
lists to functions, make a bunch global.

Change use of err(3) in situations where malloc(3) will be setting errno to
errx(3) since assuming malloc(3) sets errno is non-portable, and provides no
more useful information in the context of FreeBSD.

Submitted by:	bde (err/errx), Carl Schmidt <cschmidt@slackerbsd.org> (some
		of the movement of the input loop to a function)
Approved by:	src/tools/regression/usr.bin/xargs
2002-05-05 02:46:53 +00:00
Jeroen Ruigrok van der Werven
cdb886795d Document the fact that at(1) is run through cron(8) and that this affects
the granularity of the at queue runs.

Submitted by:	mux
2002-05-04 15:33:12 +00:00
Jonathan Mini
3c00eca519 Add myself.
Approved by:	alfred
2002-05-04 06:34:11 +00:00
Juli Mallett
9bf450b850 Grouping changes.
Submitted by:	Carl Schmidt <cschmidt@slackerbsd.org>
2002-05-04 06:00:19 +00:00
Juli Mallett
3dca1afc60 Don't use pointers as booleans. 2002-05-04 05:53:02 +00:00
Juli Mallett
b6594dba8b Replace calloc(3) with malloc(3), and set the tail of the
argument list to NULL, to terminate the arguments passed
to execvp(2).

Thanks to:	bde (for pointing out some missing parens)

And with apologies to Ozzy Osbourne:

	On his way to dinner
	It took him by surprise
	When an email from bde
	Said his code was full of lies

	Style (indentation)
	And his bracing were all wrong
	He casted to size_t
	When he should have cast to long

	I don't mind

	Single letter identifiers
	Unwrapped Line
	Over 80 chars
	Far over 80 chars

	Who can we get to send diffs
	We need Bruce D. Evans
	Shows you comparason to his
	We need Bruce D. Evans again
2002-05-04 00:08:06 +00:00
Juli Mallett
a1269e01b8 Rename eqrelval' which was renamed from eqrel' to quiet a shadow warning
to `op' as suggested by Bruce, as this is used to store the operator between
vl and vr.

Submitted by:	bde
2002-05-03 20:46:10 +00:00
Juli Mallett
38dff9a439 Fix a bug whereby we were getting ~0 and comparing it to maxsize, i.e. if
s1 was 0 length, and replstr was 0 length, etc., we would end up subtracting
one from zero and seeing if it was greater than the size_t (unsigned) var
maxsize...  This would cause us to return a string consisting of essentially
only match, which is not the right behaviour if we have 0 length inpline.
2002-05-03 19:45:41 +00:00
Juli Mallett
263dc775f2 Move substitution out to a function, prerun(), and replace use of run() with
it.  It handles everything (right now) that needs done before run(), except
the -J case, because while that would be easy, I don't quite understand -J.

Reviewed by:	src/tools/regression/usr.bin/xargs
2002-05-03 17:41:54 +00:00
Juli Mallett
b9b03ba0bc Get rid of bogus holder for realloc(3). 2002-05-03 17:13:29 +00:00
Juli Mallett
1925cb245c Rewrite the loop that handles substitution in the -I case, and try to make
it easier to understand.  Making it easy to understand isn't all that easy,
so litter the code with comments so some other poor soul can come along some
day and work on this if they see fit to do so.  Avoid calling strlen(3) to
check for a nil-string, when we can just check for *str=='\0'.

Approved by:    src/tools/regression/usr.bin/xargs/
2002-05-03 17:05:25 +00:00
Juli Mallett
4f49da74db Rename lflag' to Lflag' to match the option's case. 2002-05-03 16:32:03 +00:00
Juli Mallett
d7a43b245d Revert revision 1.22. I incorrectly modified the Berkeley identifiers.
Requested by:	bde, mike
2002-05-03 14:50:31 +00:00
Juli Mallett
90432ef88d Revert vendor identifiers, and #if 0 what is #if 0/#else for OpenBSD.
Add __FBSDID() properly.

Requested by:	bde, mike
2002-05-03 14:48:21 +00:00
Tim J. Robbins
c459e06c78 Add the csplit(1) utility, which splits files based on context, as specified
by SUSv3.

This Makefile got left out of the previous commit.

PR:             36191
Reviewed by:    mike
2002-05-02 07:54:04 +00:00
Tim J. Robbins
ea9e961cb2 Add the csplit(1) utility, which splits files based on context, as specified
by SUSv3.

PR:		36191
Reviewed by:	mike
2002-05-02 07:46:36 +00:00
Juli Mallett
8f12fc049c Remove redundant declarations of getopt(3) externals (since <unistd.h> does
take care of them), and add __FreeBSD__ to the defined() checks for the
_PATH_DIVNAME.
2002-05-02 05:25:23 +00:00
Juli Mallett
eee11f05b4 __COPYRIGHT() and __SCCSID(). 2002-05-02 05:21:35 +00:00
Juli Mallett
76ccb81ef2 An explicit cast to size_t for an inline integer, since the two are not the
same on Alpha and lint(1) pointed that out.

lint(1) on the same architecture pointed out how silly a cast to (u_int) to
malloc(3)'s argument was.  Change that to size_t.
2002-05-02 05:07:13 +00:00
Juli Mallett
943e841433 A markup fix, and document -R as non-standard. 2002-05-02 03:29:38 +00:00
Juli Mallett
b50a72861d Make -J a proper flag internal to the code (rather than just check for
use of replstr and lack of Iflag), and add -R, which when given with
-I controls the number of arguments on which replacement will be done.

Some people happen to think it's idiotic to limit to 5 arguments, so
let the user override it if they like.
2002-05-02 02:42:34 +00:00
Juli Mallett
299ea75ab7 *str is spelled 's1' inside the body of the code.
Make 'this' not a local variable, since it isn't necessary or complex enough
to warrant such.
2002-05-02 02:15:06 +00:00
Juli Mallett
0fa5e8dc42 Rework some of the -I support so I can't find a way to make xargs(1) core or
corrupt memory.  Simplifies the code in one or two places, also removes some
code that looks like it was bogus or incomplete.

Update strnsubst to have one or two extra conditions which maybe would make
it more efficient, or at least more versatile.  This is likely a no-op.
2002-05-02 02:06:03 +00:00
Juli Mallett
26849aba03 Add some spurious veritcal whitespace to reduce diffs to OpenBSD. 2002-05-01 21:45:22 +00:00
Juli Mallett
bd2bfb5846 Merge local changes again, against ANSIfied m4(1). 2002-05-01 21:37:29 +00:00
Peter Wemm
02b8e10aad Do not bother with #include <machine/psl.h> since it is just a stub file
that says something like "/* Not used on Alpha */".
2002-05-01 06:23:48 +00:00
Jake Burkholder
71f9b2c0aa Build elf2aout for sparc64. 2002-04-30 02:42:23 +00:00
David Malone
d00a7c247a Don't use ISO_8859 when I should use ISO8859. 2002-04-29 20:57:36 +00:00
Ruslan Ermilov
f7bf276ff5 Do not override the `install' target. 2002-04-29 10:28:11 +00:00
David Malone
df374705d2 Add a French calendar.
PR:		32265
Submitted by:	Thierry Thomas <thierry@pompo.net>
MFC after:	1 week
2002-04-28 23:22:13 +00:00
Mark Murray
6c28b67b1e Minor nit; return(foo) from main rather than exit(foo). 2002-04-28 14:04:24 +00:00
Mark Murray
5d09098835 Very minor whitespace nit. 2002-04-28 13:59:42 +00:00
Mark Murray
4d56f83516 Remove GCC-specific flags. 2002-04-28 13:58:41 +00:00
Mark Murray
4b1b25d919 Reorder for style. 2002-04-28 13:54:45 +00:00
Mark Murray
5666a04546 Remove GCC-specific flags. 2002-04-28 13:53:38 +00:00
Mark Murray
1abf87a869 Fix VCS tags; ANSIfy functions 2002-04-28 13:50:54 +00:00
Mark Murray
5a92bc60c9 Add some function prototypes to squash warnings. 2002-04-28 13:49:15 +00:00
Mark Murray
60d1fdaa47 Easy warns fixes; sort out some types and me them a bit more consistent;
fix initialisers.
2002-04-28 13:46:40 +00:00
Mark Murray
01588bbd2b Warnings fix; ANSIfy, constify, mark unused function parameter(s). 2002-04-28 13:00:16 +00:00
Mark Murray
a53809fd7e Warns; ANSIfy, constify and move declarations into a common header. 2002-04-28 12:55:35 +00:00
Mark Murray
f5b7af34dd Remove GCC-specific flags. 2002-04-28 12:54:24 +00:00
Mark Murray
9e5ff032b5 Fix a const-char vs char issue. 2002-04-28 12:39:12 +00:00
Mark Murray
900d70a0c0 Very minor whitespace nit. 2002-04-28 12:36:56 +00:00
Mark Murray
046f5106a7 Declarations cleanup; make sure externs are in a common header.
Fix declarations, casts and return values.
2002-04-28 12:34:54 +00:00
Mark Murray
ffc6a8e325 warns fixes; ANSIfy, deregister, constify. 2002-04-28 12:28:41 +00:00
Mark Murray
f372d010df Easy warns fixes; constify. 2002-04-28 12:25:03 +00:00
Mark Murray
348870705a Style; line up columns, space things out more consistently. 2002-04-28 12:24:20 +00:00
Mark Murray
81edeb0a44 Style fixes; whitespace and header order. 2002-04-28 12:21:31 +00:00
Mark Murray
635615eb2c Fix VCS inclusion and tidy up #includes. 2002-04-28 12:19:30 +00:00
Mark Murray
241667c457 Cast to kill warnings. De-register. 2002-04-28 12:17:27 +00:00
Mark Murray
e65dd7bc2f fix warnings; change variable/argument names that mask global names. 2002-04-28 12:15:40 +00:00
Mark Murray
2d3f94bf1b Remove GCC-specific flags and commented out cruft. 2002-04-28 12:14:10 +00:00
Mark Murray
fa6d48c068 Some easy const fixes. 2002-04-28 12:12:49 +00:00
Mark Murray
dba464cc27 ANSIfy, VCS inclusions and some very minor style. 2002-04-28 12:09:33 +00:00
Mark Murray
f099c6c361 Minor reorder for style. 2002-04-28 12:08:18 +00:00
Mark Murray
561618799d Fix some easy warnings; ANSIfy, constify.
Fix VCS inclusion and deregister.
2002-04-28 12:04:20 +00:00
Mark Murray
822f14c2ff ANSIfy functions, and move extern declarations into a shared header
where ${DEITY} intended them to be.
2002-04-28 11:59:43 +00:00
Mark Murray
8feb878d72 Fix VCS inclusions. 2002-04-28 11:52:43 +00:00
Mark Murray
78552e79d1 More low hanging warnings fruit; ANSIfy, de-register, constify. 2002-04-28 11:51:03 +00:00
Mark Murray
ff288009d9 Fix some low-hanging fruit in the warnings department; ANSIfy functions,
sort out some const issues.
2002-04-28 11:44:30 +00:00
Mark Murray
e7c7159542 Easy warns fixes; use const, mark unused function parameters. Remove
unused includes.
2002-04-28 11:16:43 +00:00
Mark Murray
c0bef837ba Remove GCC-specific flags. 2002-04-28 11:15:47 +00:00
Mark Murray
d629fa16d5 Trivial warnings fixes; staticise and use unsigned.
Use __FBSDID().
2002-04-28 11:13:20 +00:00
Mark Murray
791e544b6b Use __FBSDID, ANSIfy functions, fix const string. 2002-04-28 11:00:34 +00:00
Mark Murray
a827060a67 Use __FBSDID(), ANSIfy headings, use const/unsigned in minor but
appropriate places.
2002-04-28 10:56:09 +00:00
Mark Murray
fb46863912 Style only; format function declarations, sort header includes, and
use __FBSDID().
2002-04-28 10:49:15 +00:00
Hajimu UMEMOTO
a2df389f20 Backout copyright notice I broke by my previous commit. 2002-04-26 12:16:34 +00:00