add 1994 copyright
[unix-history] / usr / src / bin / ls / util.c
index 46354ab..a3c2d32 100644 (file)
@@ -1,62 +1,45 @@
 /*
 /*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993, 1994
+ *     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.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)util.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c     8.3 (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 [-1ACFLRacdgilqrstu] [file ...]\n");
+       (void)fprintf(stderr, "usage: ls [-1ACFLRTacdfiklqrstu] [file ...]\n");
        exit(1);
 }
        exit(1);
 }