[Github-comments] [geany] New instance improvements (#653)

zhekov notifications at xxxxx
Thu Sep 10 19:37:31 UTC 2015


Now, a few words about app->confdir under *nix.

Geany assigns "app->confdir = alternate_config", and then in setup_config_dir() does "SETPTR(app->configdir, utils_get_locale_from_utf8(app->configdir))", freeing app->confdir, and thus alternate_config, leading to buggy reproduced option for New Window.

The original SM code counters this by "app->confdir = g_strdup(alternate_config)", but in my tests with a -c *locale_dir* under Linux:

- alternate_config was in locale (identical to *locale_dir*)
- utils_get_locale_from_utf8(app->confdir) /from SETPTR/ failed to convert it to locale, and returned a copy of it
- Help -> Debug Messages aborted Geany with an assertion that the text to be displayed (the 3 debug messages containing confdir, I checked that) is not valid UTF-8
- The above points are compliant (if that's the word) with the GLib spec, which states that the G_OPTION_ARG_FILENAME options are in the GLib filename encoding, and that is locale under POSIX, not UTF-8.

It seems to me then that the proper fix will be (a) not to convert app->configdir to locale, and (b) use an UTF-8 converted string for geany_debug(). I tried that, and it works on my system (bg_BG). So my questions are:

- Which way should I fix alternate_config being freed? Can you provide an example when converting app->configdir to locale makes sense?
- If I'm to fix it by not converting app->confdir to locale, should I also include a fix for the Debug Messages?..

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/653#issuecomment-139356214
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20150910/7a04f8b3/attachment.html>


More information about the Github-comments mailing list