mirror of
				https://github.com/vlang/v.git
				synced 2023-08-10 21:13:21 +03:00 
			
		
		
		
	os.cp: fix returning false error on Windows (#6037)
This commit is contained in:
		| @@ -75,9 +75,8 @@ pub fn cp(old, new string) ? { | ||||
| 	$if windows { | ||||
| 		w_old := old.replace('/', '\\') | ||||
| 		w_new := new.replace('/', '\\') | ||||
| 		C.CopyFile(w_old.to_wide(), w_new.to_wide(), false) | ||||
| 		result := C.GetLastError() | ||||
| 		if result != 0 { | ||||
| 		if C.CopyFile(w_old.to_wide(), w_new.to_wide(), false) == 0 { | ||||
| 			result := C.GetLastError() | ||||
| 			return error_with_code('failed to copy $old to $new', int(result)) | ||||
| 		} | ||||
| 	} $else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Nick Treleaven
					Nick Treleaven