1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Ken Smith of The State University of New York at Buffalo. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 31 unchanged lines hidden (view full) --- 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /* not lint */ 42 43#ifndef lint 44#if 0 45static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; 46#endif 47static const char rcsid[] = |
48 "$Id: mv.c,v 1.18 1998/05/15 06:25:17 charnier Exp $"; |
49#endif /* not lint */ 50 51#include <sys/param.h> 52#include <sys/time.h> 53#include <sys/wait.h> 54#include <sys/stat.h> 55#include <sys/mount.h> 56 --- 53 unchanged lines hidden (view full) --- 110 usage(); 111 exit(do_move(argv[0], argv[1])); 112 } 113 114 /* It's a directory, move each file into it. */ 115 (void)strcpy(path, argv[argc - 1]); 116 baselen = strlen(path); 117 endp = &path[baselen]; |
118 if (!baselen || *(endp - 1) != '/') { 119 *endp++ = '/'; 120 ++baselen; 121 } |
122 for (rval = 0; --argc; ++argv) { 123 /* 124 * Find the last component of the source pathname. It 125 * may have trailing slashes. 126 */ 127 p = *argv + strlen(*argv); 128 while (p != *argv && p[-1] == '/') 129 --p; --- 226 unchanged lines hidden --- |