Commit Graph

5240 Commits

Author SHA1 Message Date
Ruslan Ermilov
1c3fc710e2 Make it work for a different endianness binary.
(This version is still limited to ELF64.)

Reviewed by:	jake
2002-05-25 13:43:16 +00:00
Ruslan Ermilov
02c0301fa7 Move elf2aout to usr.sbin/.
Approved by:	jake
2002-05-25 13:29:47 +00:00
Tim J. Robbins
ba545bbb61 Sync usage message with manual page synopsis. 2002-05-25 11:37:10 +00:00
Tim J. Robbins
b8b53eef91 Bad numeric arguments or usernames should cause non-zero exit status. 2002-05-25 10:37:24 +00:00
Tim J. Robbins
d6c762af40 Determine exit status to use before writing diagnostic message; warn()
may change errno.
2002-05-25 03:32:23 +00:00
Tim J. Robbins
816dde7d05 Typo: use plural now that we have more than one option. 2002-05-25 03:08:21 +00:00
Tim J. Robbins
fb2582c006 If a file cannot be processed, try to process any remaining files
then exit non-zero.
2002-05-25 03:04:28 +00:00
Tom Rhodes
e223a77118 Add the word ``fields'' to the description, and change an instance from
fields to num in the SYNOPSIS

Noticed by:	keramida
2002-05-24 19:12:02 +00:00
Ruslan Ermilov
1737392273 Back out the ``run shell from $PATH'' change; this was an overkill
and is insecure.

Requested by:	bde
2002-05-24 15:51:27 +00:00
Tim J. Robbins
3af4dcb223 If a file argument cannot be processed, process the remaining ones
and exit non-zero (SUSv3)
2002-05-24 10:58:21 +00:00
Tim J. Robbins
204c78a163 When a file name of "-" is given, read from standard input (SUSv3) 2002-05-24 09:56:18 +00:00
Tim J. Robbins
a8522a9bb7 Allow byte/character positions >_POSIX2_LINE_MAX to be specified by
dynamically growing the `positions' array.
2002-05-24 09:11:18 +00:00
Tim J. Robbins
d42862594a Use fgetln(3) to handle lines of unlimited length instead of a
getc/putc loop.

Suggested by: dd
2002-05-24 08:56:49 +00:00
Tim J. Robbins
ce78cbf9e0 P1003.2 forbids imposing any limit on line lengths; read character by
character instead of manually buffering each line.
2002-05-24 07:05:10 +00:00
Tim J. Robbins
0968654cfd Exit with non-zero status if any files specified could not be opened
when -s option is given (SUSv3).
2002-05-24 06:17:29 +00:00
Tim J. Robbins
a6ea32c3c5 If processing of one file fails, try to process the remaining files and
exit non-zero instead of immediately exiting. The traditional BSD
behaviour is explicitly forbidden by P1003.2.
2002-05-24 06:03:12 +00:00
Tim J. Robbins
5069e2716c If processing of one file fails, try to process the remaining files and
exit non-zero instead of immediately exiting (SUSv3).
2002-05-24 06:00:47 +00:00
Tony Finch
5ac21f6976 Sync with upstream version:
* Ensure we work within the array bounds when parsing command-line options;
  * Replace h0h0getopt with getopt(3);
  * Use consistent whitespace style in the function declarations.

Revieweded by:	dwmalone (mentor)
2002-05-23 16:50:41 +00:00
Juli Mallett
a8ca0a178e Handle numeric keys by checking a "default" file. Handle number-less keys
by failing, since comparing up to the length of the key (0) against the
begin line for a key in the help file will always succeed, and print what
is wholly bogus output.
2002-05-23 14:58:22 +00:00
Juli Mallett
e0bd05dc2f 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
Juli Mallett
39346853df Make my style consistent.
Remove two includes.

Fix a typo (semicolon instead of period at EOL).
2002-05-23 03:03:44 +00:00
Juli Mallett
3549859680 Taking a leap of faith, tie the help command in to the build. 2002-05-22 23:15:58 +00:00
Juli Mallett
192f0a0c65 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
Juli Mallett
a0304d8026 Tie sccs(1) in to the build, as it now does one thing right: sccs what 2002-05-22 16:19:31 +00:00
Juli Mallett
fb22fc68e4 Remove mention of the GNU version of ptx, it is dead. 2002-05-22 16:18:14 +00:00
Juli Mallett
08f4375879 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
Juli Mallett
824ff2896d Remove #ifndef's on V6. 2002-05-22 16:01:50 +00:00
Juli Mallett
5e213af359 Put braces around the command table properly. 2002-05-22 15:59:27 +00:00
Juli Mallett
6bad09a23e 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
Juli Mallett
8eccf3b248 str_concat() doesn't really take const arguments.
Submitted by:	bde
Pointy hat to:	jmallett
2002-05-22 15:34:00 +00:00
Ruslan Ermilov
ea98f295f7 Do not run shell from /bin, run it from $PATH.
Bump MAKE_VERSION to 5200205221.
2002-05-22 14:53:18 +00:00
Ruslan Ermilov
8e9bddc97b 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
Juli Mallett
e0f783d4f8 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
Juli Mallett
89d6ab227d 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
Juli Mallett
b77ce308c0 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
Juli Mallett
aecf4d561b Remove register qualifier. 2002-05-22 12:32:54 +00:00
Juli Mallett
8a4f086026 Use function prototypes. 2002-05-22 12:31:40 +00:00
Juli Mallett
5fed7e7311 Clean up formatting. 2002-05-22 11:29:21 +00:00
Juli Mallett
27ffa61f2a 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
Juli Mallett
d7853f431e 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
Ruslan Ermilov
f6ce5895a9 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
Juli Mallett
61252e89e7 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
Tim J. Robbins
b9f6304141 Build pathchk(1). 2002-05-22 10:32:24 +00:00
Tim J. Robbins
c78c4633a2 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
Juli Mallett
21b8b7cb3c 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
Tom Rhodes
69cc776cd6 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
Tim J. Robbins
4ef27b1a49 Mark argc as __unused to silence GCC. 2002-05-21 02:48:55 +00:00
Tim J. Robbins
743f138e8d Build the tabs(1) utility.
PR:		36126
2002-05-21 02:36:12 +00:00
Tim J. Robbins
890a73ed39 Add an implementation of the tabs(1) utility, as required by SUSv3.
PR:		36126
2002-05-21 02:33:25 +00:00
Ruslan Ermilov
0f91d7050c Style. 2002-05-20 16:42:15 +00:00