FLUID: fixes file path calculation bug

This commit is contained in:
Matthias Melcher 2023-08-26 16:10:02 +02:00
parent 94a75b012f
commit 3ed43363cd
2 changed files with 6 additions and 5 deletions

View File

@ -484,16 +484,17 @@ static void cb_w_layout_menu_save(Fl_Menu_*, void*) {
fnfc.filter("FLUID Layouts\t*.fll\n");
if (g_layout_list.filename_) {
char *fn = fl_strdup(g_layout_list.filename_);
char *name = (char*)fl_filename_name(g_layout_list.filename_);
char *name = (char*)fl_filename_name(fn);
if (name > fn) {
name[-1] = 0;
fnfc.directory(fn);
fnfc.preset_file(name);
::free(fn);
} else if (name) {
fnfc.preset_file(name);
::free(fn);
} else {
fnfc.preset_file("");
}
::free(fn);
}
if (fnfc.show() != 0) return;
const char *new_filename = fnfc.filename();

View File

@ -263,11 +263,11 @@ const char *Fl_Darwin_System_Driver::filename_name( const char *name )
// original pointer.
//
// Most X11 implementations seem to default to Latin-1 as a code since it
// is a superset of ISO 8859-1, the original wetsern codepage on X11.
// is a superset of ISO 8859-1, the original Western codepage on X11.
//
// Apple's OS X however renders text in MacRoman for western settings. The
// lookup tables below will convert all common character codes and replace
// unknown characters with an upsidedown question mark.
// unknown characters with an upside-down question mark.
// This table converts Windows-1252/Latin 1 into MacRoman encoding
static uchar latin2roman[128] = {