prettyness police
[unix-history] / usr / src / bin / ls / util.c
index 59657c1..4ad8bc5 100644 (file)
@@ -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 [-1ACFLRacdfgiklqrstu] [file ...]\n");
+       (void)fprintf(stderr, "usage: ls [-1ACFLRTacdfiklqrstu] [file ...]\n");
        exit(1);
 }
        exit(1);
 }