bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-readline] readline crashes when used from msvc


From: ohndfsbkjb
Subject: [Bug-readline] readline crashes when used from msvc
Date: Thu, 14 Apr 2016 20:25:26 +0200

readline5 binaries from gnuwin32. windows 7
 
When i try to use readline/history from a msvc programm i get crashes. The reason is that readline returns pointers that are required to be freed but readline offers no free function to do that. Note that i cannot use the normal free function becasue that would link to the msvc free function which is incompatible with the malloc function used by the librarly which was most likeley compiled with gcc (mingw).
 
the proper fix here would be to export a void rl_free(void* p); function in the headers which is just defined as void rl_free( void* p ) { free(p); } in the c file. (and similar rl_malloc)
 
This could then be used on windows and linux for cross-plattform applications that want to use readline.
 
Note, that if those function would be just added to the gnuwin32 versions my programm wouldn't compile on linux then because those function wouldn't be defined  there.
 
 
Another issue is that the read/write file functions ( read_history etc. ) cannot handle non asci characters in filenames on windows (both mingw and msvc) because they use srtandard c open, read close functions internally which only support asci chracters on windows.
 
The proper fix here would be to add more flexible versions of those functions which take a function/object pointer that does the file reading for them, similar to SDL_RWops in SDL.
 
Note that i won't check this mail account often, i will however check the mailing lists on http://lists.gnu.org/archive/html/bug-readline/ for the next weeks.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]