projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
prettyness police
[unix-history]
/
usr
/
src
/
bin
/
ls
/
util.c
diff --git
a/usr/src/bin/ls/util.c
b/usr/src/bin/ls/util.c
index
59657c1
..
4ad8bc5
100644
(file)
--- a/
usr/src/bin/ls/util.c
+++ b/
usr/src/bin/ls/util.c
@@
-1,52
+1,45
@@
/*
/*
- * Copyright (c) 1989
The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989
, 1993
+ *
The Regents of the University of California.
All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Michael Fischbein.
*
*
* This code is derived from software contributed to Berkeley by
* Michael Fischbein.
*
-%sccs.include.redist.c%
+
*
%sccs.include.redist.c%
*/
#ifndef lint
*/
#ifndef lint
-static char sccsid[] = "@(#)util.c
5.7
(Berkeley) %G%";
+static char sccsid[] = "@(#)util.c
8.2
(Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
-#include <stdio.h>
+#include <sys/stat.h>
+
#include <ctype.h>
#include <ctype.h>
+#include <fts.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "ls.h"
+#include "extern.h"
+
+void
prcopy(src, dest, len)
prcopy(src, dest, len)
-
register
char *src, *dest;
-
register
int len;
+ char *src, *dest;
+ int len;
{
{
-
register
int ch;
+ int ch;
- while(len--) {
+ while
(len--) {
ch = *src++;
*dest++ = isprint(ch) ? ch : '?';
}
}
ch = *src++;
*dest++ = isprint(ch) ? ch : '?';
}
}
-char
-*emalloc(size)
- u_int size;
-{
- char *retval, *malloc();
-
- if (!(retval = malloc(size)))
- nomem();
- return(retval);
-}
-
-nomem()
-{
- (void)fprintf(stderr, "ls: out of memory.\n");
- exit(1);
-}
-
+void
usage()
{
usage()
{
- (void)fprintf(stderr, "usage: ls [-1ACFLR
acdfg
iklqrstu] [file ...]\n");
+ (void)fprintf(stderr, "usage: ls [-1ACFLR
Tacdf
iklqrstu] [file ...]\n");
exit(1);
}
exit(1);
}