> -----Original Message----- > From: Chet Ramey [mailto:[email protected]] > Sent: Wednesday, April 03, 2019 6:39 PM > To: JohnD; [email protected] > Cc: [email protected] > Subject: Re: [Bug-readline] readline 8.0 in windows > > On 4/3/19 4:54 PM, JohnD wrote: > > > Msys2 recently went to 8.0 > > https://github.com/msys2/MINGW-packages/pull/5011 > > > > I'll verify it doesn’t work there and let them know > > > > > > For reference, Windoze does have its own 'rename' like function > > https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase- > movefileexa > > > > So I was going to try adding something like: > > static int > > history_rename(const char *from, const char *to) > > { > > #if defined(_WIN32) > > if (!MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING)) { > > return -1; > > } > > return 0; > > #else > > return rename(from, to); > > #endif > > } > > > > And change the rename calls to history_rename > > That approach looks reasonable. Let me know what works best, and I'll patch > the source. > > Chet > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > ``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/
I verified that msys2 mingw-64 readline (version 7.0) also fails when writing to an existing file When using my own modified version of readline 8.0, it works for me - full patch used attached.
0001-Add-private-history_rename-function-and-in-WIN32-use.patch
Description: Binary data
_______________________________________________ Bug-readline mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-readline
