OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [userland/] [sash/] [cp.c] - Blame information for rev 1767

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
 
2
void
3
do_cp(argc, argv)
4
        char    **argv;
5
{
6
        BOOL    dirflag;
7
        char    *srcname;
8
        char    *destname;
9
        char    *lastarg;
10
 
11
        lastarg = argv[argc - 1];
12
 
13
        dirflag = isadir(lastarg);
14
 
15
        if ((argc > 3) && !dirflag) {
16
                fprintf(stderr, "%s: not a directory\n", lastarg);
17
                return;
18
        }
19
 
20
        while (argc-- > 2) {
21
                destname = lastarg;
22
                if (dirflag)
23
                        destname = buildname(destname, srcname);
24
 
25
                (void) copyfile(*++argv, destname, FALSE);
26
        }
27
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.