From: Justin Erenkrantz Date: Tue, 2 Jul 2002 22:19:13 +0000 (+0000) Subject: Use the apr_file_copy function rather than doing a system call to copy X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2e5939382c6bec1b0eaa431eb7fd072579ca95f;p=apache Use the apr_file_copy function rather than doing a system call to copy the file. Submitted by: Thom May Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95944 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/htpasswd.c b/support/htpasswd.c index 28f16bfa6a..a391f35a5c 100644 --- a/support/htpasswd.c +++ b/support/htpasswd.c @@ -606,12 +606,7 @@ int main(int argc, const char * const argv[]) /* The temporary file has all the data, just copy it to the new location. */ -#if defined(OS2) || defined(WIN32) - str = apr_psprintf(pool, "copy \"%s\" \"%s\"", tn, pwfilename); -#else - str = apr_psprintf(pool, "cp %s %s", tn, pwfilename); -#endif - system(str); + apr_file_copy(tn, pwfilename, APR_FILE_SOURCE_PERMS, pool); apr_file_close(ftemp); return 0; }