From 886e732b7a84581a190339506969b7baaebe6965 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 1 May 2009 17:25:31 +0000 Subject: [PATCH] Correct return value for copying sub-dirs --- useradmin/user-lib.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/useradmin/user-lib.pl b/useradmin/user-lib.pl index 455aed8ed..67b1b344b 100644 --- a/useradmin/user-lib.pl +++ b/useradmin/user-lib.pl @@ -1115,7 +1115,17 @@ elsif (-l $_[0] && !$config{'copy_symlinks'}) { elsif (-d $_[0]) { # A directory .. copy it recursively &system_logged("cp -Rp ".quotemeta($_[0])." ".quotemeta("$_[1]/$base")." >/dev/null 2>/dev/null"); - @rv = glob("$_[1]/$base/*"); + local $glob = "$_[1]/$base/*"; + while(1) { + local @g = glob($glob); + if (@g) { + push(@rv, @g); + $glob .= "/*"; + } + else { + last; + } + } } else { # Just a normal file .. copy it