Description: When reviewing the destination filename is randomly generated so
 that in the case of accidentaly choosing the destination directory equal to the
 source directory, the source file is not deleted. Also improve the escaping of
 quotes.
Author: Paul Gevers <paul@climbing.nl>
Bug: http://code.google.com/p/winff/issues/detail?id=110

Index: winff-git/unit1.pas
===================================================================
--- winff-git.orig/unit1.pas	2011-06-13 21:21:56.094407525 +0200
+++ winff-git/unit1.pas	2011-06-13 21:23:07.194760086 +0200
@@ -1519,9 +1519,16 @@
      begin
        filename := filelist.items[i];
        basename := extractfilename(filename);
+
+       if preview = true then
+       begin
+         basename := 'tmp_' + inttostr(random(10000000)) ;
+       end;	
+
        // resolve issues with embedded quote marks in filename to be converted.  issue 38
        {$ifdef unix}
        filename := StringReplace(filename,'"','\"',[rfReplaceAll]);
+       basename := StringReplace(basename,'"','\"',[rfReplaceAll]);
        {$endif}
 
        for j:= length(basename) downto 1  do
@@ -1529,9 +1536,6 @@
            if basename[j] = #46 then
               begin
                 basename := leftstr(basename,j-1);
-                {$ifdef unix}
-                basename := StringReplace(basename,'"','\"',[rfReplaceAll]);
-                {$endif}
                 break;
               end;
          end;
