=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rdist/client.c,v retrieving revision 1.24 retrieving revision 1.25 diff -c -r1.24 -r1.25 *** src/usr.bin/rdist/client.c 2012/11/12 01:14:41 1.24 --- src/usr.bin/rdist/client.c 2012/11/12 01:18:37 1.25 *************** *** 1,4 **** ! /* $OpenBSD: client.c,v 1.24 2012/11/12 01:14:41 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: client.c,v 1.25 2012/11/12 01:18:37 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. *************** *** 593,603 **** if (response() < 0) return(-1); /* * Don't descend into directory */ ! if (IS_ON(opts, DO_NODESCEND)) goto out; if (IS_ON(opts, DO_REMOVE)) if (rmchk(opts) > 0) --- 593,607 ---- if (response() < 0) return(-1); + optarget = ptarget; + /* * Don't descend into directory */ ! if (IS_ON(opts, DO_NODESCEND)) { ! didupdate = 0; goto out; + } if (IS_ON(opts, DO_REMOVE)) if (rmchk(opts) > 0) *************** *** 605,614 **** if ((d = opendir(target)) == NULL) { error("%s: opendir failed: %s", target, SYSERR); ! return(-1); } - optarget = ptarget; len = ptarget - target; while ((dp = readdir(d)) != NULL) { if (!strcmp(dp->d_name, ".") || --- 609,618 ---- if ((d = opendir(target)) == NULL) { error("%s: opendir failed: %s", target, SYSERR); ! didupdate = -1; ! goto out; } len = ptarget - target; while ((dp = readdir(d)) != NULL) { if (!strcmp(dp->d_name, ".") || *************** *** 631,636 **** --- 635,641 ---- } (void) closedir(d); + out: (void) sendcmd(C_END, NULL); (void) response();