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 | |
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)
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | main.cpp | 12 |
2 files changed, 11 insertions, 5 deletions
@@ -48,11 +48,11 @@ SciTECO has the following build and runtime dependencies: 1. Build Scintilla as described in its README. If you want to build the ncurses version, install Scinterm from a subdirectory of Scintilla called "scinterm". -2. Untar/unzip SciTECO into a subdirectory of Scintilla. +2. Untar/unzip/check-out SciTECO into a subdirectory of Scintilla. 3. Build with `make INTERFACE=GTK` or `make INTERFACE=NCURSES` respectively. 3. Install with `make install`. 4. You are recommended to use the included "teco.ini" as a starting point for your profile, - so copy it to "~/.config/.teco_ini". The default teco.ini opens files specified on the + so copy it to "~/.teco_ini". The default "teco.ini" opens files specified on the commandline for you, uses a file open hook to configure syntax highlighting (only C/C++ and Makefiles for now) and enables line numbers. @@ -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); |