mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Renamed global variable mc_home_alt into mc_main_sharedata_dir
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
0046dbc336
commit
62e4ab5d92
@ -901,7 +901,7 @@ edit_load_syntax_file (WEdit * edit)
|
||||
extdir = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
|
||||
if (!exist_file(extdir)) {
|
||||
g_free (extdir);
|
||||
extdir = concat_dir_and_file (mc_home_alt, "syntax" PATH_SEP_STR "Syntax");
|
||||
extdir = concat_dir_and_file (mc_main_sharedata_dir, "syntax" PATH_SEP_STR "Syntax");
|
||||
}
|
||||
|
||||
if (dir == 0) {
|
||||
@ -934,7 +934,7 @@ edit_load_menu_file (WEdit * edit)
|
||||
|
||||
if (!exist_file (menufile)) {
|
||||
g_free (menufile);
|
||||
menufile = concat_dir_and_file (mc_home_alt, EDIT_GLOBAL_MENU);
|
||||
menufile = concat_dir_and_file (mc_main_sharedata_dir, EDIT_GLOBAL_MENU);
|
||||
}
|
||||
|
||||
switch (dir) {
|
||||
@ -953,7 +953,7 @@ edit_load_menu_file (WEdit * edit)
|
||||
buffer = concat_dir_and_file (mc_home, EDIT_GLOBAL_MENU);
|
||||
if (!exist_file (buffer)) {
|
||||
g_free (buffer);
|
||||
buffer = concat_dir_and_file (mc_home_alt, EDIT_GLOBAL_MENU);
|
||||
buffer = concat_dir_and_file (mc_main_sharedata_dir, EDIT_GLOBAL_MENU);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2137,7 +2137,7 @@ edit_block_process_cmd (WEdit *edit, const char *shell_cmd, int block)
|
||||
goto edit_block_process_cmd__EXIT;
|
||||
}
|
||||
if (!(script_src = fopen (o, "r"))) {
|
||||
o = g_strconcat (mc_home_alt, shell_cmd, (char *) NULL);
|
||||
o = g_strconcat (mc_main_sharedata_dir, shell_cmd, (char *) NULL);
|
||||
if (!(script_src = fopen (o, "r"))) {
|
||||
fclose (script_home);
|
||||
unlink (h);
|
||||
|
@ -698,7 +698,7 @@ static FILE *open_include_file (const char *filename)
|
||||
return f;
|
||||
}
|
||||
g_free (error_file_name);
|
||||
error_file_name = g_strconcat (mc_home_alt, PATH_SEP_STR "syntax" PATH_SEP_STR,
|
||||
error_file_name = g_strconcat (mc_main_sharedata_dir, PATH_SEP_STR "syntax" PATH_SEP_STR,
|
||||
filename, (char *) NULL);
|
||||
|
||||
return fopen (error_file_name, "r");
|
||||
|
@ -39,7 +39,7 @@
|
||||
extern int reset_hp_softkeys;
|
||||
|
||||
extern char *mc_home;
|
||||
extern char *mc_home_alt;
|
||||
extern char *mc_main_sharedata_dir;
|
||||
|
||||
/* colors specified on the command line: they override any other setting */
|
||||
extern char *command_line_colors;
|
||||
@ -380,7 +380,7 @@ mc_args_process(void)
|
||||
return FALSE;
|
||||
}
|
||||
if (mc_args__show_datadirs){
|
||||
printf ("%s (%s)\n", mc_home, mc_home_alt);
|
||||
printf ("%s (%s)\n", mc_home, mc_main_sharedata_dir);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ load_codepages_list (void)
|
||||
fprintf (stderr, _("Warning: file %s not found\n"), fname);
|
||||
g_free (fname);
|
||||
|
||||
fname = concat_dir_and_file (mc_home_alt, CHARSETS_INDEX);
|
||||
fname = concat_dir_and_file (mc_main_sharedata_dir, CHARSETS_INDEX);
|
||||
if (!(f = fopen (fname, "r"))) {
|
||||
fprintf (stderr, _("Warning: file %s not found\n"), fname);
|
||||
g_free (fname);
|
||||
|
@ -608,7 +608,7 @@ void ext_cmd (void)
|
||||
} else if (dir == 1) {
|
||||
if (!exist_file(extdir)) {
|
||||
g_free (extdir);
|
||||
extdir = concat_dir_and_file (mc_home_alt, MC_LIB_EXT);
|
||||
extdir = concat_dir_and_file (mc_main_sharedata_dir, MC_LIB_EXT);
|
||||
}
|
||||
do_edit (extdir);
|
||||
}
|
||||
@ -635,7 +635,7 @@ edit_mc_menu_cmd (void)
|
||||
|
||||
if (!exist_file(menufile)) {
|
||||
g_free (menufile);
|
||||
menufile = concat_dir_and_file (mc_home_alt, MC_GLOBAL_MENU);
|
||||
menufile = concat_dir_and_file (mc_main_sharedata_dir, MC_GLOBAL_MENU);
|
||||
}
|
||||
|
||||
switch (dir) {
|
||||
@ -654,7 +654,7 @@ edit_mc_menu_cmd (void)
|
||||
buffer = concat_dir_and_file (mc_home, MC_GLOBAL_MENU);
|
||||
if (!exist_file(buffer)) {
|
||||
g_free (buffer);
|
||||
buffer = concat_dir_and_file (mc_home_alt, MC_GLOBAL_MENU);
|
||||
buffer = concat_dir_and_file (mc_main_sharedata_dir, MC_GLOBAL_MENU);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -456,7 +456,7 @@ regex_command (const char *filename, const char *action, int *move_dir)
|
||||
extension_file = concat_dir_and_file (mc_home, MC_LIB_EXT);
|
||||
if (!exist_file (extension_file)) {
|
||||
g_free (extension_file);
|
||||
extension_file = concat_dir_and_file (mc_home_alt, MC_LIB_EXT);
|
||||
extension_file = concat_dir_and_file (mc_main_sharedata_dir, MC_LIB_EXT);
|
||||
}
|
||||
mc_user_ext = 0;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ mc_fhl_init_from_standart_files (mc_fhl_t * fhl)
|
||||
gchar *user_mc_dir;
|
||||
|
||||
/* ${datadir}/mc/filehighlight.ini */
|
||||
name = concat_dir_and_file (mc_home_alt, MC_FHL_INI_FILE);
|
||||
name = concat_dir_and_file (mc_main_sharedata_dir, MC_FHL_INI_FILE);
|
||||
if (exist_file (name) && (!mc_fhl_read_ini_file (fhl, name))) {
|
||||
g_free (name);
|
||||
return FALSE;
|
||||
|
10
src/main.c
10
src/main.c
@ -292,8 +292,8 @@ char *shell = NULL;
|
||||
/* mc_home: The home of MC - /etc/mc or defined by MC_DATADIR */
|
||||
char *mc_home = NULL;
|
||||
|
||||
/* mc_home_alt: Alternative home of MC - deprecated /usr/share/mc */
|
||||
char *mc_home_alt = NULL;
|
||||
/* mc_main_sharedata_dir: Alternative home of MC - deprecated /usr/share/mc */
|
||||
char *mc_main_sharedata_dir = NULL;
|
||||
|
||||
char cmd_buf[512];
|
||||
|
||||
@ -1881,10 +1881,10 @@ OS_Setup (void)
|
||||
mc_libdir = getenv ("MC_DATADIR");
|
||||
if (mc_libdir != NULL) {
|
||||
mc_home = g_strdup (mc_libdir);
|
||||
mc_home_alt = g_strdup (SYSCONFDIR);
|
||||
mc_main_sharedata_dir = g_strdup (SYSCONFDIR);
|
||||
} else {
|
||||
mc_home = g_strdup (SYSCONFDIR);
|
||||
mc_home_alt = g_strdup (DATADIR);
|
||||
mc_main_sharedata_dir = g_strdup (DATADIR);
|
||||
}
|
||||
|
||||
/* This variable is used by the subshell */
|
||||
@ -2212,7 +2212,7 @@ main (int argc, char *argv[])
|
||||
}
|
||||
g_free (last_wd_string);
|
||||
|
||||
g_free (mc_home_alt);
|
||||
g_free (mc_main_sharedata_dir);
|
||||
g_free (mc_home);
|
||||
g_free (shell);
|
||||
|
||||
|
@ -108,7 +108,7 @@ void print_vfs_message(const char *msg, ...)
|
||||
extern const char *prompt;
|
||||
extern const char *edit_one_file;
|
||||
extern char *mc_home;
|
||||
extern char *mc_home_alt;
|
||||
extern char *mc_main_sharedata_dir;
|
||||
|
||||
struct mc_fhl_struct;
|
||||
extern struct mc_fhl_struct *mc_filehighlight;
|
||||
|
15
src/setup.c
15
src/setup.c
@ -571,8 +571,7 @@ load_setup_get_full_config_name(const char *subdir, const char *config_file_name
|
||||
{
|
||||
/*
|
||||
TODO: IMHO, in future this function must be placed into mc_config module.
|
||||
Also, need to rename stupid mc_home and mc_home_alt to mc_sysconfdir and mc_datadir;
|
||||
home_mc => mc_user_homedir
|
||||
Also, need to rename stupid home_mc => mc_user_homedir
|
||||
*/
|
||||
char *basename, *ret;
|
||||
|
||||
@ -612,9 +611,9 @@ load_setup_get_full_config_name(const char *subdir, const char *config_file_name
|
||||
g_free(ret);
|
||||
|
||||
if (subdir)
|
||||
ret = g_build_filename (mc_home_alt, subdir, basename, NULL);
|
||||
ret = g_build_filename (mc_main_sharedata_dir, subdir, basename, NULL);
|
||||
else
|
||||
ret = g_build_filename (mc_home_alt, basename, NULL);
|
||||
ret = g_build_filename (mc_main_sharedata_dir, basename, NULL);
|
||||
|
||||
if (exist_file(ret)) {
|
||||
g_free(basename);
|
||||
@ -657,8 +656,8 @@ load_setup_get_keymap_profile_config(void)
|
||||
|
||||
char *fname, *fname2;
|
||||
|
||||
/* 1) /usr/share/mc (mc_home_alt) */
|
||||
fname = g_build_filename (mc_home_alt, GLOBAL_KEYMAP_FILE, NULL);
|
||||
/* 1) /usr/share/mc (mc_main_sharedata_dir) */
|
||||
fname = g_build_filename (mc_main_sharedata_dir, GLOBAL_KEYMAP_FILE, NULL);
|
||||
load_setup_init_config_from_file( &keymap_config, fname);
|
||||
g_free(fname);
|
||||
|
||||
@ -719,7 +718,7 @@ setup_init (void)
|
||||
profile = inifile;
|
||||
} else {
|
||||
g_free (inifile);
|
||||
inifile = concat_dir_and_file (mc_home_alt, "mc.ini");
|
||||
inifile = concat_dir_and_file (mc_main_sharedata_dir, "mc.ini");
|
||||
if (exist_file (inifile)) {
|
||||
g_free (profile);
|
||||
profile = inifile;
|
||||
@ -747,7 +746,7 @@ load_setup (void)
|
||||
global_profile_name = concat_dir_and_file (mc_home, "mc.lib");
|
||||
if (!exist_file(global_profile_name)) {
|
||||
g_free (global_profile_name);
|
||||
global_profile_name = concat_dir_and_file (mc_home_alt, "mc.lib");
|
||||
global_profile_name = concat_dir_and_file (mc_main_sharedata_dir, "mc.lib");
|
||||
}
|
||||
|
||||
panels_profile_name = concat_dir_and_file (home_dir, PANELS_PROFILE_NAME);
|
||||
|
@ -103,7 +103,7 @@ mc_skin_ini_file_load (mc_skin_t * mc_skin)
|
||||
return TRUE;
|
||||
|
||||
/* /usr/share/mc/skins/ */
|
||||
return mc_skin_ini_file_load_search_in_dir (mc_skin, mc_home_alt);
|
||||
return mc_skin_ini_file_load_search_in_dir (mc_skin, mc_main_sharedata_dir);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -767,7 +767,7 @@ user_menu_cmd (WEdit *edit_widget)
|
||||
if (!exist_file (menu)) {
|
||||
g_free (menu);
|
||||
menu = concat_dir_and_file
|
||||
(mc_home_alt, edit_widget ? EDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
(mc_main_sharedata_dir, edit_widget ? EDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ load_mc_home_file (const char *filename, char **allocated_filename)
|
||||
if (!data) {
|
||||
g_free (hintfile);
|
||||
g_free (hintfile_base);
|
||||
hintfile_base = concat_dir_and_file (mc_home_alt, filename);
|
||||
hintfile_base = concat_dir_and_file (mc_main_sharedata_dir, filename);
|
||||
|
||||
hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
|
||||
data = load_file (hintfile);
|
||||
|
@ -257,7 +257,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc)
|
||||
tmp = name_quote (name, 0);
|
||||
}
|
||||
|
||||
mc_extfsdir = concat_dir_and_file (mc_home_alt, "extfs" PATH_SEP_STR);
|
||||
mc_extfsdir = concat_dir_and_file (mc_main_sharedata_dir, "extfs" PATH_SEP_STR);
|
||||
cmd =
|
||||
g_strconcat (mc_extfsdir, extfs_prefixes[fstype], " list ",
|
||||
local_name ? local_name : tmp, (char *) NULL);
|
||||
@ -632,7 +632,7 @@ extfs_cmd (const char *extfs_cmd, struct archive *archive,
|
||||
archive_name = name_quote (extfs_get_archive_name (archive), 0);
|
||||
quoted_localname = name_quote (localname, 0);
|
||||
|
||||
mc_extfsdir = concat_dir_and_file (mc_home_alt, "extfs" PATH_SEP_STR);
|
||||
mc_extfsdir = concat_dir_and_file (mc_main_sharedata_dir, "extfs" PATH_SEP_STR);
|
||||
cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype],
|
||||
extfs_cmd, archive_name, " ", quoted_file, " ",
|
||||
quoted_localname, (char *) NULL);
|
||||
@ -661,7 +661,7 @@ extfs_run (struct vfs_class *me, const char *file)
|
||||
g_free (p);
|
||||
|
||||
archive_name = name_quote (extfs_get_archive_name (archive), 0);
|
||||
mc_extfsdir = concat_dir_and_file (mc_home_alt, "extfs" PATH_SEP_STR);
|
||||
mc_extfsdir = concat_dir_and_file (mc_main_sharedata_dir, "extfs" PATH_SEP_STR);
|
||||
cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype],
|
||||
" run ", archive_name, " ", q, (char *) NULL);
|
||||
g_free (mc_extfsdir);
|
||||
|
Loading…
Reference in New Issue
Block a user