@@ -3588,11 +3588,13 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
35883588 if (preserve_timestamps) {
35893589 uv_fs_t req;
35903590 auto cleanup = OnScopeLeave ([&req]() { uv_fs_req_cleanup (&req); });
3591+ const char * dir_path = dir_entry.path ().c_str ();
3592+
35913593 int result =
3592- uv_fs_stat (nullptr , &req, dir_entry. path (). c_str () , nullptr );
3594+ uv_fs_stat (nullptr , &req, dir_path , nullptr );
35933595 if (is_uv_error (result)) {
35943596 env->ThrowUVException (
3595- result, " stat" , nullptr , dir_entry. path (). c_str () );
3597+ result, " stat" , nullptr , dir_path );
35963598 return false ;
35973599 }
35983600
@@ -3602,16 +3604,16 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
36023604 const double source_mtime =
36033605 s->st_mtim .tv_sec + s->st_mtim .tv_nsec / 1e9 ;
36043606
3605- const char * dest_path = dest_entry_path.c_str ();
3607+ const char * path = dest_entry_path.c_str ();
36063608 int utime_result = uv_fs_utime (nullptr ,
36073609 &req,
3608- dest_path ,
3610+ path ,
36093611 source_atime,
36103612 source_mtime,
36113613 nullptr );
36123614 if (is_uv_error (utime_result)) {
36133615 env->ThrowUVException (
3614- utime_result, " utime" , nullptr , dest_entry_path. c_str () );
3616+ utime_result, " utime" , nullptr , path );
36153617 return false ;
36163618 }
36173619 }
0 commit comments