diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 22:52:43 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 22:52:43 +0100 |
commit | 4c1509ebf6f71c2330e25936d416b4bed44073b1 (patch) | |
tree | 881306e81f41b0ad155d4dbdb56649b1dd61b79f /main.cpp | |
parent | 8f6cd838d024da0e862ee1b0e304c1adab6fc4a0 (diff) | |
download | sciteco-4c1509ebf6f71c2330e25936d416b4bed44073b1.tar.gz |
on UNIX, look for teco.ini in HOME directory instead of the system's config directory
* on Windows, it might still be a good idea to use the "config" directory (have to test it)
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -83,13 +83,19 @@ process_options(int &argc, char **&argv) if (mung_file) { if (!g_file_test(mung_file, G_FILE_TEST_IS_REGULAR)) { - g_printf("Cannot mung %s. File does not exist!\n", + g_printf("Cannot mung \"%s\". File does not exist!\n", mung_file); exit(EXIT_FAILURE); } } else { - mung_file = g_build_filename(g_get_user_config_dir(), - INI_FILE, NULL); + const gchar *home; + +#ifdef G_OS_UNIX + home = g_get_home_dir(); +#else + home = g_get_user_config_dir(); +#endif + mung_file = g_build_filename(home, INI_FILE, NULL); } interface.parse_args(argc, argv); |