- update to mc-4.6.2 release

- drop .8bit-hex, .preserveattrs, .cloexec, .7zip and part of
    .utf8-look-and-feel patch, applied upstream
- sync the rest of patches, adopt upstream version of UTF8 patch
- update URL and source links
- add required BR
This commit is contained in:
Jindrich Novy 2009-05-27 05:49:13 +00:00
parent a08eb5153f
commit 63def9a2fa
15 changed files with 3489 additions and 2179 deletions

View File

@ -1 +1 @@
mc-4.6.2-pre1.tar.gz mc-4.6.2.tar.gz

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
diff -ru mc-4.6.2-pre1/vfs/extfs/u7z mc-4.6.2-pre1_u7z/vfs/extfs/u7z
--- mc-4.6.2-pre1/vfs/extfs/u7z 2005-06-22 06:21:43.000000000 +0400
+++ mc-4.6.2-pre1_u7z/vfs/extfs/u7z 2008-06-19 08:49:05.000000000 +0400
@@ -47,8 +47,8 @@
}
# override any locale for dates
-LC_ALL=C
-export LC_ALL
+LC_DATE=C
+export LC_DATE
umask 077
@@ -56,7 +56,7 @@
shift
case "$cmd" in
- list) mcu7zip_list "$@" ;;
+ list) mcu7zip_list "$@"|sort -k 8 ;;
copyout) mcu7zip_copyout "$@" ;;
copyin) mcu7zip_copyin "$@" ;;
mkdir) mcu7zip_mkdir "$@" ;;

View File

@ -1,18 +0,0 @@
--- mc-2006-11-14-16/src/subshell.c.desleak 2006-05-08 22:59:48.000000000 +0200
+++ mc-2006-11-14-16/src/subshell.c 2006-11-23 09:50:30.000000000 +0100
@@ -1150,6 +1152,7 @@
#endif /* I_FIND && I_PUSH */
#endif /* __osf__ || __linux__ */
+ fcntl(pty_slave, F_SETFD, FD_CLOEXEC);
return pty_slave;
}
@@ -1203,6 +1207,7 @@
}
if ((pty_slave = open (pty_name, O_RDWR)) == -1)
fprintf (stderr, "open (pty_name, O_RDWR): %s\r\n", pty_name);
+ fcntl(pty_slave, F_SETFD, FD_CLOEXEC);
return pty_slave;
}

View File

@ -1,20 +0,0 @@
--- mc-4.6.1a/src/util.c.jn 2005-12-02 11:08:26.000000000 +0100
+++ mc-4.6.1a/src/util.c 2005-12-02 13:11:19.000000000 +0100
@@ -1515,9 +1515,16 @@
/* If filename is NULL, then we just append PATH_SEP to the dir */
char *
-concat_dir_and_file (const char *dir, const char *file)
+concat_dir_and_file (const char *dir, const char *filename)
{
int i = strlen (dir);
+ const char *file = filename;
+
+ /* Return filename when dir is empty */
+ if (!i) return g_strdup (filename);
+
+ if (file != NULL && *file == PATH_SEP)
+ file++;
if (dir [i-1] == PATH_SEP)
return g_strconcat (dir, file, (char *) NULL);

View File

@ -1,6 +1,66 @@
--- mc-4.6.1a/src/charsets.c.etcmc 2005-05-27 05:35:15.000000000 +0200 diff -up mc-4.6.2/edit/editcmd.c.etcmc mc-4.6.2/edit/editcmd.c
+++ mc-4.6.1a/src/charsets.c 2006-02-24 15:17:05.000000000 +0100 --- mc-4.6.2/edit/editcmd.c.etcmc 2009-05-26 18:05:21.000000000 +0200
@@ -45,12 +45,17 @@ load_codepages_list (void) +++ mc-4.6.2/edit/editcmd.c 2009-05-26 18:05:21.000000000 +0200
@@ -51,7 +51,7 @@
#include "../src/tty.h" /* LINES */
#include "../src/widget.h" /* listbox_new() */
#include "../src/layout.h" /* clr_scr() */
-#include "../src/main.h" /* mc_home */
+#include "../src/main.h" /* mc_home, mc_home_alt */
#include "../src/help.h" /* interactive_display() */
#include "../src/key.h" /* XCTRL */
#include "../src/dialog.h" /* do_refresh() */
@@ -2833,12 +2833,15 @@ edit_block_process_cmd (WEdit *edit, con
return;
}
if (!(script_src = fopen (o, "r"))) {
- fclose (script_home);
- unlink (h);
- edit_error_dialog ("", get_sys_error (catstrs
- (_("Error reading script:"),
- o, (char *) NULL)));
- return;
+ o = catstrs (mc_home_alt, shell_cmd, (char *) NULL);
+ if (!(script_src = fopen (o, "r"))) {
+ fclose (script_home);
+ unlink (h);
+ edit_error_dialog ("", get_sys_error (catstrs
+ (_("Error reading script:"),
+ o, (char *) NULL)));
+ return;
+ }
}
while (fgets (buf, sizeof (buf), script_src))
fputs (buf, script_home);
diff -up mc-4.6.2/edit/syntax.c.etcmc mc-4.6.2/edit/syntax.c
--- mc-4.6.2/edit/syntax.c.etcmc 2009-02-01 20:30:21.000000000 +0100
+++ mc-4.6.2/edit/syntax.c 2009-05-26 18:05:21.000000000 +0200
@@ -39,7 +39,7 @@
#include "edit.h"
#include "edit-widget.h"
#include "../src/color.h" /* use_colors */
-#include "../src/main.h" /* mc_home */
+#include "../src/main.h" /* mc_home, mc_home_alt */
#include "../src/wtools.h" /* message() */
/* bytes */
@@ -682,6 +682,12 @@ static FILE *open_include_file (const ch
g_free (error_file_name);
error_file_name = g_strconcat (mc_home, PATH_SEP_STR "syntax" PATH_SEP_STR,
filename, (char *) NULL);
+ if (!(f = fopen (error_file_name, "r"))) {
+ g_free (error_file_name);
+ error_file_name = g_strconcat (mc_home_alt, PATH_SEP_STR "syntax" PATH_SEP_STR,
+ filename, (char *) NULL);
+ } else return f;
+
return fopen (error_file_name, "r");
}
diff -up mc-4.6.2/src/charsets.c.etcmc mc-4.6.2/src/charsets.c
--- mc-4.6.2/src/charsets.c.etcmc 2009-05-26 18:05:21.000000000 +0200
+++ mc-4.6.2/src/charsets.c 2009-05-26 18:05:21.000000000 +0200
@@ -47,12 +47,17 @@ load_codepages_list (void)
char *fname; char *fname;
char buf[256]; char buf[256];
extern char *mc_home; extern char *mc_home;
@ -8,20 +68,130 @@
extern int display_codepage; extern int display_codepage;
char *default_codepage = NULL; char *default_codepage = NULL;
fname = concat_dir_and_file (mc_home, CHARSETS_INDEX); fname = mhl_str_dir_plus_file (mc_home, CHARSETS_INDEX);
if (!(f = fopen (fname, "r"))) { if (!(f = fopen (fname, "r"))) {
- fprintf (stderr, _("Warning: file %s not found\n"), fname); - fprintf (stderr, _("Warning: file %s not found\n"), fname);
+ g_free (fname); + g_free (fname);
+ fname = concat_dir_and_file (mc_home_alt, CHARSETS_INDEX); + fname = mhl_str_dir_plus_file (mc_home_alt, CHARSETS_INDEX);
+ if (!(f = fopen (fname, "r"))) { + if (!(f = fopen (fname, "r"))) {
+ fprintf (stderr, _("Warning: file %s not found\n"), fname); + fprintf (stderr, _("Warning: file %s not found\n"), fname);
+ } + }
g_free (fname); g_free (fname);
return -1; return -1;
} }
--- mc-4.6.1a/src/main.h.etcmc 2006-02-24 15:17:05.000000000 +0100 diff -up mc-4.6.2/src/cmd.c.etcmc mc-4.6.2/src/cmd.c
+++ mc-4.6.1a/src/main.h 2006-02-24 15:17:05.000000000 +0100 --- mc-4.6.2/src/cmd.c.etcmc 2009-05-26 18:05:21.000000000 +0200
@@ -112,7 +112,7 @@ void print_vfs_message(const char *msg, +++ mc-4.6.2/src/cmd.c 2009-05-26 18:05:21.000000000 +0200
@@ -592,8 +592,13 @@ void ext_cmd (void)
check_for_default (extdir, buffer);
do_edit (buffer);
g_free (buffer);
- } else if (dir == 1)
+ } else if (dir == 1) {
+ if (!exist_file(extdir)) {
+ g_free (extdir);
+ extdir = mhl_str_dir_plus_file (mc_home_alt, MC_LIB_EXT);
+ }
do_edit (extdir);
+ }
g_free (extdir);
flush_extension_file ();
@@ -616,6 +621,11 @@ menu_edit_cmd (int where)
);
menufile = mhl_str_dir_plus_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+
+ if (!exist_file(menufile)) {
+ g_free (menufile);
+ menufile = mhl_str_dir_plus_file (mc_home_alt, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ }
switch (dir) {
case 0:
@@ -630,6 +640,10 @@ menu_edit_cmd (int where)
case 2:
buffer = mhl_str_dir_plus_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ if (!exist_file(buffer)) {
+ g_free (buffer);
+ buffer = mhl_str_dir_plus_file (mc_home_alt, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ }
break;
default:
@@ -688,7 +702,7 @@ edit_syntax_cmd (void)
_(" Which syntax file you want to edit? "), 0, 2,
_("&User"), _("&System Wide"));
}
- extdir = mhl_str_dir_plus_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
+ extdir = mhl_str_dir_plus_file (mc_home_alt, "syntax" PATH_SEP_STR "Syntax");
if (dir == 0) {
buffer = mhl_str_dir_plus_file (home_dir, SYNTAX_FILE);
diff -up mc-4.6.2/src/ext.c.etcmc mc-4.6.2/src/ext.c
--- mc-4.6.2/src/ext.c.etcmc 2009-02-01 20:30:21.000000000 +0100
+++ mc-4.6.2/src/ext.c 2009-05-26 18:05:21.000000000 +0200
@@ -446,6 +446,10 @@ regex_command (const char *filename, con
g_free (extension_file);
check_stock_mc_ext:
extension_file = mhl_str_dir_plus_file (mc_home, MC_LIB_EXT);
+ if (!exist_file (extension_file)) {
+ g_free (extension_file);
+ extension_file = mhl_str_dir_plus_file (mc_home_alt, MC_LIB_EXT);
+ }
mc_user_ext = 0;
}
data = load_file (extension_file);
diff -up mc-4.6.2/src/main.c.etcmc mc-4.6.2/src/main.c
--- mc-4.6.2/src/main.c.etcmc 2009-05-26 18:05:21.000000000 +0200
+++ mc-4.6.2/src/main.c 2009-05-26 18:07:07.000000000 +0200
@@ -291,9 +291,12 @@ char *xterm_title_str = NULL;
/* Is the LANG UTF-8 ? */
gboolean is_utf8 = FALSE;
-/* mc_home: The home of MC */
+/* 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;
+
char cmd_buf[512];
static void
@@ -1858,8 +1861,9 @@ OS_Setup (void)
if ((mc_libdir = getenv ("MC_DATADIR")) != NULL) {
mc_home = g_strdup (mc_libdir);
} else {
- mc_home = g_strdup (DATADIR);
+ mc_home = g_strdup (SYSCONFDIR);
}
+ mc_home_alt = mc_libdir != NULL ? g_strdup (SYSCONFDIR) : g_strdup (DATADIR);
}
static void
@@ -1989,7 +1993,7 @@ process_args (poptContext ctx, int c, co
break;
case 'f':
- printf ("%s\n", mc_home);
+ printf ("%s (%s)\n", mc_home, mc_home_alt);
exit (0);
break;
@@ -2339,6 +2343,7 @@ main (int argc, char *argv[])
}
g_free (last_wd_string);
+ g_free (mc_home_alt);
g_free (mc_home);
done_key ();
#ifdef HAVE_CHARSET
diff -up mc-4.6.2/src/main.h.etcmc mc-4.6.2/src/main.h
--- mc-4.6.2/src/main.h.etcmc 2009-05-26 18:05:21.000000000 +0200
+++ mc-4.6.2/src/main.h 2009-05-26 18:05:21.000000000 +0200
@@ -114,7 +114,7 @@ void print_vfs_message(const char *msg,
extern const char *prompt; extern const char *prompt;
extern const char *edit_one_file; extern const char *edit_one_file;
@ -30,52 +200,9 @@
char *get_mc_lib_dir (void); char *get_mc_lib_dir (void);
int maybe_cd (int move_up_dir); int maybe_cd (int move_up_dir);
--- mc-4.6.1a/src/ext.c.etcmc 2005-07-31 22:29:35.000000000 +0200 diff -up mc-4.6.2/src/Makefile.am.etcmc mc-4.6.2/src/Makefile.am
+++ mc-4.6.1a/src/ext.c 2006-02-24 15:17:05.000000000 +0100 --- mc-4.6.2/src/Makefile.am.etcmc 2009-05-26 18:05:21.000000000 +0200
@@ -444,6 +444,10 @@ regex_command (const char *filename, con +++ mc-4.6.2/src/Makefile.am 2009-05-26 18:05:21.000000000 +0200
g_free (extension_file);
check_stock_mc_ext:
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);
+ }
mc_user_ext = 0;
}
data = load_file (extension_file);
--- mc-4.6.1a/src/setup.c.etcmc 2006-01-29 21:26:05.000000000 +0100
+++ mc-4.6.1a/src/setup.c 2006-02-24 15:17:05.000000000 +0100
@@ -481,8 +481,15 @@ setup_init (void)
if (exist_file (inifile)){
g_free (profile);
profile = inifile;
- } else
+ } else {
g_free (inifile);
+ inifile = concat_dir_and_file (mc_home_alt, "mc.ini");
+ if (exist_file (inifile)) {
+ g_free (profile);
+ profile = inifile;
+ } else
+ g_free (inifile);
+ }
}
profile_name = profile;
@@ -501,6 +508,11 @@ load_setup (void)
/* mc.lib is common for all users, but has priority lower than
~/.mc/ini. FIXME: it's only used for keys and treestore now */
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");
+ }
/* Load integer boolean options */
for (i = 0; int_options[i].opt_name; i++)
--- mc-4.6.1a/src/Makefile.am.etcmc 2006-02-04 12:13:30.000000000 +0100
+++ mc-4.6.1a/src/Makefile.am 2006-02-24 15:17:05.000000000 +0100
@@ -8,9 +8,11 @@ bin_PROGRAMS = mc mcmfmt @@ -8,9 +8,11 @@ bin_PROGRAMS = mc mcmfmt
if CONS_SAVER if CONS_SAVER
pkglibexec_PROGRAMS = cons.saver pkglibexec_PROGRAMS = cons.saver
@ -90,9 +217,72 @@
endif endif
noinst_PROGRAMS = man2hlp noinst_PROGRAMS = man2hlp
--- mc-4.6.1a/src/util.c.etcmc 2006-02-24 15:17:05.000000000 +0100 diff -up mc-4.6.2/src/Makefile.in.etcmc mc-4.6.2/src/Makefile.in
+++ mc-4.6.1a/src/util.c 2006-02-24 15:17:05.000000000 +0100 --- mc-4.6.2/src/Makefile.in.etcmc 2009-02-01 20:46:26.000000000 +0100
@@ -40,7 +40,7 @@ +++ mc-4.6.2/src/Makefile.in 2009-05-26 18:09:15.000000000 +0200
@@ -294,9 +294,8 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
pkglibexecdir = $(libexecdir)/@PACKAGE@
-@CONS_SAVER_FALSE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"
-@CONS_SAVER_TRUE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
-@CONS_SAVER_TRUE@ -DSAVERDIR=\""$(pkglibexecdir)"\"
+@CONS_SAVER_FALSE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
+@CONS_SAVER_TRUE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" -DSAVERDIR=\""$(pkglibexecdir)"\" -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
man2hlp_LDADD = $(GLIB_LIBS)
mcmfmt_SOURCES = mfmt.c
diff -up mc-4.6.2/src/setup.c.etcmc mc-4.6.2/src/setup.c
--- mc-4.6.2/src/setup.c.etcmc 2009-05-26 18:05:21.000000000 +0200
+++ mc-4.6.2/src/setup.c 2009-05-26 18:05:21.000000000 +0200
@@ -522,8 +522,15 @@ setup_init (void)
if (exist_file (inifile)){
g_free (profile);
profile = inifile;
- } else
+ } else {
g_free (inifile);
+ inifile = mhl_str_dir_plus_file (mc_home_alt, "mc.ini");
+ if (exist_file (inifile)) {
+ g_free (profile);
+ profile = inifile;
+ } else
+ g_free (inifile);
+ }
}
profile_name = profile;
@@ -542,6 +549,11 @@ load_setup (void)
/* mc.lib is common for all users, but has priority lower than
~/.mc/ini. FIXME: it's only used for keys and treestore now */
global_profile_name = mhl_str_dir_plus_file (mc_home, "mc.lib");
+
+ if (!exist_file(global_profile_name)) {
+ g_free (global_profile_name);
+ global_profile_name = mhl_str_dir_plus_file (mc_home_alt, "mc.lib");
+ }
/* Load integer boolean options */
for (i = 0; int_options[i].opt_name; i++)
diff -up mc-4.6.2/src/user.c.etcmc mc-4.6.2/src/user.c
--- mc-4.6.2/src/user.c.etcmc 2009-02-01 20:30:21.000000000 +0100
+++ mc-4.6.2/src/user.c 2009-05-26 18:05:21.000000000 +0200
@@ -729,6 +729,11 @@ user_menu_cmd (struct WEdit *edit_widget
g_free (menu);
menu = mhl_str_dir_plus_file \
(mc_home, edit_widget ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ if (!exist_file (menu)) {
+ g_free (menu);
+ menu = mhl_str_dir_plus_file \
+ (mc_home_alt, edit_widget ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ }
}
}
diff -up mc-4.6.2/src/util.c.etcmc mc-4.6.2/src/util.c
--- mc-4.6.2/src/util.c.etcmc 2009-05-26 18:05:21.000000000 +0200
+++ mc-4.6.2/src/util.c 2009-05-26 18:05:21.000000000 +0200
@@ -44,7 +44,7 @@
#include "tty.h" #include "tty.h"
#include "global.h" #include "global.h"
#include "profile.h" #include "profile.h"
@ -101,7 +291,7 @@
#include "cmd.h" /* guess_message_value */ #include "cmd.h" /* guess_message_value */
#include "mountlist.h" #include "mountlist.h"
#include "win.h" /* xterm_flag */ #include "win.h" /* xterm_flag */
@@ -950,16 +950,25 @@ load_mc_home_file (const char *filename, @@ -978,16 +978,25 @@ load_mc_home_file (const char *filename,
if (!data) { if (!data) {
g_free (hintfile); g_free (hintfile);
@ -110,7 +300,7 @@
- lang[2] = 0; - lang[2] = 0;
+ g_free (hintfile_base); + g_free (hintfile_base);
+ +
+ hintfile_base = concat_dir_and_file (mc_home_alt, filename); + hintfile_base = mhl_str_dir_plus_file (mc_home_alt, filename);
+ +
hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL); hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
data = load_file (hintfile); data = load_file (hintfile);
@ -134,211 +324,33 @@
} }
} }
--- mc-4.6.1a/src/cmd.c.etcmc 2006-02-04 12:12:28.000000000 +0100 diff -up mc-4.6.2/vfs/extfs.c.etcmc mc-4.6.2/vfs/extfs.c
+++ mc-4.6.1a/src/cmd.c 2006-02-24 15:17:05.000000000 +0100 --- mc-4.6.2/vfs/extfs.c.etcmc 2009-02-01 20:30:21.000000000 +0100
@@ -570,8 +570,13 @@ void ext_cmd (void) +++ mc-4.6.2/vfs/extfs.c 2009-05-26 18:05:21.000000000 +0200
check_for_default (extdir, buffer); @@ -249,7 +249,7 @@ extfs_open_archive (int fstype, const ch
do_edit (buffer);
g_free (buffer);
- } else if (dir == 1)
+ } else if (dir == 1) {
+ if (!exist_file(extdir)) {
+ g_free (extdir);
+ extdir = concat_dir_and_file (mc_home_alt, MC_LIB_EXT);
+ }
do_edit (extdir);
+ }
g_free (extdir);
flush_extension_file ();
@@ -594,6 +599,11 @@ menu_edit_cmd (int where)
);
menufile = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+
+ if (!exist_file(menufile)) {
+ g_free (menufile);
+ menufile = concat_dir_and_file (mc_home_alt, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ }
switch (dir) {
case 0:
@@ -608,6 +618,10 @@ menu_edit_cmd (int where)
case 2:
buffer = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ if (!exist_file(buffer)) {
+ g_free (buffer);
+ buffer = concat_dir_and_file (mc_home_alt, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ }
break;
default:
@@ -666,7 +680,7 @@ edit_syntax_cmd (void)
_(" Which syntax file you want to edit? "), 0, 2,
_("&User"), _("&System Wide"));
}
- extdir = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
+ extdir = concat_dir_and_file (mc_home_alt, "syntax" PATH_SEP_STR "Syntax");
if (dir == 0) {
buffer = concat_dir_and_file (home_dir, SYNTAX_FILE);
--- mc-4.6.1a/src/main.c.etcmc 2006-02-24 15:17:05.000000000 +0100
+++ mc-4.6.1a/src/main.c 2006-02-24 15:17:05.000000000 +0100
@@ -282,9 +282,12 @@ gboolean is_utf8 = FALSE;
/* The xterm title */
char *xterm_title_str = NULL;
-/* mc_home: The home of MC */
+/* 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;
+
char cmd_buf[512];
static void
@@ -1817,8 +1820,9 @@ OS_Setup (void)
if ((mc_libdir = getenv ("MC_DATADIR")) != NULL) {
mc_home = g_strdup (mc_libdir);
} else {
- mc_home = g_strdup (DATADIR);
+ mc_home = g_strdup (SYSCONFDIR);
}
+ mc_home_alt = mc_libdir != NULL ? g_strdup (SYSCONFDIR) : g_strdup (DATADIR);
}
static void
@@ -1948,7 +1952,7 @@ process_args (poptContext ctx, int c, co
break;
case 'f':
- printf ("%s\n", mc_home);
+ printf ("%s (%s)\n", mc_home, mc_home_alt);
exit (0);
break;
@@ -2326,6 +2330,7 @@ main (int argc, char *argv[])
}
g_free (last_wd_string);
+ g_free (mc_home_alt);
g_free (mc_home);
done_key ();
#ifdef HAVE_CHARSET
--- mc-4.6.1a/src/Makefile.in.etcmc 2006-02-15 21:12:44.000000000 +0100
+++ mc-4.6.1a/src/Makefile.in 2006-02-24 15:17:05.000000000 +0100
@@ -314,9 +314,10 @@ target_alias = @target_alias@
AM_CFLAGS = $(GLIB_CFLAGS)
localedir = $(datadir)/locale
pkglibexecdir = $(libexecdir)/@PACKAGE@
-@CONS_SAVER_FALSE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"
+@CONS_SAVER_FALSE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
+@CONS_SAVER_FALSE@ -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
@CONS_SAVER_TRUE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
-@CONS_SAVER_TRUE@ -DSAVERDIR=\""$(pkglibexecdir)"\"
+@CONS_SAVER_TRUE@ -DSAVERDIR=\""$(pkglibexecdir)"\" -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
man2hlp_LDADD = $(GLIB_LIBS)
mcmfmt_SOURCES = mfmt.c
--- mc-4.6.1a/src/user.c.etcmc 2006-02-04 15:41:42.000000000 +0100
+++ mc-4.6.1a/src/user.c 2006-02-24 15:17:05.000000000 +0100
@@ -726,6 +726,11 @@ user_menu_cmd (struct WEdit *edit_widget
g_free (menu);
menu = concat_dir_and_file \
(mc_home, edit_widget ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ if (!exist_file (menu)) {
+ g_free (menu);
+ menu = concat_dir_and_file \
+ (mc_home_alt, edit_widget ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ }
}
}
--- mc-4.6.1a/edit/editcmd.c.etcmc 2006-02-24 15:17:05.000000000 +0100
+++ mc-4.6.1a/edit/editcmd.c 2006-02-24 15:17:05.000000000 +0100
@@ -49,7 +49,7 @@
#include "../src/tty.h" /* LINES */
#include "../src/widget.h" /* listbox_new() */
#include "../src/layout.h" /* clr_scr() */
-#include "../src/main.h" /* mc_home */
+#include "../src/main.h" /* mc_home, mc_home_alt */
#include "../src/help.h" /* interactive_display() */
#include "../src/key.h" /* XCTRL */
#include "../src/dialog.h" /* do_refresh() */
@@ -2790,12 +2790,15 @@ edit_block_process_cmd (WEdit *edit, con
return;
}
if (!(script_src = fopen (o, "r"))) {
- fclose (script_home);
- unlink (h);
- edit_error_dialog ("", get_sys_error (catstrs
- (_("Error reading script:"),
- o, (char *) NULL)));
- return;
+ o = catstrs (mc_home_alt, shell_cmd, (char *) NULL);
+ if (!(script_src = fopen (o, "r"))) {
+ fclose (script_home);
+ unlink (h);
+ edit_error_dialog ("", get_sys_error (catstrs
+ (_("Error reading script:"),
+ o, (char *) NULL)));
+ return;
+ }
}
while (fgets (buf, sizeof (buf), script_src))
fputs (buf, script_home);
--- mc-4.6.1a/edit/syntax.c.etcmc 2006-02-04 15:41:42.000000000 +0100
+++ mc-4.6.1a/edit/syntax.c 2006-02-24 15:17:05.000000000 +0100
@@ -37,7 +37,7 @@
#include "edit.h"
#include "edit-widget.h"
#include "../src/color.h" /* use_colors */
-#include "../src/main.h" /* mc_home */
+#include "../src/main.h" /* mc_home, mc_home_alt */
#include "../src/wtools.h" /* message() */
/* bytes */
@@ -680,6 +680,12 @@ static FILE *open_include_file (const ch
g_free (error_file_name);
error_file_name = g_strconcat (mc_home, PATH_SEP_STR "syntax" PATH_SEP_STR,
filename, (char *) NULL);
+ if (!(f = fopen (error_file_name, "r"))) {
+ g_free (error_file_name);
+ error_file_name = g_strconcat (mc_home_alt, PATH_SEP_STR "syntax" PATH_SEP_STR,
+ filename, (char *) NULL);
+ } else return f;
+
return fopen (error_file_name, "r");
}
--- mc-4.6.1a/vfs/extfs.c.etcmc 2005-09-05 02:52:57.000000000 +0200
+++ mc-4.6.1a/vfs/extfs.c 2006-02-24 15:22:16.000000000 +0100
@@ -242,7 +242,7 @@ extfs_open_archive (int fstype, const ch
tmp = name_quote (name, 0); tmp = name_quote (name, 0);
} }
- mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); - mc_extfsdir = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR);
+ mc_extfsdir = concat_dir_and_file (mc_home_alt, "extfs" PATH_SEP_STR); + mc_extfsdir = mhl_str_dir_plus_file (mc_home_alt, "extfs" PATH_SEP_STR);
cmd = cmd =
g_strconcat (mc_extfsdir, extfs_prefixes[fstype], " list ", g_strconcat (mc_extfsdir, extfs_prefixes[fstype], " list ",
local_name ? local_name : tmp, (char *) NULL); local_name ? local_name : tmp, (char *) NULL);
@@ -617,7 +617,7 @@ extfs_cmd (const char *extfs_cmd, struct @@ -624,7 +624,7 @@ extfs_cmd (const char *extfs_cmd, struct
archive_name = name_quote (extfs_get_archive_name (archive), 0); archive_name = name_quote (extfs_get_archive_name (archive), 0);
quoted_localname = name_quote (localname, 0); quoted_localname = name_quote (localname, 0);
- mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); - mc_extfsdir = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR);
+ mc_extfsdir = concat_dir_and_file (mc_home_alt, "extfs" PATH_SEP_STR); + mc_extfsdir = mhl_str_dir_plus_file (mc_home_alt, "extfs" PATH_SEP_STR);
cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype], cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype],
extfs_cmd, archive_name, " ", quoted_file, " ", extfs_cmd, archive_name, " ", quoted_file, " ",
quoted_localname, (char *) NULL); quoted_localname, (char *) NULL);
@@ -646,7 +646,7 @@ extfs_run (struct vfs_class *me, const c @@ -653,7 +653,7 @@ extfs_run (struct vfs_class *me, const c
g_free (p); g_free (p);
archive_name = name_quote (extfs_get_archive_name (archive), 0); archive_name = name_quote (extfs_get_archive_name (archive), 0);
- mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); - mc_extfsdir = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR);
+ mc_extfsdir = concat_dir_and_file (mc_home_alt, "extfs" PATH_SEP_STR); + mc_extfsdir = mhl_str_dir_plus_file (mc_home_alt, "extfs" PATH_SEP_STR);
cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype], cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype],
" run ", archive_name, " ", q, (char *) NULL); " run ", archive_name, " ", q, (char *) NULL);
g_free (mc_extfsdir); g_free (mc_extfsdir);

View File

@ -1,7 +1,7 @@
diff -up mc-4.6.2-pre1/configure.ac.extensions mc-4.6.2-pre1/configure.ac diff -up mc-4.6.2/configure.ac.extensions mc-4.6.2/configure.ac
--- mc-4.6.2-pre1/configure.ac.extensions 2007-09-10 16:25:30.000000000 +0200 --- mc-4.6.2/configure.ac.extensions 2009-02-01 20:30:21.000000000 +0100
+++ mc-4.6.2-pre1/configure.ac 2009-04-15 15:29:14.000000000 +0200 +++ mc-4.6.2/configure.ac 2009-05-26 14:42:48.000000000 +0200
@@ -83,7 +83,7 @@ AC_PROG_LN_S @@ -81,7 +81,7 @@ AC_PROG_LN_S
AC_CHECK_TOOL(AR, ar, ar) AC_CHECK_TOOL(AR, ar, ar)
dnl Only list browsers here that can be run in background (i.e. with `&') dnl Only list browsers here that can be run in background (i.e. with `&')
@ -10,10 +10,10 @@ diff -up mc-4.6.2-pre1/configure.ac.extensions mc-4.6.2-pre1/configure.ac
dnl dnl
dnl Ovverriding mmap support. This has to be before AC_FUNC_MMAP is used. dnl Ovverriding mmap support. This has to be before AC_FUNC_MMAP is used.
diff -up mc-4.6.2-pre1/configure.extensions mc-4.6.2-pre1/configure diff -up mc-4.6.2/configure.extensions mc-4.6.2/configure
--- mc-4.6.2-pre1/configure.extensions 2007-09-11 16:33:32.000000000 +0200 --- mc-4.6.2/configure.extensions 2009-02-01 20:46:23.000000000 +0100
+++ mc-4.6.2-pre1/configure 2009-04-15 15:29:14.000000000 +0200 +++ mc-4.6.2/configure 2009-05-26 14:42:48.000000000 +0200
@@ -5736,7 +5736,7 @@ else @@ -6843,7 +6843,7 @@ else
fi fi
@ -22,9 +22,9 @@ diff -up mc-4.6.2-pre1/configure.extensions mc-4.6.2-pre1/configure
do do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2 set dummy $ac_prog; ac_word=$2
diff -up mc-4.6.2-pre1/lib/mc.ext.in.extensions mc-4.6.2-pre1/lib/mc.ext.in diff -up mc-4.6.2/lib/mc.ext.in.extensions mc-4.6.2/lib/mc.ext.in
--- mc-4.6.2-pre1/lib/mc.ext.in.extensions 2006-12-28 04:57:01.000000000 +0100 --- mc-4.6.2/lib/mc.ext.in.extensions 2009-02-01 20:30:21.000000000 +0100
+++ mc-4.6.2-pre1/lib/mc.ext.in 2009-04-15 15:30:51.000000000 +0200 +++ mc-4.6.2/lib/mc.ext.in 2009-05-26 14:44:46.000000000 +0200
@@ -119,6 +119,11 @@ regex/\.t(ar\.bz2|bz|b2)$ @@ -119,6 +119,11 @@ regex/\.t(ar\.bz2|bz|b2)$
Open=%cd %p#utar Open=%cd %p#utar
View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf - View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
@ -177,23 +177,17 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.extensions mc-4.6.2-pre1/lib/mc.ext.in
### Video ### ### Video ###
@@ -395,20 +433,27 @@ regex/\.([mM][oO][vV]|[qQ][tT])$ @@ -389,6 +427,9 @@ regex/\.([aA][sS][fFxX])$
regex/\.([mM][pP]4|[mM][pP][eE]?[gG])$ regex/\.([dD][iI][vV][xX])$
Include=video Include=video
+regex/\.([mM][kK][vV])$ +regex/\.([mM][kK][vV])$
+ Include=video + Include=video
+ +
regex/\.([vV][oO][bB])$ regex/\.([mM][oO][vV]|[qQ][tT])$
Include=video Include=video
regex/\.([wW][mM][vV])$ @@ -408,10 +449,11 @@ regex/\.([oO][gG][mM])$
Include=video
+regex/\.([fF][lL][iIcC])$
+ Include=video
+
regex/\.([oO][gG][mM])$
Include=video Include=video
regex/\.([rR][aA]?[mM])$ regex/\.([rR][aA]?[mM])$
@ -206,7 +200,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.extensions mc-4.6.2-pre1/lib/mc.ext.in
#Open=(gtv %f >/dev/null 2>&1 &) #Open=(gtv %f >/dev/null 2>&1 &)
#Open=(xanim %f >/dev/null 2>&1 &) #Open=(xanim %f >/dev/null 2>&1 &)
@@ -417,12 +462,13 @@ include/video @@ -420,12 +462,13 @@ include/video
# Postscript # Postscript
type/^PostScript type/^PostScript
@ -222,7 +216,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.extensions mc-4.6.2-pre1/lib/mc.ext.in
#Open=(acroread %f &) #Open=(acroread %f &)
#Open=(ghostview %f &) #Open=(ghostview %f &)
View=%view{ascii} pdftotext %f - View=%view{ascii} pdftotext %f -
@@ -433,7 +479,7 @@ type/^PDF @@ -436,7 +479,7 @@ type/^PDF
# html # html
regex/\.([hH][tT][mM][lL]?)$ regex/\.([hH][tT][mM][lL]?)$
Open=(if test -n "@X11_WWW@" && test -n "$DISPLAY"; then (@X11_WWW@ file://%d/%p &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null Open=(if test -n "@X11_WWW@" && test -n "$DISPLAY"; then (@X11_WWW@ file://%d/%p &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null
@ -231,7 +225,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.extensions mc-4.6.2-pre1/lib/mc.ext.in
# StarOffice 5.2 # StarOffice 5.2
shell/.sdw shell/.sdw
@@ -450,22 +496,27 @@ shell/.abw @@ -453,22 +496,27 @@ shell/.abw
# Microsoft Word Document # Microsoft Word Document
regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$ regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
@ -264,7 +258,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.extensions mc-4.6.2-pre1/lib/mc.ext.in
View=%view{ascii} xls2csv %f || strings %f View=%view{ascii} xls2csv %f || strings %f
# Use OpenOffice.org to open any MS Office documents # Use OpenOffice.org to open any MS Office documents
@@ -542,6 +593,11 @@ type/^compress @@ -545,6 +593,11 @@ type/^compress
Open=gzip -dc %f | %var{PAGER:more} Open=gzip -dc %f | %var{PAGER:more}
View=%view{ascii} gzip -dc %f 2>/dev/null View=%view{ascii} gzip -dc %f 2>/dev/null

View File

@ -1,9 +1,10 @@
--- mc-2006-11-14-16/src/main.c.newlinedir 2006-11-20 14:54:21.000000000 +0100 diff -up mc-4.6.2/src/main.c.newlinedir mc-4.6.2/src/main.c
+++ mc-2006-11-14-16/src/main.c 2006-11-20 14:47:52.000000000 +0100 --- mc-4.6.2/src/main.c.newlinedir 2009-05-26 15:55:43.000000000 +0200
@@ -647,7 +647,7 @@ +++ mc-4.6.2/src/main.c 2009-05-26 15:56:47.000000000 +0200
} @@ -640,7 +640,7 @@ _do_panel_cd (WPanel *panel, const char
directory = *new_dir ? new_dir : home_dir; directory = *new_dir ? new_dir : home_dir;
ret_panel=panel;
- if (mc_chdir (directory) == -1) { - if (mc_chdir (directory) == -1) {
+ if (strchr(directory,'\n') || mc_chdir (directory) == -1) { + if (strchr(directory,'\n') || mc_chdir (directory) == -1) {
strcpy (panel->cwd, olddir); strcpy (panel->cwd, olddir);

View File

@ -1,12 +0,0 @@
diff -up mc-2007-06-04-22/src/file.c.preserveattr mc-2007-06-04-22/src/file.c
--- mc-2007-06-04-22/src/file.c.preserveattr 2007-11-14 14:45:23.000000000 +0100
+++ mc-2007-06-04-22/src/file.c 2007-11-14 14:45:23.000000000 +0100
@@ -800,7 +800,7 @@ copy_file_file (FileOpContext *ctx, cons
}
}
- if (!appending) {
+ if (!appending && ctx->preserve) {
while (mc_chmod (dst_path, (src_mode & ctx->umask_kill))) {
temp_status = file_error (
_(" Cannot chmod target file \"%s\" \n %s "), dst_path);

View File

@ -1,16 +1,186 @@
--- mc-2007-01-24-03/src/setup.c.showfree 2006-02-23 16:45:06.000000000 +0100 diff -up mc-4.6.2/src/layout.c.showfree mc-4.6.2/src/layout.c
+++ mc-2007-01-24-03/src/setup.c 2007-02-15 09:53:48.000000000 +0100 --- mc-4.6.2/src/layout.c.showfree 2009-05-26 14:57:36.000000000 +0200
@@ -134,6 +134,7 @@ +++ mc-4.6.2/src/layout.c 2009-05-26 14:57:36.000000000 +0200
{ "show_mini_info", &show_mini_info }, @@ -97,6 +97,9 @@ int message_visible = 1;
{ "permission_mode", &permission_mode }, /* Set to show current working dir in xterm window title */
{ "filetype_mode", &filetype_mode }, int xterm_title = 1;
+ { "free_space", &free_space },
{ 0, 0 }
};
--- mc-2007-01-24-03/src/main.c.showfree 2007-02-15 09:53:48.000000000 +0100 +/* Set to show free space on device assigned to current directory */
+++ mc-2007-01-24-03/src/main.c 2007-02-15 09:53:48.000000000 +0100 +int free_space = 1;
@@ -61,6 +61,7 @@ +
/* The starting line for the output of the subprogram */
int output_start_y = 0;
@@ -126,6 +129,7 @@ static int _command_prompt;
static int _keybar_visible;
static int _message_visible;
static int _xterm_title;
+static int _free_space;
static int _permission_mode;
static int _filetype_mode;
@@ -156,6 +160,7 @@ static struct {
int *variable;
WCheck *widget;
} check_options [] = {
+ { N_("show free sp&Ace"), &free_space, 0 },
{ N_("&Xterm window title"), &xterm_title, 0 },
{ N_("h&Intbar visible"), &message_visible, 0 },
{ N_("&Keybar visible"), &keybar_visible, 0 },
@@ -227,8 +232,8 @@ static int b2left_cback (int action)
if (_equal_split){
/* Turn equal split off */
_equal_split = 0;
- check_options [6].widget->state = check_options [6].widget->state & ~C_BOOL;
- dlg_select_widget (check_options [6].widget);
+ check_options [7].widget->state = check_options [7].widget->state & ~C_BOOL;
+ dlg_select_widget (check_options [7].widget);
dlg_select_widget (bleft_widget);
}
_first_panel_size++;
@@ -242,8 +247,8 @@ static int b2right_cback (int action)
if (_equal_split){
/* Turn equal split off */
_equal_split = 0;
- check_options [6].widget->state = check_options [6].widget->state & ~C_BOOL;
- dlg_select_widget (check_options [6].widget);
+ check_options [7].widget->state = check_options [7].widget->state & ~C_BOOL;
+ dlg_select_widget (check_options [7].widget);
dlg_select_widget (bright_widget);
}
_first_panel_size--;
@@ -289,23 +294,24 @@ layout_callback (struct Dlg_head *h, dlg
if (old_output_lines != _output_lines){
old_output_lines = _output_lines;
attrset (COLOR_NORMAL);
- dlg_move (h, 9, 16 + first_width);
+ dlg_move (h, 10, 16 + first_width);
addstr (output_lines_label);
- dlg_move (h, 9, 10 + first_width);
+ dlg_move (h, 10, 10 + first_width);
tty_printf ("%02d", _output_lines);
}
}
return MSG_HANDLED;
case DLG_POST_KEY:
- _filetype_mode = check_options [8].widget->state & C_BOOL;
- _permission_mode = check_options [7].widget->state & C_BOOL;
- _equal_split = check_options [6].widget->state & C_BOOL;
- _menubar_visible = check_options [5].widget->state & C_BOOL;
- _command_prompt = check_options [4].widget->state & C_BOOL;
- _keybar_visible = check_options [2].widget->state & C_BOOL;
- _message_visible = check_options [1].widget->state & C_BOOL;
- _xterm_title = check_options [0].widget->state & C_BOOL;
+ _filetype_mode = check_options [9].widget->state & C_BOOL;
+ _permission_mode = check_options [8].widget->state & C_BOOL;
+ _equal_split = check_options [7].widget->state & C_BOOL;
+ _menubar_visible = check_options [6].widget->state & C_BOOL;
+ _command_prompt = check_options [5].widget->state & C_BOOL;
+ _keybar_visible = check_options [3].widget->state & C_BOOL;
+ _message_visible = check_options [2].widget->state & C_BOOL;
+ _xterm_title = check_options [1].widget->state & C_BOOL;
+ _free_space = check_options [0].widget->state & C_BOOL;
if (console_flag){
int minimum;
if (_output_lines < 0)
@@ -333,7 +339,7 @@ layout_callback (struct Dlg_head *h, dlg
if (old_output_lines != _output_lines){
old_output_lines = _output_lines;
attrset (COLOR_NORMAL);
- dlg_move (h, 9, 10 + first_width);
+ dlg_move (h, 10, 10 + first_width);
tty_printf ("%02d", _output_lines);
}
}
@@ -372,7 +378,7 @@ init_layout (void)
first_width = l1;
}
- for (i = 0; i <= 8; i++) {
+ for (i = 0; i <= 9; i++) {
check_options[i].text = _(check_options[i].text);
l1 = mbstrlen (check_options[i].text) + 7;
if (l1 > first_width)
@@ -389,7 +395,7 @@ init_layout (void)
second_width = mbstrlen (title3) + 1;
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 7; i++) {
check_options[i].text = _(check_options[i].text);
l1 = mbstrlen (check_options[i].text) + 7;
if (l1 > second_width)
@@ -444,23 +450,23 @@ init_layout (void)
0));
if (console_flag) {
add_widget (layout_dlg,
- button_new (9, 12 + first_width, B_MINUS,
+ button_new (10, 12 + first_width, B_MINUS,
NARROW_BUTTON, "&-", bminus_cback));
add_widget (layout_dlg,
- button_new (9, 7 + first_width, B_PLUS, NARROW_BUTTON,
+ button_new (10, 7 + first_width, B_PLUS, NARROW_BUTTON,
"&+", bplus_cback));
}
#define XTRACT(i) *check_options[i].variable, check_options[i].text
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 7; i++) {
check_options[i].widget =
- check_new (8 - i, 7 + first_width, XTRACT (i));
+ check_new (9 - i, 7 + first_width, XTRACT (i));
add_widget (layout_dlg, check_options[i].widget);
}
- check_options[8].widget = check_new (10, 6, XTRACT (8));
+ check_options[9].widget = check_new (10, 6, XTRACT (9));
+ add_widget (layout_dlg, check_options[9].widget);
+ check_options[8].widget = check_new (9, 6, XTRACT (8));
add_widget (layout_dlg, check_options[8].widget);
- check_options[7].widget = check_new (9, 6, XTRACT (7));
- add_widget (layout_dlg, check_options[7].widget);
_filetype_mode = filetype_mode;
_permission_mode = permission_mode;
@@ -470,20 +476,21 @@ init_layout (void)
_keybar_visible = keybar_visible;
_message_visible = message_visible;
_xterm_title = xterm_title;
+ _free_space = free_space;
bright_widget =
button_new (6, 15, B_2RIGHT, NARROW_BUTTON, "&>", b2right_cback);
add_widget (layout_dlg, bright_widget);
bleft_widget =
button_new (6, 9, B_2LEFT, NARROW_BUTTON, "&<", b2left_cback);
add_widget (layout_dlg, bleft_widget);
- check_options[6].widget = check_new (5, 6, XTRACT (6));
+ check_options[7].widget = check_new (5, 6, XTRACT (7));
old_first_panel_size = -1;
old_horizontal_split = -1;
old_output_lines = -1;
_first_panel_size = first_panel_size;
_output_lines = output_lines;
- add_widget (layout_dlg, check_options[6].widget);
+ add_widget (layout_dlg, check_options[7].widget);
radio_widget = radio_new (3, 6, 2, s_split_direction);
add_widget (layout_dlg, radio_widget);
radio_widget->sel = horizontal_split;
diff -up mc-4.6.2/src/layout.h.showfree mc-4.6.2/src/layout.h
--- mc-4.6.2/src/layout.h.showfree 2009-02-01 20:30:21.000000000 +0100
+++ mc-4.6.2/src/layout.h 2009-05-26 14:57:36.000000000 +0200
@@ -39,6 +39,7 @@ extern int keybar_visible;
extern int output_start_y;
extern int message_visible;
extern int xterm_title;
+extern int free_space;
extern int horizontal_split;
extern int nice_rotating_dash;
diff -up mc-4.6.2/src/main.c.showfree mc-4.6.2/src/main.c
--- mc-4.6.2/src/main.c.showfree 2009-05-26 14:57:36.000000000 +0200
+++ mc-4.6.2/src/main.c 2009-05-26 14:57:36.000000000 +0200
@@ -62,6 +62,7 @@
#include "listmode.h" #include "listmode.h"
#include "execute.h" #include "execute.h"
#include "ext.h" /* For flush_extension_file() */ #include "ext.h" /* For flush_extension_file() */
@ -18,7 +188,7 @@
/* Listbox for the command history feature */ /* Listbox for the command history feature */
#include "widget.h" #include "widget.h"
@@ -231,6 +232,12 @@ @@ -233,6 +234,12 @@ Dlg_head *midnight_dlg;
/* We need to paint it after CONSOLE_RESTORE, see: load_prompt */ /* We need to paint it after CONSOLE_RESTORE, see: load_prompt */
int update_prompt = 0; int update_prompt = 0;
@ -31,7 +201,7 @@
/* The home directory */ /* The home directory */
const char *home_dir = NULL; const char *home_dir = NULL;
@@ -402,6 +409,8 @@ @@ -404,6 +411,8 @@ update_panels (int force_update, const c
int reload_other = !(force_update & UP_ONLY_CURRENT); int reload_other = !(force_update & UP_ONLY_CURRENT);
WPanel *panel; WPanel *panel;
@ -40,7 +210,7 @@
update_one_panel (get_current_index (), force_update, current_file); update_one_panel (get_current_index (), force_update, current_file);
if (reload_other) if (reload_other)
update_one_panel (get_other_index (), force_update, UP_KEEPSEL); update_one_panel (get_other_index (), force_update, UP_KEEPSEL);
@@ -467,6 +476,38 @@ @@ -469,6 +478,38 @@ stop_dialogs (void)
} }
} }
@ -79,9 +249,10 @@
static int static int
quit_cmd_internal (int quiet) quit_cmd_internal (int quiet)
{ {
--- mc-2007-01-24-03/src/main.h.showfree 2007-02-15 09:53:48.000000000 +0100 diff -up mc-4.6.2/src/main.h.showfree mc-4.6.2/src/main.h
+++ mc-2007-01-24-03/src/main.h 2007-02-15 09:53:48.000000000 +0100 --- mc-4.6.2/src/main.h.showfree 2009-05-26 14:57:36.000000000 +0200
@@ -55,6 +55,7 @@ +++ mc-4.6.2/src/main.h 2009-05-26 14:57:36.000000000 +0200
@@ -55,6 +55,7 @@ extern int cd_symlinks;
extern int show_all_if_ambiguous; extern int show_all_if_ambiguous;
extern int slow_terminal; extern int slow_terminal;
extern int update_prompt; /* To comunicate with subshell */ extern int update_prompt; /* To comunicate with subshell */
@ -89,7 +260,7 @@
extern int safe_delete; extern int safe_delete;
extern int confirm_delete; extern int confirm_delete;
extern int confirm_directory_hotlist_delete; extern int confirm_directory_hotlist_delete;
@@ -102,6 +103,7 @@ @@ -102,6 +103,7 @@ void change_panel (void);
int load_prompt (int, void *); int load_prompt (int, void *);
void save_cwds_stat (void); void save_cwds_stat (void);
void quiet_quit_cmd (void); /* For cmd.c and command.c */ void quiet_quit_cmd (void); /* For cmd.c and command.c */
@ -97,9 +268,10 @@
void touch_bar (void); void touch_bar (void);
void update_xterm_title_path (void); void update_xterm_title_path (void);
--- mc-2007-01-24-03/src/screen.c.showfree 2007-02-15 09:53:48.000000000 +0100 diff -up mc-4.6.2/src/screen.c.showfree mc-4.6.2/src/screen.c
+++ mc-2007-01-24-03/src/screen.c 2007-02-15 09:53:48.000000000 +0100 --- mc-4.6.2/src/screen.c.showfree 2009-05-26 14:57:36.000000000 +0200
@@ -47,7 +47,7 @@ +++ mc-4.6.2/src/screen.c 2009-05-26 14:59:37.000000000 +0200
@@ -49,7 +49,7 @@
#include "widget.h" #include "widget.h"
#include "menu.h" /* menubar_visible */ #include "menu.h" /* menubar_visible */
#define WANT_WIDGETS #define WANT_WIDGETS
@ -107,16 +279,16 @@
+#include "main.h" /* the_menubar, show_free_space() */ +#include "main.h" /* the_menubar, show_free_space() */
#include "unixcompat.h" #include "unixcompat.h"
#define ELEMENTS(arr) ( sizeof(arr) / sizeof((arr)[0]) ) #ifdef HAVE_CHARSET
@@ -866,6 +866,7 @@ @@ -884,6 +884,7 @@ mini_info_separator (WPanel *panel)
hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR, hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
panel->widget.cols - 2); panel->widget.cols - 2);
#endif /* !HAVE_SLANG */ #endif /* !HAVE_SLANG */
+ show_free_space (panel); + show_free_space (panel);
} }
static void void
@@ -910,6 +911,8 @@ @@ -938,6 +939,8 @@ show_dir (WPanel *panel)
widget_move (&panel->widget, 0, panel->widget.cols - 3); widget_move (&panel->widget, 0, panel->widget.cols - 3);
addstr ("v"); addstr ("v");
@ -125,180 +297,14 @@
if (panel->active) if (panel->active)
standend (); standend ();
} }
--- mc-2007-01-24-03/src/layout.c.showfree 2007-02-15 09:53:47.000000000 +0100 diff -up mc-4.6.2/src/setup.c.showfree mc-4.6.2/src/setup.c
+++ mc-2007-01-24-03/src/layout.c 2007-02-15 09:53:48.000000000 +0100 --- mc-4.6.2/src/setup.c.showfree 2009-05-26 14:57:36.000000000 +0200
@@ -96,6 +96,9 @@ +++ mc-4.6.2/src/setup.c 2009-05-26 14:57:36.000000000 +0200
/* Set to show current working dir in xterm window title */ @@ -138,6 +138,7 @@ static const struct {
int xterm_title = 1; { "show_mini_info", &show_mini_info },
{ "permission_mode", &permission_mode },
{ "filetype_mode", &filetype_mode },
+ { "free_space", &free_space },
{ 0, 0 }
};
+/* Set to show free space on device assigned to current directory */
+int free_space = 1;
+
/* The starting line for the output of the subprogram */
int output_start_y = 0;
@@ -125,6 +128,7 @@
static int _keybar_visible;
static int _message_visible;
static int _xterm_title;
+static int _free_space;
static int _permission_mode;
static int _filetype_mode;
@@ -155,6 +159,7 @@
int *variable;
WCheck *widget;
} check_options [] = {
+ { N_("show free sp&Ace"), &free_space, 0 },
{ N_("&Xterm window title"), &xterm_title, 0 },
{ N_("h&Intbar visible"), &message_visible, 0 },
{ N_("&Keybar visible"), &keybar_visible, 0 },
@@ -226,8 +231,8 @@
if (_equal_split){
/* Turn equal split off */
_equal_split = 0;
- check_options [6].widget->state = check_options [6].widget->state & ~C_BOOL;
- dlg_select_widget (check_options [6].widget);
+ check_options [7].widget->state = check_options [7].widget->state & ~C_BOOL;
+ dlg_select_widget (check_options [7].widget);
dlg_select_widget (bleft_widget);
}
_first_panel_size++;
@@ -241,8 +246,8 @@
if (_equal_split){
/* Turn equal split off */
_equal_split = 0;
- check_options [6].widget->state = check_options [6].widget->state & ~C_BOOL;
- dlg_select_widget (check_options [6].widget);
+ check_options [7].widget->state = check_options [7].widget->state & ~C_BOOL;
+ dlg_select_widget (check_options [7].widget);
dlg_select_widget (bright_widget);
}
_first_panel_size--;
@@ -288,23 +293,24 @@
if (old_output_lines != _output_lines){
old_output_lines = _output_lines;
attrset (COLOR_NORMAL);
- dlg_move (h, 9, 16 + first_width);
+ dlg_move (h, 10, 16 + first_width);
addstr (output_lines_label);
- dlg_move (h, 9, 10 + first_width);
+ dlg_move (h, 10, 10 + first_width);
tty_printf ("%02d", _output_lines);
}
}
return MSG_HANDLED;
case DLG_POST_KEY:
- _filetype_mode = check_options [8].widget->state & C_BOOL;
- _permission_mode = check_options [7].widget->state & C_BOOL;
- _equal_split = check_options [6].widget->state & C_BOOL;
- _menubar_visible = check_options [5].widget->state & C_BOOL;
- _command_prompt = check_options [4].widget->state & C_BOOL;
- _keybar_visible = check_options [2].widget->state & C_BOOL;
- _message_visible = check_options [1].widget->state & C_BOOL;
- _xterm_title = check_options [0].widget->state & C_BOOL;
+ _filetype_mode = check_options [9].widget->state & C_BOOL;
+ _permission_mode = check_options [8].widget->state & C_BOOL;
+ _equal_split = check_options [7].widget->state & C_BOOL;
+ _menubar_visible = check_options [6].widget->state & C_BOOL;
+ _command_prompt = check_options [5].widget->state & C_BOOL;
+ _keybar_visible = check_options [3].widget->state & C_BOOL;
+ _message_visible = check_options [2].widget->state & C_BOOL;
+ _xterm_title = check_options [1].widget->state & C_BOOL;
+ _free_space = check_options [0].widget->state & C_BOOL;
if (console_flag){
int minimum;
if (_output_lines < 0)
@@ -332,7 +338,7 @@
if (old_output_lines != _output_lines){
old_output_lines = _output_lines;
attrset (COLOR_NORMAL);
- dlg_move (h, 9, 10 + first_width);
+ dlg_move (h, 10, 10 + first_width);
tty_printf ("%02d", _output_lines);
}
}
@@ -371,7 +377,7 @@
first_width = l1;
}
- for (i = 0; i <= 8; i++) {
+ for (i = 0; i <= 9; i++) {
check_options[i].text = _(check_options[i].text);
l1 = mbstrlen (check_options[i].text) + 7;
if (l1 > first_width)
@@ -388,7 +394,7 @@
second_width = mbstrlen (title3) + 1;
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 7; i++) {
check_options[i].text = _(check_options[i].text);
l1 = mbstrlen (check_options[i].text) + 7;
if (l1 > second_width)
@@ -443,23 +449,23 @@
0));
if (console_flag) {
add_widget (layout_dlg,
- button_new (9, 12 + first_width, B_MINUS,
+ button_new (10, 12 + first_width, B_MINUS,
NARROW_BUTTON, "&-", bminus_cback));
add_widget (layout_dlg,
- button_new (9, 7 + first_width, B_PLUS, NARROW_BUTTON,
+ button_new (10, 7 + first_width, B_PLUS, NARROW_BUTTON,
"&+", bplus_cback));
}
#define XTRACT(i) *check_options[i].variable, check_options[i].text
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 7; i++) {
check_options[i].widget =
- check_new (8 - i, 7 + first_width, XTRACT (i));
+ check_new (9 - i, 7 + first_width, XTRACT (i));
add_widget (layout_dlg, check_options[i].widget);
}
- check_options[8].widget = check_new (10, 6, XTRACT (8));
+ check_options[9].widget = check_new (10, 6, XTRACT (9));
+ add_widget (layout_dlg, check_options[9].widget);
+ check_options[8].widget = check_new (9, 6, XTRACT (8));
add_widget (layout_dlg, check_options[8].widget);
- check_options[7].widget = check_new (9, 6, XTRACT (7));
- add_widget (layout_dlg, check_options[7].widget);
_filetype_mode = filetype_mode;
_permission_mode = permission_mode;
@@ -469,20 +475,21 @@
_keybar_visible = keybar_visible;
_message_visible = message_visible;
_xterm_title = xterm_title;
+ _free_space = free_space;
bright_widget =
button_new (6, 15, B_2RIGHT, NARROW_BUTTON, "&>", b2right_cback);
add_widget (layout_dlg, bright_widget);
bleft_widget =
button_new (6, 9, B_2LEFT, NARROW_BUTTON, "&<", b2left_cback);
add_widget (layout_dlg, bleft_widget);
- check_options[6].widget = check_new (5, 6, XTRACT (6));
+ check_options[7].widget = check_new (5, 6, XTRACT (7));
old_first_panel_size = -1;
old_horizontal_split = -1;
old_output_lines = -1;
_first_panel_size = first_panel_size;
_output_lines = output_lines;
- add_widget (layout_dlg, check_options[6].widget);
+ add_widget (layout_dlg, check_options[7].widget);
radio_widget = radio_new (3, 6, 2, s_split_direction);
add_widget (layout_dlg, radio_widget);
radio_widget->sel = horizontal_split;
--- mc-2007-01-24-03/src/layout.h.showfree 2004-12-03 20:17:47.000000000 +0100
+++ mc-2007-01-24-03/src/layout.h 2007-02-15 09:53:48.000000000 +0100
@@ -39,6 +39,7 @@
extern int output_start_y;
extern int message_visible;
extern int xterm_title;
+extern int free_space;
extern int horizontal_split;
extern int nice_rotating_dash;

View File

@ -1,14 +1,51 @@
--- mc-4.6.1a/src/main.c.userhost 2005-10-16 18:11:07.000000000 +0200 diff -up mc-4.6.2/edit/editwidget.c.userhost mc-4.6.2/edit/editwidget.c
+++ mc-4.6.1a/src/main.c 2005-10-16 18:14:26.000000000 +0200 --- mc-4.6.2/edit/editwidget.c.userhost 2009-05-26 14:45:19.000000000 +0200
@@ -28,6 +28,7 @@ +++ mc-4.6.2/edit/editwidget.c 2009-05-26 14:49:35.000000000 +0200
#include <stdio.h> @@ -46,6 +46,9 @@
#include <stdlib.h> #include "../src/widget.h" /* buttonbar_redraw() */
#include <string.h> #include "../src/menu.h" /* menubar_new() */
+#include <pwd.h> #include "../src/key.h" /* is_idle() */
+#include "../src/main.h" /* xterm_title_str */
+#include "../src/win.h" /* xterm_flag */
+#include "../src/layout.h" /* xterm_title */
#include <sys/types.h> WEdit *wedit;
#include <sys/stat.h> struct WMenu *edit_menubar;
@@ -1608,9 +1609,22 @@ void @@ -174,6 +177,11 @@ edit_file (const char *_file, int line)
Dlg_head *edit_dlg;
WButtonBar *edit_bar;
+ if (xterm_flag && xterm_title && xterm_title_str) {
+ fprintf (stdout, "\33]0;mc - %s/%s\7", xterm_title_str, _file);
+ fflush(stdout);
+ }
+
if (!made_directory) {
char *dir = mhl_str_dir_plus_file (home_dir, EDIT_DIR);
made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
@@ -208,6 +216,8 @@ edit_file (const char *_file, int line)
edit_done_menu (edit_menubar); /* editmenu.c */
destroy_dlg (edit_dlg);
+
+ update_xterm_title_path();
return 1;
}
diff -up mc-4.6.2/src/main.c.userhost mc-4.6.2/src/main.c
--- mc-4.6.2/src/main.c.userhost 2009-05-26 14:45:19.000000000 +0200
+++ mc-4.6.2/src/main.c 2009-05-26 14:48:06.000000000 +0200
@@ -278,6 +278,9 @@ int midnight_shutdown = 0;
/* The user's shell */
const char *shell = NULL;
+/* The xterm title */
+char *xterm_title_str = NULL;
+
/* Is the LANG UTF-8 ? */
gboolean is_utf8 = FALSE;
@@ -1624,9 +1627,23 @@ void
update_xterm_title_path (void) update_xterm_title_path (void)
{ {
char *p, *s; char *p, *s;
@ -16,6 +53,7 @@
+ struct passwd *pw; + struct passwd *pw;
if (xterm_flag && xterm_title) { if (xterm_flag && xterm_title) {
+ if ( xterm_title_str ) g_free (xterm_title_str);
p = s = g_strdup (strip_home_and_password (current_panel->cwd)); p = s = g_strdup (strip_home_and_password (current_panel->cwd));
+ if ( !gethostname (h, 64) ) { + if ( !gethostname (h, 64) ) {
+ h[63] = '\0'; /* Be sure the hostname is NUL terminated */ + h[63] = '\0'; /* Be sure the hostname is NUL terminated */
@ -31,19 +69,30 @@
do { do {
#ifndef UTF8 #ifndef UTF8
if (!is_printable ((unsigned char) *s)) if (!is_printable ((unsigned char) *s))
--- mc-4.6.1a/src/main.h.viewfile 2005-09-05 04:10:48.000000000 +0200 @@ -1639,7 +1656,7 @@ update_xterm_title_path (void)
+++ mc-4.6.1a/src/main.h 2005-10-17 14:41:46.000000000 +0200 numeric_keypad_mode ();
@@ -67,6 +67,7 @@ extern int alternate_plus_minus; fprintf (stdout, "\33]0;mc - %s\7", p);
fflush (stdout);
- g_free (p);
+ xterm_title_str = p;
}
}
diff -up mc-4.6.2/src/main.h.userhost mc-4.6.2/src/main.h
--- mc-4.6.2/src/main.h.userhost 2009-05-26 14:45:19.000000000 +0200
+++ mc-4.6.2/src/main.h 2009-05-26 14:46:33.000000000 +0200
@@ -69,6 +69,7 @@ extern int alternate_plus_minus;
extern int only_leading_plus_minus; extern int only_leading_plus_minus;
extern int output_starts_shell; extern int output_starts_shell;
extern int midnight_shutdown; extern int midnight_shutdown;
+extern char *xterm_title_str; +extern char *xterm_title_str;
extern gboolean is_utf8;
extern char cmd_buf [512]; extern char cmd_buf [512];
extern const char *shell; extern const char *shell;
diff -up mc-4.6.2/src/view.c.userhost mc-4.6.2/src/view.c
--- mc-4.6.1a/src/view.c.viewfile 2005-10-17 14:41:46.000000000 +0200 --- mc-4.6.2/src/view.c.userhost 2009-05-26 14:45:19.000000000 +0200
+++ mc-4.6.1a/src/view.c 2005-10-17 15:11:54.000000000 +0200 +++ mc-4.6.2/src/view.c 2009-05-26 14:45:19.000000000 +0200
@@ -3344,6 +3344,11 @@ mc_internal_viewer (const char *command, @@ -3368,6 +3368,11 @@ mc_internal_viewer (const char *command,
WButtonBar *bar; WButtonBar *bar;
Dlg_head *view_dlg; Dlg_head *view_dlg;
@ -55,7 +104,7 @@
/* Create dialog and widgets, put them on the dialog */ /* Create dialog and widgets, put them on the dialog */
view_dlg = view_dlg =
create_dlg (0, 0, LINES, COLS, NULL, view_dialog_callback, create_dlg (0, 0, LINES, COLS, NULL, view_dialog_callback,
@@ -3367,6 +3372,8 @@ mc_internal_viewer (const char *command, @@ -3391,6 +3396,8 @@ mc_internal_viewer (const char *command,
} }
destroy_dlg (view_dlg); destroy_dlg (view_dlg);
@ -64,65 +113,3 @@
return succeeded; return succeeded;
} }
--- mc-4.6.1a/src/main.c.viewfile 2005-10-17 14:41:46.000000000 +0200
+++ mc-4.6.1a/src/main.c 2005-10-17 14:41:46.000000000 +0200
@@ -270,6 +270,9 @@ int midnight_shutdown = 0;
/* The user's shell */
const char *shell = NULL;
+/* The xterm title */
+char *xterm_title_str = NULL;
+
/* mc_home: The home of MC */
char *mc_home = NULL;
@@ -1617,6 +1620,7 @@ update_xterm_title_path (void)
struct passwd *pw;
if (xterm_flag && xterm_title) {
+ if ( xterm_title_str ) g_free (xterm_title_str);
p = s = g_strdup (strip_home_and_password (current_panel->cwd));
if ( !gethostname (h, 64) ) {
h[63] = '\0'; /* Be sure the hostname is NUL terminated */
@@ -1639,7 +1643,7 @@ update_xterm_title_path (void)
} while (*++s);
fprintf (stdout, "\33]0;mc - %s\7", p);
fflush (stdout);
- g_free (p);
+ xterm_title_str = p;
}
}
--- mc-4.6.1a/edit/editwidget.c.viewfile 2005-10-17 14:41:46.000000000 +0200
+++ mc-4.6.1a/edit/editwidget.c 2005-10-17 14:41:46.000000000 +0200
@@ -44,6 +44,9 @@
#include "../src/widget.h" /* buttonbar_redraw() */
#include "../src/menu.h" /* menubar_new() */
#include "../src/key.h" /* is_idle() */
+#include "../src/main.h" /* xterm_title_str */
+#include "../src/win.h" /* xterm_flag */
+#include "../src/layout.h" /* xterm_title */
WEdit *wedit;
struct WMenu *edit_menubar;
@@ -184,6 +187,11 @@ edit_file (const char *_file, int line)
static int made_directory = 0;
Dlg_head *edit_dlg;
WButtonBar *edit_bar;
+
+ if (xterm_flag && xterm_title && xterm_title_str) {
+ fprintf (stdout, "\33]0;mc - %s/%s\7", xterm_title_str, _file);
+ fflush(stdout);
+ }
if (!made_directory) {
char *dir = concat_dir_and_file (home_dir, EDIT_DIR);
@@ -219,6 +227,8 @@ edit_file (const char *_file, int line)
edit_done_menu (edit_menubar); /* editmenu.c */
destroy_dlg (edit_dlg);
+
+ update_xterm_title_path();
return 1;
}

View File

@ -1,26 +0,0 @@
--- mc-2006-08-12-18/edit/editdraw.c.8bit-hex 2006-09-05 14:35:21.000000000 +0200
+++ mc-2006-08-12-18/edit/editdraw.c 2006-09-05 14:35:21.000000000 +0200
@@ -70,12 +70,22 @@
*/
if (edit->curs1 < edit->last_byte) {
mc_wchar_t cur_byte = edit_get_byte (edit, edit->curs1);
+ mc_wchar_t cur_byte2 = cur_byte;
#ifndef UTF8
g_snprintf (byte_str, sizeof (byte_str), "%c %3d 0x%02X",
is_printable (cur_byte) ? cur_byte : '.',
#else /* UTF8 */
+ /* In 8-bit locales show the byte itself instead of its Unicode value */
+ if (MB_CUR_MAX == 1) {
+ unsigned char cur_8bit_byte;
+ mbstate_t mbs;
+ memset (&mbs, 0, sizeof (mbs));
+ if (wcrtomb(&cur_8bit_byte, cur_byte, &mbs) == 1) {
+ cur_byte = cur_8bit_byte;
+ }
+ }
g_snprintf (byte_str, sizeof(byte_str), "%lc %3d 0x%02X",
- iswprint(cur_byte) ? cur_byte : '.',
+ iswprint(cur_byte2) ? cur_byte2 : '.',
#endif /* UTF8 */
(int) cur_byte,
(unsigned) cur_byte);

View File

@ -1,204 +0,0 @@
--- mc-4.6.1a/src/main.c.laf 2005-11-24 16:55:06.000000000 +0100
+++ mc-4.6.1a/src/main.c 2005-11-24 16:56:27.000000000 +0100
@@ -270,6 +270,9 @@ int midnight_shutdown = 0;
/* The user's shell */
const char *shell = NULL;
+/* Is the LANG UTF-8 ? */
+gboolean is_utf8 = FALSE;
+
/* The xterm title */
char *xterm_title_str = NULL;
@@ -2167,6 +2170,16 @@ main (int argc, char *argv[])
/* if on, it displays the information that files have been moved to ~/.mc */
int show_change_notice = 0;
+ /* Check whether we have UTF-8 locale */
+ char *lang = getenv("LANG");
+ size_t len = 0;
+
+ if ( lang )
+ len = strlen(lang);
+
+ if ( len >= 5 && !strcasecmp(&lang[len-5],"UTF-8") )
+ is_utf8 = TRUE;
+
/* We had LC_CTYPE before, LC_ALL includs LC_TYPE as well */
setlocale (LC_ALL, "");
bindtextdomain ("mc", LOCALEDIR);
--- mc-4.6.1a/src/main.h.laf 2005-11-24 16:55:06.000000000 +0100
+++ mc-4.6.1a/src/main.h 2005-11-24 16:55:06.000000000 +0100
@@ -67,6 +67,7 @@ extern int alternate_plus_minus;
extern int only_leading_plus_minus;
extern int output_starts_shell;
extern int midnight_shutdown;
+extern gboolean is_utf8;
extern char *xterm_title_str;
extern char cmd_buf [512];
extern const char *shell;
--- mc-4.6.1a/src/widget.c.laf 2005-11-24 16:55:06.000000000 +0100
+++ mc-4.6.1a/src/widget.c 2005-11-24 16:55:06.000000000 +0100
@@ -1948,52 +1948,86 @@ input_new (int y, int x, int color, int
return in;
}
-
-/* Listbox widget */
-
-/* Should draw the scrollbar, but currently draws only
- * indications that there is more information
- */
-static int listbox_cdiff (WLEntry *s, WLEntry *e);
+/* Vertical scrollbar widget */
-static void
-listbox_drawscroll (WListbox *l)
+void
+vscrollbar (Widget widget, int height, int width, int tpad, int bpad,
+ int selected, int count, gboolean color)
{
int line;
- int i, top;
- int max_line = l->height-1;
-
+ int i;
+
/* Are we at the top? */
- widget_move (&l->widget, 0, l->width);
- if (l->list == l->top)
- one_vline ();
+ widget_move (&widget, tpad, width);
+#ifndef UTF8
+ if (!selected)
+ one_vline ();
else
- addch ('^');
+ addch ('^');
+#else
+ if (color) attrset (MARKED_COLOR);
+ if (is_utf8)
+ SLsmg_write_string("↑");
+ else
+ addch ('^');
+ if (color) attrset (NORMAL_COLOR);
+#endif
/* Are we at the bottom? */
- widget_move (&l->widget, max_line, l->width);
- top = listbox_cdiff (l->list, l->top);
- if ((top + l->height == l->count) || l->height >= l->count)
- one_vline ();
+ widget_move (&widget, height-1-bpad, width);
+#ifndef UTF8
+ if (selected == count-1)
+ one_vline ();
+ else
+ addch ('v');
+#else
+ if (color) attrset (MARKED_COLOR);
+ if (is_utf8)
+ SLsmg_write_string("↓");
else
- addch ('v');
+ addch('v');
+ if (color) attrset (NORMAL_COLOR);
+#endif
/* Now draw the nice relative pointer */
- if (l->count)
- line = 1+ ((l->pos * (l->height-2)) / l->count);
+ if (count > 1)
+ line = tpad + 1 + ((selected * (height-3-tpad-bpad)) / (count-1));
else
- line = 0;
-
- for (i = 1; i < max_line; i++){
- widget_move (&l->widget, i, l->width);
- if (i != line)
- one_vline ();
- else
- addch ('*');
+ line = 0;
+
+ for (i = tpad + 1; i < height-1-bpad; i++){
+ widget_move (&widget, i, width);
+ if (i != line)
+#ifndef UTF8
+ one_vline ();
+ else
+ addch ('*');
+#else
+ if (is_utf8)
+ SLsmg_write_string("▒");
+ else
+ one_vline();
+ else {
+ if (color) attrset (MARKED_COLOR);
+ if (is_utf8)
+ SLsmg_write_string("▮");
+ else
+ addch('*');
+ if (color) attrset (NORMAL_COLOR);
+ }
+#endif
}
}
-
-static void
+
+
+/* Listbox widget */
+
+/* Should draw the scrollbar, but currently draws only
+ * indications that there is more information
+ */
+static int listbox_cdiff (WLEntry *s, WLEntry *e);
+
+void
listbox_draw (WListbox *l, int focused)
{
WLEntry *e;
@@ -2034,7 +2068,7 @@ listbox_draw (WListbox *l, int focused)
if (!l->scrollbar)
return;
attrset (normalc);
- listbox_drawscroll (l);
+ vscrollbar (l->widget, l->height, l->width, 0, 0, l->pos, l->count, FALSE);
}
/* Returns the number of items between s and e,
--- mc-4.6.1a/src/screen.c.laf 2005-11-24 16:55:06.000000000 +0100
+++ mc-4.6.1a/src/screen.c 2005-11-24 16:55:06.000000000 +0100
@@ -888,6 +888,9 @@ show_dir (WPanel *panel)
}
#endif /* HAVE_SLANG */
+ vscrollbar (panel->widget, panel->widget.lines, panel->widget.cols-1, 2, 2,
+ panel->selected, panel->count, TRUE);
+
if (panel->active)
attrset (REVERSE_COLOR);
@@ -1504,7 +1507,7 @@ use_display_format (WPanel *panel, const
panel->dirty = 1;
/* Status needn't to be split */
- usable_columns = ((panel->widget.cols-2)/((isstatus)
+ usable_columns = ((panel->widget.cols-3)/((isstatus)
? 1
: (panel->split+1))) - (!isstatus && panel->split);
--- mc-4.6.1a/src/widget.h.laf 2005-11-24 16:55:06.000000000 +0100
+++ mc-4.6.1a/src/widget.h 2005-11-24 16:55:06.000000000 +0100
@@ -170,6 +170,10 @@ void button_set_text (WButton *b, const
/* Listbox manager */
WLEntry *listbox_get_data (WListbox *l, int pos);
+/* Vertical scrollbar */
+void vscrollbar (Widget widget, int height, int width, int tpad, int bpad,
+ int selected, int count, gboolean color);
+
/* search text int listbox entries */
WLEntry *listbox_search_text (WListbox *l, const char *text);
void listbox_select_entry (WListbox *l, WLEntry *dest);

34
mc.spec
View File

@ -1,37 +1,34 @@
Summary: User-friendly text console file manager and visual shell Summary: User-friendly text console file manager and visual shell
Name: mc Name: mc
Version: 4.6.2 Version: 4.6.2
Release: 10.pre1%{?dist} Release: 11%{?dist}
Epoch: 1 Epoch: 1
License: GPLv2 License: GPLv2
Group: System Environment/Shells Group: System Environment/Shells
Source0: http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/snapshots/mc-%{version}-pre1.tar.gz # tarball from http://www.midnight-commander.org/downloads/3
URL: http://www.ibiblio.org/mc/ Source0: mc-%{version}.tar.gz
URL: http://www.midnight-commander.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: glib2-devel e2fsprogs-devel slang-devel BuildRequires: glib2-devel e2fsprogs-devel slang-devel
BuildRequires: gettext cvs automake autoconf
Requires: dev >= 0:3.3-3 Requires: dev >= 0:3.3-3
Patch0: mc-utf8.patch # UTF-8 patch from http://www.midnight-commander.org/downloads/4
Patch0: mc-4.6.2-utf8.patch
Patch1: mc-extensions.patch Patch1: mc-extensions.patch
Patch2: mc-userhost.patch Patch2: mc-userhost.patch
Patch3: mc-64bit.patch Patch3: mc-64bit.patch
Patch4: mc-utf8-look-and-feel.patch
Patch5: mc-concat.patch
Patch6: mc-showfree.patch Patch6: mc-showfree.patch
Patch7: mc-cedit.patch Patch7: mc-cedit.patch
Patch8: mc-delcheck.patch Patch8: mc-delcheck.patch
Patch9: mc-etcmc.patch Patch9: mc-etcmc.patch
Patch10: mc-exit.patch Patch10: mc-exit.patch
Patch11: mc-utf8-8bit-hex.patch
Patch12: mc-ipv6.patch Patch12: mc-ipv6.patch
Patch13: mc-newlinedir.patch Patch13: mc-newlinedir.patch
Patch14: mc-cloexec.patch
Patch15: mc-prompt.patch Patch15: mc-prompt.patch
Patch16: mc-refresh.patch Patch16: mc-refresh.patch
Patch17: mc-preserveattr.patch
Patch18: mc-lzma.patch Patch18: mc-lzma.patch
Patch19: mc-hintchk.patch Patch19: mc-hintchk.patch
Patch20: mc-7zip.patch
Patch21: mc-oldrpmtags.patch Patch21: mc-oldrpmtags.patch
Patch22: mc-shellcwd.patch Patch22: mc-shellcwd.patch
Patch23: mc-cedit-configurable-highlight.patch Patch23: mc-cedit-configurable-highlight.patch
@ -45,28 +42,22 @@ ability to FTP, view tar and zip files, and to poke into RPMs for
specific files. specific files.
%prep %prep
%setup -q -n %{name}-%{version}-pre1 %setup -q
%patch0 -p1 -b .utf8 %patch0 -p1 -b .utf8
%patch1 -p1 -b .extensions %patch1 -p1 -b .extensions
%patch2 -p1 -b .userhost %patch2 -p1 -b .userhost
%patch3 -p1 -b .64bit %patch3 -p1 -b .64bit
%patch4 -p1 -b .laf
%patch5 -p1 -b .concat
%patch6 -p1 -b .showfree %patch6 -p1 -b .showfree
%patch7 -p1 -b .cedit %patch7 -p1 -b .cedit
%patch8 -p1 -b .delcheck %patch8 -p1 -b .delcheck
%patch9 -p1 -b .etcmc %patch9 -p1 -b .etcmc
%patch10 -p1 -b .exit %patch10 -p1 -b .exit
%patch11 -p1 -b .8bit-hex
%patch12 -p1 -b .ipv6 %patch12 -p1 -b .ipv6
%patch13 -p1 -b .newlinedir %patch13 -p1 -b .newlinedir
%patch14 -p1 -b .cloexec
%patch15 -p1 -b .prompt %patch15 -p1 -b .prompt
%patch16 -p1 -b .refresh %patch16 -p1 -b .refresh
%patch17 -p1 -b .preserveattr
%patch18 -p1 -b .lzmavfs %patch18 -p1 -b .lzmavfs
%patch19 -p1 -b .hintchk %patch19 -p1 -b .hintchk
%patch20 -p1 -b .7zip
%patch21 -p1 -b .oldrpmtags %patch21 -p1 -b .oldrpmtags
%patch22 -p1 -b .shellcwd %patch22 -p1 -b .shellcwd
%patch23 -p1 -b .cedit-configurable-highlight %patch23 -p1 -b .cedit-configurable-highlight
@ -132,6 +123,7 @@ done
popd popd
%build %build
./autogen.sh
export CFLAGS="-DUTF8=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS -fgnu89-inline" export CFLAGS="-DUTF8=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS -fgnu89-inline"
%configure --with-screen=slang \ %configure --with-screen=slang \
--enable-charset \ --enable-charset \
@ -208,6 +200,14 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_libexecdir}/mc %dir %{_libexecdir}/mc
%changelog %changelog
* Wed May 17 2009 Jindrich Novy <jnovy@redhat.com> 4.6.2-11
- update to mc-4.6.2 release
- drop .8bit-hex, .preserveattrs, .cloexec, .7zip and part of
.utf8-look-and-feel patch, applied upstream
- sync the rest of patches, adopt upstream version of UTF8 patch
- update URL and source links
- add required BR
* Fri May 15 2009 Jindrich Novy <jnovy@redhat.com> 4.6.2-10.pre1 * Fri May 15 2009 Jindrich Novy <jnovy@redhat.com> 4.6.2-10.pre1
- fix segfault in mc editor when pressing ctrl+right (skip one word) - fix segfault in mc editor when pressing ctrl+right (skip one word)
in binary file (#500818) in binary file (#500818)

View File

@ -1 +1 @@
7626c446f016b09fd1210f00b9d0c292 mc-4.6.2-pre1.tar.gz ec92966f4d0c8b50c344fe901859ae2a mc-4.6.2.tar.gz