summaryrefslogtreecommitdiff
path: root/cp_mv.c
diff options
context:
space:
mode:
authorEric Andersen2001-04-09 22:48:12 +0000
committerEric Andersen2001-04-09 22:48:12 +0000
commite5dfced23a904d08afa5dcee190c3c3d845d9f50 (patch)
treeef367ee8a9096884fb40debdc9e10af8583f9d5f /cp_mv.c
parenta75e2867435faa68ea03735fe09ad298fa3e4e72 (diff)
downloadbusybox-e5dfced23a904d08afa5dcee190c3c3d845d9f50.zip
busybox-e5dfced23a904d08afa5dcee190c3c3d845d9f50.tar.gz
Apply Vladimir's latest cleanup patch.
-Erik
Diffstat (limited to 'cp_mv.c')
-rw-r--r--cp_mv.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cp_mv.c b/cp_mv.c
index fb48d3c..f4b5cd0 100644
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -256,18 +256,16 @@ extern int cp_mv_main(int argc, char **argv)
int state = 0;
char *pushd, *d, *p;
- if ((pushd = getcwd(NULL, BUFSIZ + 1)) == NULL) {
- perror_msg("getcwd()");
+ if ((pushd = xgetcwd(0)) == NULL)
continue;
- }
+
if (chdir(baseDestName) < 0) {
perror_msg("chdir(%s)", baseSrcName);
continue;
}
- if ((d = getcwd(NULL, BUFSIZ + 1)) == NULL) {
- perror_msg("getcwd()");
+ if ((d = xgetcwd(0)) == NULL)
continue;
- }
+
while (!state && *d != '\0') {
if (stat(d, &sb) < 0) { /* stat not lstat - always dereference targets */
perror_msg("stat(%s)", d);