mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-01 02:03:31 +00:00
Merge Lite2 mods and -Wall cleaning.
This commit is contained in:
parent
1686b60268
commit
890acb9554
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=20412
@ -32,10 +32,10 @@
|
|||||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
.\" SUCH DAMAGE.
|
.\" SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.\" @(#)cat.1 8.1 (Berkeley) 6/29/93
|
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
|
||||||
.\" $Id: cat.1,v 1.2 1994/09/24 02:53:25 davidg Exp $
|
.\" $Id: cat.1,v 1.3 1996/08/22 16:54:12 wosch Exp $
|
||||||
.\"
|
.\"
|
||||||
.Dd June 29, 1993
|
.Dd May 2, 1995
|
||||||
.Dt CAT 1
|
.Dt CAT 1
|
||||||
.Os BSD 3
|
.Os BSD 3
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -69,9 +69,7 @@ option, and displays a dollar sign
|
|||||||
at the end of each line
|
at the end of each line
|
||||||
as well.
|
as well.
|
||||||
.It Fl n
|
.It Fl n
|
||||||
Number the
|
Number the output lines, starting at 1.
|
||||||
.Ar output
|
|
||||||
lines, starting at 1.
|
|
||||||
.It Fl s
|
.It Fl s
|
||||||
Squeeze multiple adjacent empty lines, causing the output to be
|
Squeeze multiple adjacent empty lines, causing the output to be
|
||||||
single spaced.
|
single spaced.
|
||||||
@ -79,7 +77,7 @@ single spaced.
|
|||||||
Implies the
|
Implies the
|
||||||
.Fl v
|
.Fl v
|
||||||
option, and displays tab characters as
|
option, and displays tab characters as
|
||||||
.Pq Ql ^I
|
.Ql ^I
|
||||||
as well.
|
as well.
|
||||||
.It Fl u
|
.It Fl u
|
||||||
The
|
The
|
||||||
@ -109,7 +107,8 @@ will cause the original data in file1 to be destroyed!
|
|||||||
.Xr head 1 ,
|
.Xr head 1 ,
|
||||||
.Xr more 1 ,
|
.Xr more 1 ,
|
||||||
.Xr pr 1 ,
|
.Xr pr 1 ,
|
||||||
.Xr tail 1
|
.Xr tail 1 ,
|
||||||
|
.Xr vis 1
|
||||||
.Rs
|
.Rs
|
||||||
.%A Rob Pike
|
.%A Rob Pike
|
||||||
.%T "UNIX Style, or cat -v Considered Harmful"
|
.%T "UNIX Style, or cat -v Considered Harmful"
|
||||||
|
@ -33,17 +33,17 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: cat.c,v 1.4 1996/09/28 21:19:27 imp Exp $
|
* $Id: cat.c,v 1.5 1996/09/30 15:45:36 ache Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char const copyright[] =
|
||||||
"@(#) Copyright (c) 1989, 1993\n\
|
"@(#) Copyright (c) 1989, 1993\n\
|
||||||
The Regents of the University of California. All rights reserved.\n";
|
The Regents of the University of California. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
|
static char const sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
.\" SUCH DAMAGE.
|
.\" SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
|
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
|
||||||
.\" $Id: cp.1,v 1.5 1996/03/08 06:58:05 wosch Exp $
|
.\" $Id: cp.1,v 1.6 1996/08/29 18:05:44 wosch Exp $
|
||||||
.\"
|
.\"
|
||||||
.Dd April 18, 1994
|
.Dd April 18, 1994
|
||||||
.Dt CP 1
|
.Dt CP 1
|
||||||
@ -213,7 +213,7 @@ or fifo's.
|
|||||||
.Xr umask 2 ,
|
.Xr umask 2 ,
|
||||||
.Xr fts 3 ,
|
.Xr fts 3 ,
|
||||||
.Xr symlink 7
|
.Xr symlink 7
|
||||||
.Sh HISTORY
|
.Sh STANDARDS
|
||||||
The
|
The
|
||||||
.Nm cp
|
.Nm cp
|
||||||
command is expected to be
|
command is expected to be
|
||||||
|
17
bin/cp/cp.c
17
bin/cp/cp.c
@ -33,17 +33,17 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: cp.c,v 1.9 1996/02/19 05:56:33 pst Exp $
|
* $Id: cp.c,v 1.10 1996/03/08 06:58:06 wosch Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char const copyright[] =
|
||||||
"@(#) Copyright (c) 1988, 1993, 1994\n\
|
"@(#) Copyright (c) 1988, 1993, 1994\n\
|
||||||
The Regents of the University of California. All rights reserved.\n";
|
The Regents of the University of California. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
static char const sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -51,7 +51,7 @@ static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
|||||||
*
|
*
|
||||||
* The global PATH_T structure "to" always contains the path to the
|
* The global PATH_T structure "to" always contains the path to the
|
||||||
* current target file. Since fts(3) does not change directories,
|
* current target file. Since fts(3) does not change directories,
|
||||||
* this path can be either absolute or dot-realative.
|
* this path can be either absolute or dot-relative.
|
||||||
*
|
*
|
||||||
* The basic algorithm is to initialize "to" and use fts(3) to traverse
|
* The basic algorithm is to initialize "to" and use fts(3) to traverse
|
||||||
* the file hierarchy rooted in the argument list. A trivial case is the
|
* the file hierarchy rooted in the argument list. A trivial case is the
|
||||||
@ -253,7 +253,7 @@ copy(argv, type, fts_options)
|
|||||||
struct stat to_stat;
|
struct stat to_stat;
|
||||||
FTS *ftsp;
|
FTS *ftsp;
|
||||||
FTSENT *curr;
|
FTSENT *curr;
|
||||||
int base, dne, nlen, rval;
|
int base = 0, dne, nlen, rval;
|
||||||
char *p, *target_mid;
|
char *p, *target_mid;
|
||||||
|
|
||||||
if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL)
|
if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL)
|
||||||
@ -341,6 +341,13 @@ copy(argv, type, fts_options)
|
|||||||
(void)fts_set(ftsp, curr, FTS_SKIP);
|
(void)fts_set(ftsp, curr, FTS_SKIP);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!S_ISDIR(curr->fts_statp->st_mode) &&
|
||||||
|
S_ISDIR(to_stat.st_mode)) {
|
||||||
|
warnx("cannot overwrite directory %s with non-directory %s",
|
||||||
|
to.p_path, curr->fts_path);
|
||||||
|
rval = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
dne = 0;
|
dne = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,11 +30,11 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: utils.c,v 1.6 1996/02/18 18:48:26 wosch Exp wosch $
|
* $Id: utils.c,v 1.9 1996/03/08 06:58:08 wosch Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
|
static char const sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user