Commit 8ce2b13b authored by Marcelo Duarte's avatar Marcelo Duarte Committed by Alexandre Julliard

LZCopy: modified timestamp of a expanded file has to be the same of

original file.
parent 09029b28
...@@ -437,9 +437,11 @@ LONG WINAPI LZSeek( HFILE fd, LONG off, INT type ) ...@@ -437,9 +437,11 @@ LONG WINAPI LZSeek( HFILE fd, LONG off, INT type )
*/ */
LONG WINAPI LZCopy( HFILE src, HFILE dest ) LONG WINAPI LZCopy( HFILE src, HFILE dest )
{ {
int usedlzinit=0,ret,wret; int usedlzinit = 0, ret, wret;
LONG len; LONG len;
HFILE oldsrc = src; HFILE oldsrc = src, srcfd;
FILETIME filetime;
struct lzstate *lzs;
#define BUFLEN 1000 #define BUFLEN 1000
BYTE buf[BUFLEN]; BYTE buf[BUFLEN];
/* we need that weird typedef, for i can't seem to get function pointer /* we need that weird typedef, for i can't seem to get function pointer
...@@ -476,6 +478,13 @@ LONG WINAPI LZCopy( HFILE src, HFILE dest ) ...@@ -476,6 +478,13 @@ LONG WINAPI LZCopy( HFILE src, HFILE dest )
if (wret!=ret) if (wret!=ret)
return LZERROR_WRITE; return LZERROR_WRITE;
} }
/* Maintain the timestamp of source file to destination file */
srcfd = (!(lzs = GET_LZ_STATE(src))) ? src : lzs->realfd;
GetFileTime((HANDLE)srcfd, NULL, NULL, &filetime);
SetFileTime((HANDLE)dest, NULL, NULL, &filetime);
/* close handle */
if (usedlzinit) if (usedlzinit)
LZClose(src); LZClose(src);
return len; return len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment