On 4/3/19 4:03 PM, JohnD wrote:
> 
> Version: 8.0-release
> Windows 10, mingw64-w64.
> 
> I'm attempting to use readline in a mingw compiled project and am seeing
> that the history save is failing. If the history file doesn't exist it is
> working, on having a history file, it fails.
> 
> Previously I was using v6.2 without any issues
> 
> Printing the status out in the sources to find out where it fails, it is
> failing in histfile_restore when calling the rename function, which looks to
> have been added for version 7.0
> 
> 
> According to http://www.cplusplus.com/reference/cstdio/rename/ if the dest
> file already exists, the function may either fail or override the existing
> file, depending on the specific system and library implementation.

Well, those are terrible semantics. So much for atomic rename and leaving
newpath in place on a file system error.

I don't use Windows, but you could try adding

unlink(linkbuf);
or
unlink(orig);

before the calls to rename() (or, if you're using a version of readline
distributed by MinGW, file a bug report with them). Let me know if it
works.

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/

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to