Commit Graph

1517 Commits

Author SHA1 Message Date
tjr
290ce9e466 Implement `set +o', which displays the currently set options in a format
suitable for re-input into the shell.
2002-05-25 12:11:58 +00:00
tjr
e6fbc84685 Bring back the cd -L and -P options from revision 1.24, but try harder not
to fail when the logical current directory no longer exists. Allow changes
to absolute paths when logical cwd is invalid, fall back to physical cd
if logical cd fails.
2002-05-22 05:15:53 +00:00
tjr
fff7331065 Temporarily back out revision 1.24; it seems to handle the case where the
current directory no longer exists incorrectly and breaks `make cleandir'.
2002-05-22 03:29:20 +00:00
tjr
bc86a28ef9 Add the SUSv3 -L and -P options to the cd and pwd builtin utilities. `Logical'
handling of .. is now the default.
2002-05-20 07:54:39 +00:00
jmallett
4205c9f55a Remove a small, annoying, nit I ran in to editing this file, a lone tab
on a line by itself.
2002-05-19 17:50:23 +00:00
tjr
b19972e699 Implement the -u (-o nounset) option, which gives an error message if
an unset variable is expanded.

Obtained from:	NetBSD (bjh21, christos)
2002-05-19 08:30:16 +00:00
tjr
b72e0fae17 Make the fg and bg commands give the output required by SUSv3.
fg outputs the name of the command, bg outputs the name of the command
and the job id.
2002-05-19 07:27:26 +00:00
tjr
ada2f900a3 Implement the -C (-o noclobber) option, which prevents existing regular
files from being overwritten by shell redirection.
2002-05-19 06:03:05 +00:00
tjr
18037eb7ab Add missing options required by SUSv3:
-m	List files across the page, separated by commas.
-p	Print a slash after directory names
-x	Same as -C but sort across the columns rather than down

Submitted by:	Kyle Martin <mkm@ieee.org>
2002-05-19 02:51:36 +00:00
iedowse
75e563ada2 Unconditionally update the maximum field width statistics when we
refetch the filesystem information in MNT_WAIT mode. This avoids
incorrect column alignment that sometimes occurs with NFS filesystems.

Submitted by:	Ian <freebsd@damnhippie.dyndns.org>
2002-05-18 21:10:40 +00:00
tjr
35d66bbcdb Back out part of previous commit: make -P the default again until I'm
convinced it's a good idea.
2002-05-18 13:52:07 +00:00
tjr
f0c2951e6b Make -L the default, allow both -L and -P to be specified (last one used
matters), fall back to -P mode if we can't get the logical directory.
2002-05-18 02:47:25 +00:00
ache
fbce3fb517 Optimize prev. commit code a bit 2002-05-17 12:24:19 +00:00
ache
c711b20bf2 Trailing slash fixes.
Fix the case:
        cp file nonexistent/
which create nonextstent as file while trailing slash clearly indicates
that nonexistent must be a directory.
Also fix the case:
	cp file1 file2/
which should produce error.
2002-05-17 11:52:48 +00:00
jmallett
3f70efa473 Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in the
CURRENT <paths.h>.
2002-05-17 11:38:48 +00:00
joe
40c0cc2b5f The sysctl has changed from 'kern.ps_showallprocs' to
'security.bsd.see_other_uids'.
2002-05-16 11:51:05 +00:00
trhodes
0c40c9d08e more file system > filesystem 2002-05-16 03:51:38 +00:00
trhodes
56036d2623 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +00:00
billf
8ce7d93d62 restore missing default case removed in ls.c:r1.57
add break statements to default cases where missing.

Submitted by:	bde
2002-05-15 18:53:56 +00:00
jmallett
3de05bf289 Make 'user' and 'group' const as to not discard the qualifier from the
functions we use to assign them.  Doesn't seem to be anything else that
relies on these being non-const.
2002-05-15 09:49:59 +00:00
jmallett
c0b64a6d1b Remove an empty default case to make this syntactically correct. Not there
is as good as blaknk.
2002-05-15 09:43:52 +00:00
phk
5e1cf3ad98 Remove the private code for reading UFS superblocks, this does not belong
in df(1) when we have multiple filesystem types, and the complications of
handling UFS2 pushes this over the edge.

Use the .../mount/extern.h to get prototypes of the functions we
borrow from there.  Constify things to match.  (why aren't these
functions in a lib anyway ?)

Make everything static and set WARNS?=5.

The way the "df diskdevice" thing works for unmounted diskdevices
is not very general.

Sponsored by: DARPA & NAI Labs.
2002-05-12 19:24:09 +00:00
jedgar
47acb76e7c Add semicolon to empty default case to silence warning. 2002-05-11 03:12:02 +00:00
wollman
a04093f9b6 EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,
and -e reflects the historic behavior of FreeBSD's expr.
2002-05-11 03:08:12 +00:00
alfred
2864dba864 while i'm breaking stuff, use __dead2 instead of GCC specific __attribute__. 2002-05-11 01:25:54 +00:00
alfred
2f75a283e0 backout additional include of cdefs.h, it's not helping any. 2002-05-11 01:24:39 +00:00
alfred
83d76dffe1 include cdefs.h for __printf0like to silence warning. 2002-05-11 00:54:33 +00:00
jedgar
818f9c0a64 Add semicolon to empty default case to silence warning. 2002-05-11 00:45:01 +00:00
alfred
c4d4a5fa12 Add semicolon to empty default case to silence warning. 2002-05-11 00:21:00 +00:00
wollman
e11cb46ee8 The response to my POSIX interpretation request says that `expr'
is required to be oblivious to overflow and to use the data type `long'.
(Division by zero is undefined in ISO C so it's still OK to check for it
here.)  Add a new `-e' flag to get the old, more useful behavior.
2002-05-10 22:59:29 +00:00
obrien
88b6275cf8 Remove gCC'isms. 2002-05-10 01:48:15 +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
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
0871762074 Check for possible overflow from sysconf _SC_ARG_MAX and error out in a
correct manner.  Revert my incorrect change to use err(3) for malloc(3)
failing.  Use a size_t variable to store the size of the argument buffer
we allocate, and remove silly casts as the result of having this around.
Modify the math in some of the paranoid checks for buffer overflow to
account for the fact we now are dealing with the actual size of the
buffer.  Remove the static qualifier for arg_max, and the bogus setting
of it to -1.

Include <limits.h> for the definitions we use to check for possible
overflows.

Submitted by:	bde
2002-05-05 04:42:50 +00:00
jmallett
896541a042 Don't cast incorrectly to malloc(3), and don't use errx(3) if malloc(3)
returns NULL, as malloc(3) sets errno.  Use err(3).
2002-05-02 05:46:37 +00:00
markm
09b63c5efb Reorder for style. 2002-04-28 13:54:45 +00:00
wollman
e46c2e6ba9 Provide an environment variabloe, EXPR_COMPAT, which disables option
parsing for compatibility with old implementations.
2002-04-22 21:23:09 +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
charnier
0865462d56 Use `The .Nm utility' 2002-04-21 12:53:08 +00:00
charnier
487a22adbf Use `The .Nm utility' 2002-04-20 11:58:12 +00:00
mux
f446eb58b0 Add a reference to the kenv(2) manpage. 2002-04-18 18:49:41 +00:00
ru
8a3e2794af Replaced exists() tests with two equivalent defined().
LIBDIR is defined in bsd.own.mk but sys.mk no longer
includes bsd.own.mk as of revision 1.60.
2002-04-18 07:01:35 +00:00
mux
ef239236f8 Use the new functionalities provided by the kenv(2) syscall.
Reviewed by:	peter
2002-04-17 13:08:14 +00:00
charnier
79b89ed363 Use `The .Nm utility' 2002-04-16 20:08:06 +00:00
charnier
d219790077 ls(1) is utility not function 2002-04-16 20:03:54 +00:00
trhodes
ba4684c0e7 s/CMOS/hardware as talked about on cvs-committers.
Suggested by:   sheldonh
Approved by:	bde
MFC after:	1 day
2002-04-16 14:28:47 +00:00
trhodes
4afe0b0679 Little nit pick in date(1) manual page, tell users which clock date(1)
sets

PR:		35606
2002-04-15 18:05:14 +00:00
greid
5486a1c99e Stop a null pointer dereference in the builtin hash function.
PR:		36141
Approved by:	cracauer
MFC after:	1 week
2002-04-15 15:49:30 +00:00
jwd
a3fe1a7096 Document option to option dependancy. Fix typo.
MFC after:	1 week
2002-04-15 02:21:12 +00:00
charnier
64ab19a185 Do not return(f_returning_void());. Spell FALLTHROUGH to make it lint()able. 2002-04-12 20:23:51 +00:00
bmilekic
890c5794a5 Introduce NO_RCMNDS flag so as to not compile rsh, rlogin, and rcp on will,
and document in share/examples/etc/make.conf

Submitted by: Aleksandar Simic <asimic@dsl.pipex.com>
MFC after: 1 week
2002-04-09 18:25:44 +00:00
jedgar
f7f35bd6ba errx()/strerror() -> err() 2002-04-07 04:59:13 +00:00
keramida
9e46855391 Various mdoc fixes, including a change that corrects spacing as
described in PR docs/36461.

PR:		docs/36461
Noticed by:	Gary W. Swearingen <swear@blarg.net>
Submitted by:	ru
2002-03-31 20:49:37 +00:00
ache
0b9df2f267 Use intmax_t as quad_t replacement, like in expr 2002-03-28 16:30:42 +00:00
iedowse
87a3c1d190 Make the columns in the output of df(1) line up, even for very large
filesystems. We now keep track of the maximum width required for
every variable-width field instead of just the first one.

PR:		bin/15510
MFC after:	1 week
2002-03-26 20:32:37 +00:00
ru
f6da61bcc9 Install sys/security/lomac/*.h to /usr/include/security/lomac/.
Install sys/<arch>/include/pc/*.h to /usr/include/machine/pc/.

PR:		docs/29534

Install sys/netatm/*/*.h to /usr/include/netatm/*/.

Don't install compatibility symlinks for <machine/soundcard.h>
and <machine/joystick.h>.  Three years is enough to be aware of
the change, and these weren't visible in the SHARED=symlinks
case.

Back out include/Makefile,v 1.160 that was a null change anyway
due to the bug in the path, and we now don't want to install
these headers because they would otherwise be invisible in the
SHARED=symlinks case.

Don't install IPFILTER headers.  Userland utilities fetch them
directly, and they were not visible in the SHARED=symlinks case.

Resurrect SHARED=symlinks in Makefile.inc1.

PR:		bin/28002

Prodded by:	bde
MFC after:	2 weeks
2002-03-26 16:05:14 +00:00
markm
67e76f4ab3 Replace use of __progname with the functionally identical and more
acceptable getprogname(3).
2002-03-24 14:56:55 +00:00
wollman
7282a3b32e Disable -Werror when building -- the old version of gcc used on IA32 can't
deal with C99 formats.
2002-03-23 00:44:00 +00:00
wollman
d1fbde7cf6 Typo (if => of). 2002-03-22 20:49:29 +00:00
wollman
dc0ab81475 Add a word of caution about integer arithmetic range and overflow detection. 2002-03-22 20:46:59 +00:00
wollman
c1037fd271 Fix a few formatting brainos and make the formatting of the EXAMPLES
section somewhat clearer.
2002-03-22 20:38:44 +00:00
wollman
2e02d4aae7 Make expr POSIX-compliant, and fix some bugs. Specifically:
- expr must conform to the Utility Syntax Guidelines, so use
getopt() to eat the (non-existent) options.

- Use the Standard type intmax_t for arithmetic.

- If an argument cannot be *completely* converted to an integer, then
it is a string.

Additionally make some style cleanups near the modified lines.  This
utility is still not completely style-compliant.
2002-03-22 20:18:26 +00:00
obrien
785ec6a1f4 Update SCM ID. 2002-03-22 19:52:59 +00:00
obrien
8f7b828bab Note that -n is non-standard. 2002-03-22 19:52:48 +00:00
markm
09171e09d6 No need to cast; ().gr_gid is already the correct type. 2002-03-22 15:54:44 +00:00
obrien
6295b3bfe1 Add the -n option, which automatically answers "no" to the overwrite question. 2002-03-22 07:45:36 +00:00
imp
74d826c7a6 remove __P 2002-03-22 01:22:50 +00:00
ru
cebc449d30 mdoc(7) police: use precise width specifier. 2002-03-15 14:21:13 +00:00
rwatson
94342978a6 NAI DBA update. 2002-03-14 21:51:00 +00:00
markm
43cc55dd2f 1) Rev.1.35 of dd.c has a more serious regression. It backs out rev.1.31,
thus breaking systems with unpolluted <sys/stat.h>'s.

2) Back out an initialisation of a variable in BSS.

Reported by:	bde (1), many(2)
2002-03-07 14:00:33 +00:00
maxim
7d69422196 Log:
Remove eaccess(2) absence workaround. Add eaccess(2) checks for FILRD,
FILWR, FILEX and FILEXIST cases.

We cannot MFC this because there is no eaccess(2) in -stable yet.

PR:		bin/35076
Reviewed by:	ru
Approved by:	ru
2002-03-06 11:20:13 +00:00
imp
f0662fdefd Use ANSI-99 int names (uintXX_t) over traditional BSD int names
(u_intXX_t).
2002-03-05 05:28:49 +00:00
phantom
9124a610d0 Use NLSLINKS to setup symbolic links in NLS area 2002-03-04 12:29:21 +00:00
phantom
63f07ef33b This file is not used anymore 2002-03-04 11:10:17 +00:00
phantom
d12220dfdb Use bsd.nls.mk for building/installing NLS files
XXX: links handling simplify
2002-03-04 10:34:51 +00:00
alfred
fd4aa99c82 clarify code:
add comments.
don't get the length of each arg passed, only the last one.
check against == or != NULL rather than using a pointer value as
truth test.
2002-03-04 05:30:04 +00:00
dwhite
12798316b8 Update STANDARDS section on rm(1) to reflect current conformance.
PR:		35471
2002-03-02 05:10:11 +00:00
ache
4ac9e16668 Add (unsigned char) cast lost in WARNS=4 fixes which break 8bit locales
PR:		35421
2002-02-28 18:52:47 +00:00
sobomax
521f052069 Fix a bug introduced in rev.1.23 - for some reason mkdir("/", ...) system
call returns `EISDIR', not `EEXIST', so that be prepared for that. This should
fix number of ports, that often call `mkdir -p //usr/local/foobar'. This
is just a quick workaround, the real fix would be either to avoid calling
mkdir("/", ...) or fix VFS code to return consistent errno for this case.
2002-02-25 09:17:44 +00:00
bde
cf8ef037c8 #include <time.h> for the definition of time functions instead of
depending on namespace pollution 2 layers deep in <sys/stat.h>.

Removed unused includes.
2002-02-25 01:36:59 +00:00
bde
0a286122a7 Fixed unsorting. 2002-02-23 21:00:14 +00:00
bde
be1787bc6d Fixed some style bugs in revs 1.1 and 1.4. 2002-02-23 17:05:32 +00:00
markm
5b69d7da62 ANSIfy. 2002-02-22 23:31:57 +00:00
markm
2b941891db Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:24:14 +00:00
markm
3ce9528bfb Fix a boatload of warnings inspired by lint, a commercial lint
and WARNS=4.
2002-02-22 21:21:37 +00:00
markm
3b69d13d7c Warnings fixes. 2002-02-22 21:13:31 +00:00
markm
2e9a506a04 Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:11:03 +00:00
markm
02fae8d816 Partially fix (well, work around) warnings inspired by lint, a
commercial lint and WARNS=4.
2002-02-22 21:02:58 +00:00
markm
d2f778cddf Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:00:16 +00:00
markm
1fb3e88343 Warnings fixes inspired by lint, a commercial lint and WARNS=4. 2002-02-22 20:57:53 +00:00
markm
863c4cc748 Warning fix. Enter into the spirit of getopt(3) a bit more. 2002-02-22 20:55:04 +00:00
markm
7b7558d884 Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 20:51:00 +00:00
markm
f24931e332 Fix warnings inspired by lint, a commercial lint and WARNS=4 2002-02-22 20:45:09 +00:00
dillon
23fcffffc9 Revert wchan functionality. Add 'mwchan' to supply new duel mutex/msleep
functionality and make it the default.

With additional improvements by: Mark Peek <mp@FreeBSD.org>
2002-02-21 18:27:16 +00:00
jedgar
8cdc9fd108 Remove extraneous blank line 2002-02-19 02:36:35 +00:00
jedgar
8df81cb659 Use acl_dup() to duplicate an ACL instead of rolling our own 2002-02-19 02:36:15 +00:00
imp
60cc340d82 Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h.  Update the man pages.

Submitted by: David Malone
Pointy hat to: imp
2002-02-19 00:05:59 +00:00
imp
d4f0b8fef8 Remove now-obsolete __STDC__ ifdefs, remove redundant NULL definition and
include stdlib.h for NULL.
2002-02-18 06:08:23 +00:00
gshapiro
730b12a9a9 Update build infrastructure for sendmail 8.12. 2002-02-17 22:05:07 +00:00
dillon
77112edb7c When blocked on a mutex, display the mutex name via the wchan string field
so we can at least tell the difference between being blocked in Giant
and being blocked in some other mutex.
2002-02-16 20:10:00 +00:00
des
66be93a737 Document the 'M' state. 2002-02-16 18:47:22 +00:00
imp
f58558abb7 Move user_from_uid to pwd.h
Move group_from_gid to grp.h
Remove from stdlib.h
Make the prototypes match the code
Fix rm and mv to include new files.

NetBSD has these defined in those files, and others too that I've not
done.

Approved by: terminal room kabal
Reviewed by: jhb, phk
2002-02-14 01:59:47 +00:00
mp
5d2ae7a01f Install complete.tcsh and csh-mode.el into ${SHAREDIR}/examples/tcsh.
PR:		misc/34800 (from Steven Grady)
Submitted by:	phantom (patch)
MFC after:	3 days
2002-02-12 04:50:12 +00:00
mike
72a803ac5e Repo-copied src/bin/pwd/realpath.1' to src/bin/realpath/realpath.1',
as part of the move to seperate realpath(1) into its own directory.
2002-02-11 18:45:29 +00:00
mike
e9400873cc o Remove old code from pwd(1); realpath(1) is now in its own directory.
o Fix some unordered includes in pwd(1).
o Connect realpath(1) to the build.
2002-02-11 18:38:54 +00:00
mike
18a66da4bb Move the realpath(1) source into its own directory. Previously, it
shared sources with pwd(1).
2002-02-11 07:32:17 +00:00
mike
c9034a8d20 Use the getprogname(3) function instead of directly accessing
`__progname'.

Submitted by:	dd
2002-02-10 05:56:36 +00:00
markm
ae2558974f Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
green
b3206d8278 Correct a logic bug that snuck in and broke multiplication of off_ts. 2002-02-07 02:54:30 +00:00
zarzycki
98e34f92cb Fix the race between the stat() and the mkdir().
Reviewed by:	jkh
2002-02-05 21:55:12 +00:00
mike
9ee57bcb7f Add -L option (SUSv3) to pwd(1). Fix a bug, where realpath(1) would
complain about paths starting with `-', by not calling getopt(3).

Submitted by:	Tim J. Robbins <tim@robbins.dropbear.id.au>
Obtained from:	NetBSD (partially)
MFC after:	1 month
2002-02-04 07:26:21 +00:00
kris
a1a10418c8 Correct inadvertent style botches in previous commit. 2002-02-04 03:06:51 +00:00
kris
bb3058824a Lock down with WFORMAT=1 except those directories with unfixed warnings.
Tested on i386 and alpha.
2002-02-04 02:49:19 +00:00
kris
6ca02c8912 __printflike() should really be __printf0like() since verrx() can
accept a NULL format string.
2002-02-04 01:11:48 +00:00
kris
51396a4bd6 Add a __printflike() attribute to silence warning with FORMAT_AUDIT=1 2002-02-04 01:07:07 +00:00
markm
2973d46886 Use __FBSDID() and clean up the vendor tags. 2002-02-03 20:55:54 +00:00
markm
1084c0a6b2 WARNS=4 fixes, plus a healthy dose of fixes inspired by lint. 2002-02-03 19:11:32 +00:00
markm
aa05461c14 WARNS=4 fixes (incomplete, so set NO_WERROR), and lots of extra
cleanup courtesy of automatic checking (lint).
2002-02-03 14:43:04 +00:00
knu
396a7859f4 Work around a buffer overflow problem on argv that has been exposed
after making test(1) a sh(1) builtin; sh(1) coredumps when you run
something like this:

	sh -c 'test ! `true 1`'

The cause is that the test(1) code totally depends on the presence of
two extra cells at the end of argv that are filled with NULL's.  The
reason why the bug hasn't been exposed would be because the C startup
code kindly prepares argv with some extra zeroed cells for a program.

I know this is not the best fix, but since there are argv++'s without
boundary checks everywhere, I'd rather patch it up like this
(preparing a copy of argv with extra NULL's) for the moment.

MFC after:	3 days
2002-02-03 10:01:49 +00:00
jedgar
2547546bed Use a more correct method of copying entire ACLs (fixes
operation under Linux).
2002-02-03 02:37:43 +00:00
imp
e2889aca77 Fix unused variable. 2002-02-02 07:10:02 +00:00
imp
1733865f62 missed a few registers 2002-02-02 07:09:30 +00:00
imp
0496eb97bd Ooops, forgot to remove the registers here. 2002-02-02 07:07:59 +00:00
imp
c4d9fbc331 %.* takes an int, not a size_t. 2002-02-02 07:06:58 +00:00
imp
5ef5088ac4 o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
o Change
	int
	foo() {
	...
  to
	int
	foo(void)
	{
	...
2002-02-02 06:50:57 +00:00
imp
50014e3541 o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
2002-02-02 06:48:10 +00:00
imp
3fc8df52e3 o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
o gc some #ifdef sun ... #endif code

Approved by: arch@, new style(9)
2002-02-02 06:36:49 +00:00
imp
5203a0a465 o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.

Approved by: arch@, new style(9)
2002-02-02 06:24:13 +00:00
imp
41e5cc1a95 Modernization effort for bin/c*:
o __P has been reoved
  o Old-style K&R declarations have been converted to new C89 style
  o register has been removed
  o prototype for main() has been removed (gcc3 makes it an error)
  o int main(int argc, char *argv[]) is the preferred main definition.
  o Attempt to not break style(9) conformance for declarations more than
    they already are.

  Approved by: arch@, new style(9)
2002-02-02 06:15:22 +00:00
imp
ef44ec93a7 Drag cat(1) kicking and screaming into the late 1980's:
o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.

Approved by: arch@, new style(9)
2002-02-02 06:10:01 +00:00
sheldonh
84ced5c708 Refer to the original mode of the file, not the mode of the original
file.

PR:		docs/34224
Submitted by:	"Gary W. Swearingen" <swear@blarg.net>
2002-02-01 12:37:21 +00:00
ru
2137f05783 Remove a stray :' after v' in the getopt() call.
Submitted by:	bde
2002-01-28 13:43:22 +00:00
ru
8c5c420dd3 GC the -W option. kvm(3) doesn't read swap for almost 10 years.
PR:		docs/34134
Reviewed by:	bde, peter
MFC after:	1 month
2002-01-28 09:43:26 +00:00
green
db659d013d Commit general cleanups (separate get_num() and get_off_t() functions to
debogosify some of the command-line string-number conversions into
an unsigned and signed variant.)
2002-01-25 17:44:47 +00:00
mikeh
b216600a84 Prevent overflowing the buffer that stores the command arguments.
PR:		bin/19422
Not objected to by: -audit
MFC after:	3 weeks
2002-01-20 01:30:40 +00:00
sobomax
99ceec2679 Add missed includes.
Reviewed by:	md5
2002-01-15 12:23:52 +00:00
babkin
6f66434b4f The fix for >/dev/stdout, including Tor Egge's fix for the bug in the
original attempt of the fix. And yes, this time I've tried to build
world with it and it succeeded.

Submitted by:	Tor Egge
MFC after: 1 week
2002-01-13 14:37:40 +00:00
ru
108589a3f2 mdoc(7) police: tidy up. 2002-01-09 13:29:39 +00:00
peter
8b9a0acd48 Put the "mtxname" keyword in alphabetical order (t comes after s) so
that the keyword is recognized.
2002-01-05 12:19:51 +00:00
mckay
9ad6c9c9e7 Bruce thought some of the comments I added were not clear enough. This is
a combination of my words and his.  We will stop fiddling now. :-)
2002-01-01 06:14:26 +00:00
bde
997e80f81f Fixed style bug (unsorting of SRCS) in rev.1.15. 2001-12-29 12:05:30 +00:00
bde
3df6b14036 Fixed style bugs in revs. 1.6, 1.10 and 1.12. 2001-12-29 11:59:26 +00:00
bde
412b81cedf Fixed missing DPADD and disordered LDADD in rev.1.17
Fixed setting of WARNS in rev.1.16.  Options should normally be set using
using "?=", not using "=", so that the setting is easy to override on the
command line, and setting WARNS to 0 should not be an exception.
2001-12-29 11:51:27 +00:00
joe
42e2c5321a LSCOLOURS should be spelt LSCOLORS.
Submitted by:	Jordan DeLong <fracture@allusion.net
2001-12-29 10:13:43 +00:00
ben
8bd06e165d Remove part of a diff committed at the end of the file. 2001-12-29 00:51:23 +00:00
joe
e16986212d Force raw printing of non-printable characters via the -w option.
PR:		bin/28007
2001-12-29 00:22:29 +00:00
joe
4771d61303 Restore these files to shiny KNF. 2001-12-29 00:18:16 +00:00
joe
e208ef8e1a Convert some spaces into tabs that I missed first time around. 2001-12-28 21:55:23 +00:00
joe
d2121ec1c3 Revert most of rev 1.42, to restore KNF style.
Requested by:	bde
2001-12-28 21:47:33 +00:00
joe
dfee532b86 Add a new flag, -h which when combined with the -l option causes
file sizes to be displayed with unit suffixes; Byte, Kilobyte,
Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the
number of digits to three or less.

Submitted by:	nik
2001-12-28 20:50:12 +00:00
joe
4f254fdc50 Make it clearer what changed to a user using the old format of LSCOLORS. 2001-12-28 19:27:30 +00:00
joe
b4f7193e80 Mop up some warnings. 2001-12-28 19:26:06 +00:00
joe
22810faf4b Make the style more consistent throughout the file. 2001-12-28 18:43:32 +00:00
joe
731819d234 Use the default colour instead if a bad colour specification is given. 2001-12-28 18:20:23 +00:00
joe
dcc10c8b7b Revamp the colour support to allow for bold characters. Colours
are now defined using the characters a-h and A-H for the bold
variants.  The old way using 0-7 for the colours still works, but
prints a message asking the user to switch.

PR:		bin/27374
2001-12-28 18:14:50 +00:00
ache
befc49edf5 strtoq -> strtoll (strtoq is deprecated) 2001-12-25 08:10:34 +00:00
alfred
39b93da10a backout rev 1.14, it's breaking things. 2001-12-24 22:27:04 +00:00
mckay
841620acfc The previous fix caused cp to emit spurious warnings under some
circumstances.  This is a reworked version of the same fix, that does
not have this defect, and which fixes some style bugs at the same time.

Bug reported and fix reviewed by: bde
2001-12-23 11:16:14 +00:00
babkin
a0dab54592 Added ability to do ">/dev/stdout". The apsfilter people are anxious
to get it MFCed in time for release 4.5.

MFC after: 2 weeks
2001-12-22 02:40:58 +00:00
ru
3145320d58 Make ``df -l'' work when no network filesystems are loaded.
PR:		bin/32397
2001-12-19 08:38:02 +00:00
ache
67e3e37c96 1) Localize (LC_CTYPE)
2) Catch "" to 0 conversion for OSes that not catch it in strto*()
   (f.e. -stable). It is needed because POSIX agrees with both variants.
2001-12-17 23:14:14 +00:00
ache
7c495473b7 POSIX strto*() functions MAY return EINVAL, so don't assume that only one
errno from them allowed and it is always ERANGE
2001-12-14 23:20:54 +00:00
luigi
6f50cc5876 Add prototypes for main() so that these programs compile with -Werror
(which somehow now seems to be the default for compiling -current).
This error popped up while doing a PicoBSD cross-compile on a 4.3-ish system,
it may well be that there are other apps which have similar problems,
but I did not spot them as they are not included in my picobsd config.

Whether adding prototypes for main() is the correct solution or not
I have no idea, a request to -current on the matter went basically
unanswered. Those who have better ideas are welcome to back this out
and replace it with the correct fix.
2001-12-14 16:22:41 +00:00
charnier
39a78fb21e Do not dot terminate errx() strings 2001-12-11 18:22:01 +00:00
mckay
a6a1f2b728 Preserve directory timestamps with -p. Allow non-empty read-only
directories to be copied.  Apply umask to newly created directories
when -p is not specified.

PR: 27970
PR: 31633

MFC after: 4 days
2001-12-11 13:18:10 +00:00
mckay
dd266e645e Typo in warning message (chown should be chmod). 2001-12-11 13:14:15 +00:00
dwmalone
d9613ea383 Style improvements recommended by Bruce as a follow up to some
of the recent WARNS commits. The idea is:

1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.
2001-12-10 21:13:08 +00:00
ru
f0ecccca2c -lcipher is an installable library. 2001-12-06 10:50:23 +00:00
keramida
83a1efaf60 Make a bit more clear the types of characters that -B option will
print in octal.

Reviewed by:	roam, silence on -doc
2001-12-06 00:30:53 +00:00
ru
52cba5d797 Spelling. 2001-12-04 14:20:46 +00:00
ru
2e1b22fe1b mdoc(7) police: s/LKM/KLD/, sort xrefs. 2001-12-04 14:17:52 +00:00
obrien
099f8ecbe9 Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by:	mike
2001-12-04 01:57:47 +00:00
jedgar
a7e3b4261a Move the code merging ACL_USER and ACL_GROUP objects from under
two nested while loops into a separate function.

Obtained from: 	TrustedBSD Project
2001-12-03 02:24:24 +00:00
jedgar
38cc4cae2f Add defines for access and default ACLs (ACCESS_ACL/DEFAULT_ACL)
to enhance readability.

Obtained from:	TrustedBSD Project
2001-12-03 01:20:52 +00:00
jedgar
30f5e7ea6e style(9) cleanups mostly consisting of:
o explicitly check return values and variables against a value
o return x; -> return (x);
o fix inconsistent sysexits usage by nuking it (partially
  suggested by bde)

Obtained from:	TrustedBSD Project
2001-12-03 00:51:36 +00:00
jedgar
e0f46659fc Correct example to remove *all* extended ACL entries and
clarify description.
2001-12-03 00:27:15 +00:00
markm
b3be1b374c Slight makefile style.
Use __FBSDID().
2001-12-02 23:04:14 +00:00
jedgar
e95759f464 o Expand the explaination of the -b option WRT the resulting
group ACL entry in relation to the existing group and mask
  ACL entries.
o Move the explanation of multiple ACL entries on the command
  line to the ACL ENTRIES section.

Obtained from:	TrustedBSD Project
2001-12-02 18:46:33 +00:00
jedgar
c3aedf8ced o Correct error message forgotten in the last commit (malloc() -> calloc())
o Fix style nits

Submitted by:	bde
2001-12-02 18:15:53 +00:00
jedgar
f1ae0d570c Use calloc(3) instead of rolling our own. 2001-12-02 01:52:34 +00:00
green
74b53a2f1a Note that stty is a utility and not... err... a program....
Submitted by:	ru
2001-11-29 15:46:54 +00:00
green
77ac0dbce8 Stty is a program, not a function. 2001-11-29 03:26:42 +00:00
green
d741ed6f56 Add LOMAC options (the "Z" flag in both cases) to display extra information
in ls(1) and ps(1).

Sponsored by:	DARPA, NAI Labs
2001-11-26 22:21:15 +00:00
knu
96265e088e Remove the printf builtin command from sh(1), which command is not
used so often that it's worth keeping it as a builtin.

Now that all the printf invocations from within the system startup
scripts, we can safely remove it.

Urged by:	sheldonh  :)

No MFC is planned so far because it may break compatibility and
violate POLA.
2001-11-20 18:33:59 +00:00
knu
9a58963b18 Fix style bugs I found, and add a comment. 2001-11-19 20:39:24 +00:00
knu
959d37723b Oops sorry, forgot to add a #include. 2001-11-19 20:15:10 +00:00
knu
0fe2ba5388 - Do not reference argv[1] if no argument is given.
Reported by:	brian

- Call error() instead of errx() if compiled as sh(1) builtin.
2001-11-19 19:57:45 +00:00
knu
b58a3e4078 Make test(1) a builtin command of our sh(1) for efficiency. The
binary size increase is 3,784 bytes (about 0.6%).

I don't drop the printf builtin while I'm here because some /etc/rc.*
scripts seem to use it before mounting /usr where printf(1) resides.

Reviewed by:	arch (sheldonh)
Inspired by:	NetBSD, ksh
Clued by:	ume (on how the printf builtin is used)
2001-11-17 19:10:11 +00:00
rwatson
cb22385a83 o Update licenses, comments.
Obtained from:	TrustedBSD Project
2001-11-16 15:59:46 +00:00
dd
bbce60529d Deuglify the usage message by putting the program name after the
"usage:" string.  This is how most (all?) other programs in the system
do it.

PR:		31596
Submitted by:	Cyrille Lefevre <clefevre@citeweb.net>
2001-11-15 15:46:45 +00:00
tegge
c98a8251e8 Don't call setvar() with the VTEXTFIXED flag. A copy is created by
setvar() and passed to setvareq(). When the VTEXTFIXED flag is set,
that copy is never freed, causing a memory leak.

PR:		31533
Submitted by:	maxim@macomnet.ru
2001-11-07 23:00:05 +00:00
dillon
4394f0950f Use a quad int conversion routine for time_t instead of ulong, capable of
decoding tar's full time buffer (12 digits).
2001-10-28 02:51:43 +00:00
dillon
6ce5111d95 Various string fields for certain cpio types are 11 rather then 8
characters.  Use quad conversion functions rather then long conversion
where appropriate to handle the available range.  Mainly fixes time_t
but there was also a st_size ulong conversion in there that has to be
quad or cpio cannot be used to copy files > 2G.

MFC after:	1 day
2001-10-28 02:45:04 +00:00
dillon
5bb0a362e0 Remove unnecessary casts in timeval.tv_sec load from st_*time 2001-10-28 02:42:26 +00:00
dillon
78601098af Remove assumption that time_t is an int
MFC after:	1 day
2001-10-28 02:28:04 +00:00
ru
b28c3d865f mdoc(7) police: join OS version with the corresponding macro. 2001-10-19 14:44:13 +00:00
tegge
e6528784cf Repair normally unused is_digit() macro. 2001-10-14 21:11:33 +00:00
obrien
d9494059c0 *** empty log message *** 2001-10-01 08:43:58 +00:00
ru
eb7cee6686 WARNSify. 2001-09-26 11:34:14 +00:00
ru
e43023b2d0 The "cat - -" feature was broken by the last commit.
Restore the code that avoided closing and reopening
stdin.  This is also required by POSIX.  As a bonus,
enable multiple stdin reads with the -benstv flags,
by resetting the EOF condition on stdin.
2001-09-26 11:32:23 +00:00