Changeset 152649 in webkit


Ignore:
Timestamp:
Jul 15, 2013 11:22:49 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[Curl] Download does not replace existing file.
https://bugs.webkit.org/show_bug.cgi?id=118356

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-07-15
Reviewed by Brent Fulgham.

If the download target file already exists, it is not replaced after the download has finished.
At this point, the user would have already approved to replace the file, so it should be replaced.

  • platform/network/curl/CurlDownload.cpp:

(CurlDownload::moveFileToDestination): Move file and replace it if it already exists.
If the new file is on a different volume, do a copy/delete operation.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152647 r152649  
     12013-07-15  peavo@outlook.com  <peavo@outlook.com>
     2
     3        [Curl] Download does not replace existing file.
     4        https://bugs.webkit.org/show_bug.cgi?id=118356
     5
     6        Reviewed by Brent Fulgham.
     7
     8        If the download target file already exists, it is not replaced after the download has finished.
     9        At this point, the user would have already approved to replace the file, so it should be replaced.
     10
     11        * platform/network/curl/CurlDownload.cpp:
     12        (CurlDownload::moveFileToDestination): Move file and replace it if it already exists.
     13        If the new file is on a different volume, do a copy/delete operation.
     14
    1152013-07-15  Luciano Wolf  <luciano.wolf@openbossa.org>
    216
  • trunk/Source/WebCore/platform/network/curl/CurlDownload.cpp

    r152297 r152649  
    300300        return;
    301301
    302     ::MoveFile(m_tempPath.charactersWithNullTermination().data(), m_destination.charactersWithNullTermination().data());
     302    ::MoveFileEx(m_tempPath.charactersWithNullTermination().data(), m_destination.charactersWithNullTermination().data(), MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);
    303303}
    304304
Note: See TracChangeset for help on using the changeset viewer.