changes for whiteouts and union filesystem
[unix-history] / usr / src / bin / ls / util.c
CommitLineData
63332977 1/*
d662a9c3 2 * Copyright (c) 1989, 1993, 1994
59d11f9a 3 * The Regents of the University of California. All rights reserved.
63332977 4 *
eeb191cb
KB
5 * This code is derived from software contributed to Berkeley by
6 * Michael Fischbein.
7 *
0ce0ae04 8 * %sccs.include.redist.c%
63332977
KB
9 */
10
11#ifndef lint
88edbcd4 12static char sccsid[] = "@(#)util.c 8.4 (Berkeley) %G%";
63332977
KB
13#endif /* not lint */
14
15#include <sys/types.h>
0ce0ae04 16#include <sys/stat.h>
d9c2d050 17
63332977 18#include <ctype.h>
d7ea79bd 19#include <fts.h>
d9c2d050
KB
20#include <stdio.h>
21#include <stdlib.h>
b651adfd 22#include <string.h>
d9c2d050 23
0ce0ae04
KB
24#include "ls.h"
25#include "extern.h"
63332977 26
0ce0ae04 27void
f066c6c9 28prcopy(src, dest, len)
706c0358
JSP
29 char *src, *dest;
30 int len;
f066c6c9 31{
706c0358 32 int ch;
63332977 33
706c0358 34 while (len--) {
f066c6c9
KB
35 ch = *src++;
36 *dest++ = isprint(ch) ? ch : '?';
37 }
63332977
KB
38}
39
0ce0ae04
KB
40void
41usage()
63332977 42{
88edbcd4 43 (void)fprintf(stderr, "usage: ls [-1ACFLRTWacdfiklqrstu] [file ...]\n");
63332977
KB
44 exit(1);
45}