Commit Graph

5423 Commits

Author SHA1 Message Date
jmallett
64477eb2ea Set the MAKEFILE variable to the value passed to ReadMakefile(), not the full
path to it.  Use the full path only for parsing it.
2002-05-23 12:01:54 +00:00
jmallett
28296cf1d3 Make my style consistent.
Remove two includes.

Fix a typo (semicolon instead of period at EOL).
2002-05-23 03:03:44 +00:00
jmallett
981165838b Taking a leap of faith, tie the help command in to the build. 2002-05-22 23:15:58 +00:00
jmallett
df0fe27516 Add my PD implementation of the SCCS help command, which prints help from
files in the format used by SCCS, given a key.  It behaves exactly like the
``proper'' SCCS help command, from what testing I can do.
2002-05-22 23:14:17 +00:00
jmallett
050fe17638 Tie sccs(1) in to the build, as it now does one thing right: sccs what 2002-05-22 16:19:31 +00:00
jmallett
51cd687bb8 Remove mention of the GNU version of ptx, it is dead. 2002-05-22 16:18:14 +00:00
jmallett
618595e7c7 Add a usage().
Print usage() if right before executing the specified command, it comes to be
that *argv is NULL (i.e. a flag was specified without a command being given).
2002-05-22 16:09:52 +00:00
jmallett
a00707167b Remove #ifndef's on V6. 2002-05-22 16:01:50 +00:00
jmallett
844f8bb282 Put braces around the command table properly. 2002-05-22 15:59:27 +00:00
jmallett
26ab0525a8 Use what(1) here, in /usr/bin/what. It doesn't print error 26 correctly, but
neither does the pd sccs(1) implementation I have around, so there's no loss
for now.
2002-05-22 15:44:29 +00:00
jmallett
a743481874 str_concat() doesn't really take const arguments.
Submitted by:	bde
Pointy hat to:	jmallett
2002-05-22 15:34:00 +00:00
ru
7d529109a8 Do not run shell from /bin, run it from $PATH.
Bump MAKE_VERSION to 5200205221.
2002-05-22 14:53:18 +00:00
ru
367d0965de Added the MAKE_VERSION global that could be useful in determining
if a given make(1) is feature-compatible with a set of makefiles.

When merged, this will be used to replace the ugly upgrade_checks
hacks in src/Makefile.

Version has the RYYYYMMDDX format, where R is from RELENG_<R> and
X allows for 10 distinguishable changes per day.

Discussed with:	bde
2002-05-22 14:35:47 +00:00
jmallett
a9a1aecd79 Format internal commands properly.
Kill a bit of trailing whitespace.

Fix a path format.

Submitted by:	mdoc(7) police (ru)
2002-05-22 14:17:16 +00:00
jmallett
68ea1628ef Clean up the manual page by leaps and bounds in terms of formatting.
Ruslan's version took away the '.Nm' for some commands, but not others, so
I chose to go with leaving '.Nm'.

Submitted by:	ru
2002-05-22 13:59:52 +00:00
jmallett
199da7245a Make the guarded string functions take a const "from" addr, and make the
function that prints when a botched guarded string operation occurs take
two const arguments.

XXX Should we use strlcat/strlcpy instead and hope for the best?
2002-05-22 13:41:08 +00:00
jmallett
1ce96038da Remove register qualifier. 2002-05-22 12:32:54 +00:00
jmallett
56fd2c2ae6 Use function prototypes. 2002-05-22 12:31:40 +00:00
jmallett
b9b88260ff Clean up formatting. 2002-05-22 11:29:21 +00:00
jmallett
59fd383a6e Replace the evil that is __DECONST() with (void *). This is one of the least
evil things we can do involving the const qualifier and a pointer.

Submitted by:	bde, ru
2002-05-22 11:16:48 +00:00
jmallett
aef64f84a3 Make sccs(1) compile cleanly by fixing syntax errors such as #endif followed
by a token, and by including headers to get prototypes for many things, and
also by spelling the type of structure readdir(3) returns as "dirent".
2002-05-22 11:10:03 +00:00
ru
db664693ee Unroff all forms of \f and \*, and the simplest form of \s.
Submitted by:	fenner, ru
Reviewed by:	ru, fenner
2002-05-22 11:08:41 +00:00
jmallett
b8afb8db22 Revive the SCCS front-end, sccs(1), back from the Attic, since it's something
SUS wants (they want the entire suite of SCCS commands, we don't have them,
but we *had* the frontend, so we can have it again, and now).

Add $FreeBSD$ where appropriate, don't revive PSD.doc/spell.ok.
2002-05-22 10:43:50 +00:00
tjr
f37a06e269 Build pathchk(1). 2002-05-22 10:32:24 +00:00
tjr
6d08f800fd Add the pathchk utility, which checks pathnames for validity or
portability between POSIX systems.

Submitted by:	Chuck Rouillard (manpage, initial implementation)
2002-05-22 10:30:16 +00:00
jmallett
4c8f46cf75 Make ReadMakefile() operate using the realpath(3) name for the file handed to
it, which means that relative paths will be expanded to absolute paths, and
filenames without a path will end up with their absolute path included as
well.  This aids tremendously in debugging a build using our make(1) with
multiple Makefile's, such as when there is a syntax error in a file in a
sub-directory as per <bsd.subdir.mk>.  Normally we'd end up with just
"Makefile" known about the Makefile in question, which means that an error
would be useless for someone trying to debug their build system, now we
end up with a complete real pathname for the Makefile.

So mostly this is useful in a debugging context, but possibly others too
(I haven't thought of them yet, but they probably are more useful if you
make Dir_FindFile use realpath(3), but that's another story).

Reviewed by:	-current
MFC after:	2 weeks
2002-05-21 20:24:46 +00:00
trhodes
a1b38ab0e2 Reword a small part of the uniq(1) manual page to help reduce word
duplication (ie: fields fields).

PR:		38161
Reviewed by:	keramida
MFC after:	3 days
2002-05-21 16:54:58 +00:00
tjr
330e4e0592 Mark argc as __unused to silence GCC. 2002-05-21 02:48:55 +00:00
tjr
4d3e3e5eba Build the tabs(1) utility.
PR:		36126
2002-05-21 02:36:12 +00:00
tjr
cf778678c6 Add an implementation of the tabs(1) utility, as required by SUSv3.
PR:		36126
2002-05-21 02:33:25 +00:00
ru
de6b1a9d89 Style. 2002-05-20 16:42:15 +00:00
ru
531943a766 Bootstrap elf2aout(1) for sparc64; used to build sys/boot/sparc64/boot1. 2002-05-20 14:42:48 +00:00
ru
da85e76b35 Kill the stray #include line. 2002-05-20 08:05:58 +00:00
ru
628fe540c2 s/u_int/u_int32_t/ 2002-05-20 07:56:40 +00:00
dd
e5bc175e13 Mark a warning as such. Without this, it isn't obvious whether
killall stopped after failing to kill one process or whether it kept
going.
2002-05-20 07:17:22 +00:00
jmallett
07a99bdf83 Fix a late-night buglet in MLINKS ordering.
Submitted by:	Szilveszter Adam <sziszi@bsd.hu>
2002-05-19 20:39:42 +00:00
jmallett
073610e016 Synch usage() and manpage for b64encode/b64decode.
Make uudecode's usage more like that of other programs.
2002-05-19 11:22:54 +00:00
jmallett
1fb080cae2 Add b64decode & b64encode as synonyms for uudecode and uuencode -m,
respectively, for convenience when encoding or decoding base64 files.

As requested by various users.
2002-05-19 11:17:17 +00:00
obrien
7ec8b4c3b8 elf2aout can be useful to have on all platforms 2002-05-18 18:25:58 +00:00
obrien
0cececad59 Don't build getconf if you don't have a full C++ installation. 2002-05-18 18:24:55 +00:00
ru
1373edbd9d Fix markup.
Give Wolfram a credit for writing the original version in Perl
like in killall(1).
2002-05-18 15:39:56 +00:00
ru
b42b3c60fc More whitespace fixes. 2002-05-18 15:15:30 +00:00
markm
83845db29a Remove Perl and TCL/TK bits, neither of which are in the base system
(anymore).
2002-05-18 14:27:17 +00:00
ru
5d41a24187 Fixed spacing. 2002-05-18 14:17:53 +00:00
ru
7fbefe2fef Look into machine specific subdirs. 2002-05-18 13:56:53 +00:00
markm
7528001bd0 Add C rewrites of catman and makewhatis. These aren't quite as
the submitter supplied them, as I did some WARNS=n fixups (mostly
const-ification).

Submitted by:	John Rochester <john@jrochester.org>
2002-05-18 09:19:08 +00:00
obrien
7632a210b0 WARNS 6 this. 2002-05-18 05:33:28 +00:00
obrien
5cf8a1d115 Add a perl wrapper. mergmaster(8) is broken with out it.
Submitted by:	DES
2002-05-18 05:31:48 +00:00
gordon
0f322ee87c Add my birthday to the list. Apparently, I share a birthday with dwhite.
Reviewed by:	jake
Approved by:	jake
2002-05-17 17:49:32 +00:00
knu
66c935d52f Fix a tiny bug in shlib support of ldd(1); if dlopen(lib, RTLD_TRACE)
returns, exit gracefully with 0.

This fixes the behavior you see when you specify libc.so.  It occurs
because ldd(1) itself is linked with libc.so.

	$ ldd /usr/lib/libc.so
	/usr/lib/libc.so:
	ldd: /usr/lib/libc.so: (null)
	/usr/lib/libc.so: exit status 1

Reviewed by:	silence of audit@
2002-05-17 17:06:56 +00:00
jake
954f6fa7b9 Get byte swapping primitives from sys/endian.h now that they are exported
to userland.  This makes elf2aout work as a cross tool.
2002-05-17 15:46:08 +00:00
jmallett
86d7b4e026 Group the output chunks differently, to try to match BSD/OS output. Switch
to using arithmatic to determine buffer sizes to encode into.

Diane Bruce pointed out to me that BSD/OS did MIME too, so I want to match
their output, too, since my decision of 8 output groups was wholly arbitrary.
2002-05-17 12:27:02 +00:00
jmallett
cf82d76919 Revert part of the previous revision. Changing exit() to return() in main()
is wrong, even though our C compiler doesn't understand that exit() eats
control of the program, and as such can sometimes complain that main() reaches
the bottom of its body without an explicit return().

Aside from that, the functional usefulness of changing it is effectively nil,
so back it out.

Submitted by:	mike
2002-05-17 11:16:49 +00:00
tjr
5a5d149d29 Make the output tidier when multiple integer formats are requested by
attempting to line up values into columns.

Obtained from:	NetBSD (idea)
2002-05-17 08:54:32 +00:00
jmallett
7c4cad2323 Simplify prerun() in the case where there are no arguments. Can't do -I or -J
substitution if `utility' is not specified and we're using the buildin echo;
It has no arguments for us to abuse.
2002-05-17 07:55:24 +00:00
tjr
98e1f63634 Overhaul hexdump's od syntax code to handle the -s -A -j -N -t options that
SUSv3 requires and give od a proper manual page.

PR:		36783
2002-05-17 07:14:55 +00:00
tjr
4769e48d99 Declare variables that were extern'd in multiple places in hexdump.h.
PR:		36783
2002-05-17 06:32:00 +00:00
tjr
b0a96363c8 Add support for printing long doubles.
PR:		36783
2002-05-17 06:12:25 +00:00
tjr
3e9f4fc172 Print signed single-byte decimal integers correctly instead of implicitly
converting them to unsigned bytes.

PR:		36783
2002-05-17 05:43:00 +00:00
tjr
ed1adbad3e Un-deprecate od(1): rename the deprecated' variable to odmode', remove the
deprecation warning from the utility and manual page. Since this utility
is required by POSIX, it's not likely to be removed any time soon.

This is leading up to the addition of the P1003.1-2001 -s -A -j -N -t options.

PR:		36783
2002-05-17 05:20:30 +00:00
jmallett
0109c30545 Clean up malloc(3)'s argument. Remove casts which do nothing when we're
using sizeof() anyway.  Use slightly more consistent (per-file) error
reporting for malloc(3) returning NULL.  If "malloc failed" was being printed,
don't use err(3).  If a NULL format is being used, use err(3).  In one case
errx(3) was being used with strerror(3), so just use err(3).
2002-05-17 05:11:07 +00:00
jmallett
35c92f131c Remove spurious casts in malloc(3)'s argument.
Use `return' instead of `exit' at the bottom of main().
2002-05-17 02:28:46 +00:00
tjr
bcb6745c5f Add a Standards section, and note that compress(1) and uncompress(1) now
conform to P1003.1-2001.
2002-05-17 01:54:17 +00:00
tjr
dc84546441 As required by SUSv3, a file argument of "-" causes standard input
to be compressed/decompressed to standard output.
2002-05-17 01:42:43 +00:00
tjr
ddd093f802 Compression ratio statistics should be written to stderr instead of stdout. 2002-05-17 01:25:51 +00:00
tjr
37d5dd60af Use exit status 2 to indicate that the file was not compressed because
its size would not be reduced (SUSv3).
2002-05-17 00:58:07 +00:00
tjr
58d4fae22c Process and user ID arguments must be treated as decimal integers,
not octal or hex. This is the way it was before revision 1.10.

PR:		36950
Submitted by:	Peter Avalos <pavalos@theshell.com>
2002-05-16 23:55:35 +00:00
tjr
86e991cd98 Accept decimal user IDs with -u option as well as usernames.
PR:		36950
2002-05-16 23:44:11 +00:00
tjr
67bb0d1cc5 Diagnostic messages belong on stderr, not stdout. SUSv3 specifies that
renice may not use stdout at all.
2002-05-16 23:30:38 +00:00
peter
7fc284ffb7 OOPS! rev 1.16 accidently changed the default outfile from stderr to
stdout.  Unfortunately, DES mfc'ed this change in 1.15.2.1 (this
part probably should not have been) so it is broken there too.
truss is documented to use stderr, and other implementations use stderr.

Submitted by:	Arne Dag Fidjestøl <adf@idi.ntnu.no>
2002-05-16 21:58:57 +00:00
tjr
054f70b470 Handle the case where a negative offset in a regular expression match
is larger than the number of lines in the overflow file.
2002-05-16 05:04:26 +00:00
tjr
f3cfd9a3f6 Correct synopsis and usage(): pattern arguments are not optional. 2002-05-16 04:39:19 +00:00
trhodes
fa6c7efe3f More consistancy. file system > filesystem 2002-05-16 02:19:14 +00:00
tjr
24cc1f8e45 Add the SUSv3 -l option to at. This is an alias for atq. Allow job ids
to be specified on the command line for which information should be reported.

Submitted by:	Joe Halpin <joe.halpin@attbi.com>
Reviewed by:	mike
2002-05-16 00:47:14 +00:00
fanf
3609bfaab7 Report errors properly if wait() fails.
PR:		30543
Approved by:	dwmalone (mentor)
MFC after:	3 weeks
2002-05-15 16:50:09 +00:00
fanf
94a883658e Upgrade unifdef:
* It now knows about the existence of #elif which would have
    caused it to produce incorrect results in some situations.

  * It can now process #if and #elif lines according to the
    values of symbols that are specified on the command line.
    The expression parser is only a simple subset of what C
    allows but it should be sufficient for most real-world
    code (it can cope with everything it finds in xterm).

  * It has an option for printing all of the symbols that might
    control #if processing. The unifdefall script uses this
    option along with cpp -dM to strip all #ifs from a file.

  * It has much larger static limits.

  * It handles nested #ifs much more completely.

There have also been many style improvements: KNF; ANSI function
definitions; all global stuff moved to the top of the file; use
stdbool instead of h0h0bool; const-correctness; err(3) instead
of fprintf(stderr, ...); enum instead of #define; commentary.

I used NetBSD's unifdef as the basis of this since it has received
the most attention over the years.

PR:		37454
Reviewed by:	markm, dwmalone
Approved by:	dwmalone (mentor)
MFC after:	3 weeks
2002-05-15 16:30:28 +00:00
tjr
d2e458094c Build the asa(1) utility.
PR:		36130
Reviewed by:	mike
2002-05-15 03:37:55 +00:00
tjr
13b1096a78 #include <unistd.h> for getopt() and friends.
PR:		36130
Approved by:	mike
2002-05-15 03:31:40 +00:00
tjr
c0844f47a4 Use getopt() to reject options (asa has none), and to the "--" end of options
marker. Exit non-zero if we cannot open one of the input files. Update
standards conformance and exit status statements in manual page.

PR:		36130
Approved by:	mike
2002-05-15 03:17:01 +00:00
tjr
5fce6fe1a7 Remove __P,
Don't prototype main(),
C89-style function declarations,
char **argv -> char *argv[] for main()

PR:		36130
Approved by:	mike
2002-05-15 03:10:17 +00:00
tjr
fb7dc2e983 style(9): remove space between function name and opening parentheses,
sort variables, NULL is the null-pointer constant, remove unnecessary
braces.

PR:		36130
Approved by:	mike
2002-05-15 03:02:17 +00:00
tjr
03ace5aac1 Add the POSIX.2 asa utility, which interprets FORTRAN carriage-control
characters.

PR:		36130
Approved by:	mike
Obtained from:	NetBSD
2002-05-15 02:40:57 +00:00
green
957e7d4f00 o Clean up tmp file usage a little by using mkstemp(3) instead of
mktemp(3).  It would be amazingly unlikely, but the former method
  could result in a symlink attack.  A better solution would use
  ${TMPDIR}, though.
o Make sed not overwrite old backup files with no warning.
2002-05-14 23:15:42 +00:00
jmallett
4e7e0a7753 Fix a "tiny and squeeby and little" markup mistake.
Submitted by:	fenner
2002-05-14 22:55:31 +00:00
dwmalone
741f22f7bb Make a link from fr_FR.ISO8859-1 to fr_FR.ISO8859-15.
Submitted by:	wollman
2002-05-13 21:30:23 +00:00
tjr
e54018774d If we can't change the scheduling priority, warn but still execute
the requested utility. This is how nice(1) traditionall behaved,
and the behaviour required by SUSv3 and POSIX.2 UPE.

Submitted by:	Peter Avalos <pavalos@theshell.com> (partially)
Reviewed by:	mike
2002-05-13 08:03:20 +00:00
tjr
6e482061cd Support the SUSv3 -n option and the "--" end of options marker.
Replace "command" with "utility" in the manual page & source to be more
consistent with the terminology used in the standard, and to hint that
shell builtin commands won't work.

Submitted by:	Peter Avalos <pavalos@theshell.com> (partially)
Approved by:	mike
2002-05-12 22:49:48 +00:00
ru
59049318b6 Added new bsd.incs.mk which handles installing of header files
via INCS.  Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files.  Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1.  Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

	kerberos5/lib/libtelnet/Makefile
	lib/libbz2/Makefile
	lib/libdevinfo/Makefile
	lib/libform/Makefile
	lib/libisc/Makefile
	lib/libmenu/Makefile
	lib/libmilter/Makefile
	lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD.  Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".
2002-05-12 16:01:00 +00:00
bde
66189f380b Fixed 5 style bugs in VCS ids. 2002-05-12 04:02:57 +00:00
mike
497f9fbf89 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
bde
20313e69cb Fixed printing the the strip binary's name in error messages. 2002-05-12 03:47:23 +00:00
bsd
7fd0cc174c 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
e4f919be68 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
1481568735 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
jedgar
7a96d67f52 #include <stdlib.h> for exit(3) prototype. 2002-05-11 03:18:14 +00:00
obrien
d81b5e34df 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
ru
75c39d9e5c 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
tg
762262ae8b 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
tg
bfd97fab25 Fix wrong bitmask. 2002-05-10 10:37:57 +00:00
tjr
d18fa85a67 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
tjr
1894db5ac7 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
joe
36c976074e 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
des
349f81351d Back out part of previous commit - K&R doesn't have const. 2002-05-09 11:24:58 +00:00
des
cb605d9379 Make _msgout take a const char * rather than a char *.
Sponsored by:	DARPA, NAI Labs
2002-05-08 14:50:28 +00:00
kuriyama
09fb9b5c52 Change whtespace indent in format string to fit new output form of
timestamp.

Reviewed by:	markm
2002-05-08 11:23:45 +00:00
des
67faa788b7 These files haven't been used in a while. 2002-05-08 01:35:22 +00:00
des
abc14dea11 Use libutil and libypclnt for all passwd manipulation and NIS needs.
Sponsored by:	DARPA, NAI Labs
2002-05-08 00:54:29 +00:00
des
ffc89486bf Really include <paths.h> (it seems it was brought in indirectly) 2002-05-08 00:47:02 +00:00
des
84dfbe4ad5 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
jmallett
3dc6de51a7 Oops, update usage() to have -i. 2002-05-07 23:33:44 +00:00
jmallett
9514d77a48 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
jmallett
8c85827b13 Un-shadow the `fname' variable. 2002-05-07 23:06:47 +00:00
jmallett
d3d2092758 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
fanf
0d1a15dcde Add myself.
Reviewed by:	dwmalone (mentor)
2002-05-07 11:09:40 +00:00
ru
b2fe4053f4 Make sure the file in Attic is really "dead".
Problem found by:	ken
2002-05-07 06:57:04 +00:00
tjr
2a4292262e 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
jmallett
864cb02be2 -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
mp
2f1f47d112 - 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
jmallett
285791a696 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
jmallett
e6d711b45a 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
jmallett
4565d6d2ab 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
jmallett
9fdf8815bf 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
asmodai
ae6db00714 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
mini
17b2d0bf0b Add myself.
Approved by:	alfred
2002-05-04 06:34:11 +00:00
jmallett
7531aad0b3 Grouping changes.
Submitted by:	Carl Schmidt <cschmidt@slackerbsd.org>
2002-05-04 06:00:19 +00:00
jmallett
572f35dd8b Don't use pointers as booleans. 2002-05-04 05:53:02 +00:00
jmallett
48ff9098aa 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
jmallett
0ff89ada02 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
jmallett
98e4fb17a5 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
jmallett
0b58325392 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
jmallett
2600738fab Get rid of bogus holder for realloc(3). 2002-05-03 17:13:29 +00:00
jmallett
a1aec7d10e 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
jmallett
0c0e3cb83d Rename lflag' to Lflag' to match the option's case. 2002-05-03 16:32:03 +00:00
jmallett
7a54ebe19d Revert revision 1.22. I incorrectly modified the Berkeley identifiers.
Requested by:	bde, mike
2002-05-03 14:50:31 +00:00
jmallett
fc27b969e8 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
tjr
2112150022 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
tjr
a776e9e8c8 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
jmallett
ccab2ee09e 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
jmallett
e9426bc22e __COPYRIGHT() and __SCCSID(). 2002-05-02 05:21:35 +00:00
jmallett
b93236f095 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
jmallett
0e7ff94734 A markup fix, and document -R as non-standard. 2002-05-02 03:29:38 +00:00
jmallett
96a12743eb 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
jmallett
059f270266 *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
jmallett
c136e5d442 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
jmallett
831e54bef9 Add some spurious veritcal whitespace to reduce diffs to OpenBSD. 2002-05-01 21:45:22 +00:00
jmallett
5f1aa32acd Merge local changes again, against ANSIfied m4(1). 2002-05-01 21:37:29 +00:00
peter
22e8a6eda2 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
8c61e8a738 Build elf2aout for sparc64. 2002-04-30 02:42:23 +00:00
dwmalone
c6f306a6a4 Don't use ISO_8859 when I should use ISO8859. 2002-04-29 20:57:36 +00:00
ru
6685a25787 Do not override the `install' target. 2002-04-29 10:28:11 +00:00
dwmalone
4af9569b92 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
markm
905d923df1 Minor nit; return(foo) from main rather than exit(foo). 2002-04-28 14:04:24 +00:00
markm
1564a712ca Very minor whitespace nit. 2002-04-28 13:59:42 +00:00
markm
183c01f925 Remove GCC-specific flags. 2002-04-28 13:58:41 +00:00
markm
09b63c5efb Reorder for style. 2002-04-28 13:54:45 +00:00
markm
443c5ce6b2 Remove GCC-specific flags. 2002-04-28 13:53:38 +00:00
markm
deaa4a187b Fix VCS tags; ANSIfy functions 2002-04-28 13:50:54 +00:00
markm
afdd6c61a4 Add some function prototypes to squash warnings. 2002-04-28 13:49:15 +00:00
markm
de78eb8c7f Easy warns fixes; sort out some types and me them a bit more consistent;
fix initialisers.
2002-04-28 13:46:40 +00:00
markm
a735b516eb Warnings fix; ANSIfy, constify, mark unused function parameter(s). 2002-04-28 13:00:16 +00:00
markm
2f918abe2e Warns; ANSIfy, constify and move declarations into a common header. 2002-04-28 12:55:35 +00:00
markm
432896d29d Remove GCC-specific flags. 2002-04-28 12:54:24 +00:00
markm
d642bb3e8a Fix a const-char vs char issue. 2002-04-28 12:39:12 +00:00
markm
bf0d40842d Very minor whitespace nit. 2002-04-28 12:36:56 +00:00
markm
20e29126e7 Declarations cleanup; make sure externs are in a common header.
Fix declarations, casts and return values.
2002-04-28 12:34:54 +00:00
markm
38668d26e3 warns fixes; ANSIfy, deregister, constify. 2002-04-28 12:28:41 +00:00
markm
ed297fee6f Easy warns fixes; constify. 2002-04-28 12:25:03 +00:00
markm
2ddedfffab Style; line up columns, space things out more consistently. 2002-04-28 12:24:20 +00:00
markm
673f6ef6d9 Style fixes; whitespace and header order. 2002-04-28 12:21:31 +00:00
markm
2df22de47e Fix VCS inclusion and tidy up #includes. 2002-04-28 12:19:30 +00:00
markm
d4767a7bb1 Cast to kill warnings. De-register. 2002-04-28 12:17:27 +00:00
markm
0f588b9373 fix warnings; change variable/argument names that mask global names. 2002-04-28 12:15:40 +00:00
markm
9302f8d66b Remove GCC-specific flags and commented out cruft. 2002-04-28 12:14:10 +00:00
markm
38c3f4b69a Some easy const fixes. 2002-04-28 12:12:49 +00:00
markm
62123726bd ANSIfy, VCS inclusions and some very minor style. 2002-04-28 12:09:33 +00:00
markm
df2d11edfa Minor reorder for style. 2002-04-28 12:08:18 +00:00
markm
aa3fa5ac74 Fix some easy warnings; ANSIfy, constify.
Fix VCS inclusion and deregister.
2002-04-28 12:04:20 +00:00
markm
6e62811ca3 ANSIfy functions, and move extern declarations into a shared header
where ${DEITY} intended them to be.
2002-04-28 11:59:43 +00:00
markm
06bdac1d86 Fix VCS inclusions. 2002-04-28 11:52:43 +00:00
markm
82e411fc67 More low hanging warnings fruit; ANSIfy, de-register, constify. 2002-04-28 11:51:03 +00:00
markm
a62032343e Fix some low-hanging fruit in the warnings department; ANSIfy functions,
sort out some const issues.
2002-04-28 11:44:30 +00:00
markm
2720780e6c Easy warns fixes; use const, mark unused function parameters. Remove
unused includes.
2002-04-28 11:16:43 +00:00
markm
68f25a87ca Remove GCC-specific flags. 2002-04-28 11:15:47 +00:00
markm
f7c4d20a39 Trivial warnings fixes; staticise and use unsigned.
Use __FBSDID().
2002-04-28 11:13:20 +00:00
markm
f7a5378f71 Use __FBSDID, ANSIfy functions, fix const string. 2002-04-28 11:00:34 +00:00
markm
1b4a05fc90 Use __FBSDID(), ANSIfy headings, use const/unsigned in minor but
appropriate places.
2002-04-28 10:56:09 +00:00
markm
e93fa004d7 Style only; format function declarations, sort header includes, and
use __FBSDID().
2002-04-28 10:49:15 +00:00
ume
64ac411ccb Backout copyright notice I broke by my previous commit. 2002-04-26 12:16:34 +00:00
tjr
dd646660ba Some minor nits exposed by the Open Group's VSC Lite verification suite:
- 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
2002-04-25 23:04:52 +00:00
tjr
12a8faa64a Handle numbers larger than QUAD_MAX for unsigned conversions correctly.
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
2002-04-25 01:10:11 +00:00
obrien
c114ef416e Back out the NO_RCMNDS knob.
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".
2002-04-23 23:59:51 +00:00
obrien
3311fa2aba Restore some of the original variable names, but fix the warnings their
renaming addressed by removing the global variants instead.
2002-04-23 20:30:30 +00:00
tjr
fb16fb2f87 Add the -t option, which allows tab stop positions to be specified similarly
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
2002-04-23 07:15:09 +00:00
jmallett
d1fecdf4b5 - printf shouldn't bail out if a conversion fails, it should just keep
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
2002-04-23 02:56:16 +00:00
anholt
b7f3d0f9dd Add myself
Approved by:	des
2002-04-22 19:39:10 +00:00
des
4d6b787d2d Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
des
57315578d5 Don't use PAM_SILENT unless hushlogin is set (perforce change 10123)
Sponsored by:	DARPA, NAI Labs
2002-04-22 06:27:16 +00:00
jake
b2815166cb Add a Makefile for this. 2002-04-22 04:08:01 +00:00
dwmalone
4c92f1efea Use fseeko and uintptr_t to make sure that we get a sensible offset
when trying to read from the stack.

PR:		37104
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
MFC after:	3 weeks
2002-04-21 19:04:26 +00:00
keramida
f4dad30bfd Remove duplicated text.
PR:		docs/37287
Submitted by:	Tony Finch <dot@dotat.at>
MFC after:	3 days
2002-04-21 14:48:47 +00:00