rpms/mc/F-11 mc-4.6.2-utf8.patch, NONE, 1.1 mc-edit-segv.patch, NONE, 1.1 .cvsignore, 1.36, 1.37 mc-etcmc.patch, 1.1, 1.2 mc-extensions.patch, 1.11, 1.12 mc-newlinedir.patch, 1.1, 1.2 mc-showfree.patch, 1.11, 1.12 mc-userhost.patch, 1.4, 1.5 mc.spec, 1.139, 1.140 sources, 1.44, 1.45 mc-7zip.patch, 1.1, NONE mc-cloexec.patch, 1.1, NONE mc-concat.patch, 1.1, NONE mc-preserveattr.patch, 1.1, NONE mc-utf8-8bit-hex.patch, 1.1, NONE mc-utf8-look-and-feel.patch, 1.5, NONE mc-utf8.patch, 1.30, NONE

Jindrich Novy jnovy at fedoraproject.org
Thu May 28 08:29:36 UTC 2009


Author: jnovy

Update of /cvs/pkgs/rpms/mc/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29070

Modified Files:
	.cvsignore mc-etcmc.patch mc-extensions.patch 
	mc-newlinedir.patch mc-showfree.patch mc-userhost.patch 
	mc.spec sources 
Added Files:
	mc-4.6.2-utf8.patch mc-edit-segv.patch 
Removed Files:
	mc-7zip.patch mc-cloexec.patch mc-concat.patch 
	mc-preserveattr.patch mc-utf8-8bit-hex.patch 
	mc-utf8-look-and-feel.patch mc-utf8.patch 
Log Message:
* Wed May 17 2009 Jindrich Novy <jnovy at redhat.com> 4.6.2-10
- update to mc-4.6.2 release
- fix segfault in mc editor when pressing ctrl+right (skip one word)
  in binary file (#500818)
- don't use dpkg tools for *.deb files (#495649), thanks to Dan Horak
- 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


mc-4.6.2-utf8.patch:

--- NEW FILE mc-4.6.2-utf8.patch ---
diff --git a/acinclude.m4 b/acinclude.m4
index f4c0e3b..f7f4fd4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -399,14 +399,14 @@ AC_DEFUN([MC_WITH_SLANG], [
     fi
 
     dnl Unless external S-Lang was requested, reject S-Lang with UTF-8 hacks
-    if test x$with_screen = xslang; then
-	:
-	m4_if([$1], strict, ,
-	      [AC_CHECK_LIB([slang], [SLsmg_write_nwchars],
-	    		    [AC_MSG_WARN([Rejecting S-Lang with UTF-8 support, \
-it's not fully supported yet])
-	      with_screen=mcslang])])
-    fi
+dnl    if test x$with_screen = xslang; then
+dnl	:
+dnl	m4_if([$1], strict, ,
+dnl	      [AC_CHECK_LIB([slang], [SLsmg_write_nwchars],
+dnl	    		    [AC_MSG_WARN([Rejecting S-Lang with UTF-8 support, \
+dnl it's not fully supported yet])
+dnl	      with_screen=mcslang])])
+dnl    fi
 
     if test x$with_screen = xslang; then
 	AC_DEFINE(HAVE_SYSTEM_SLANG, 1,
diff --git a/edit/edit-widget.h b/edit/edit-widget.h
index ab55764..fd51aaa 100644
--- a/edit/edit-widget.h
+++ b/edit/edit-widget.h
@@ -30,6 +30,11 @@ typedef struct edit_key_map_type {
     long command;
 } edit_key_map_type;
 
+struct action {
+    mc_wchar_t ch;
+    long flags;
+};
+
 struct WEdit {
     Widget widget;
 
@@ -42,8 +47,17 @@ struct WEdit {
     /* dynamic buffers and cursor position for editor: */
     long curs1;			/* position of the cursor from the beginning of the file. */
     long curs2;			/* position from the end of the file */
+#ifndef UTF8
     unsigned char *buffers1[MAXBUFF + 1];	/* all data up to curs1 */
     unsigned char *buffers2[MAXBUFF + 1];	/* all data from end of file down to curs2 */
+#else /* UTF8 */
+    mc_wchar_t *buffers1[MAXBUFF + 1];        /* all data up to curs1 */
+    mc_wchar_t *buffers2[MAXBUFF + 1];        /* all data from end of file down to curs2 */
+
+    unsigned char charbuf[MB_LEN_MAX];
+    int charpoint;
+#endif /* UTF8 */
+
 
     /* search variables */
     long search_start;		/* First character to start searching from */
@@ -87,7 +101,7 @@ struct WEdit {
 
     /* undo stack and pointers */
     unsigned long stack_pointer;
-    long *undo_stack;
+    struct action *undo_stack;
     unsigned long stack_size;
     unsigned long stack_size_mask;
     unsigned long stack_bottom;
diff --git a/edit/edit.c b/edit/edit.c
index bec84d7..8df473b 100644
--- a/edit/edit.c
+++ b/edit/edit.c
@@ -105,7 +105,11 @@ char *option_backup_ext = NULL;
 
 static void user_menu (WEdit *edit);
 
+#ifndef UTF8
 int edit_get_byte (WEdit * edit, long byte_index)
+#else
+mc_wchar_t edit_get_byte (WEdit * edit, long byte_index)
+#endif
 {
     unsigned long p;
     if (byte_index >= (edit->curs1 + edit->curs2) || byte_index < 0)
@@ -134,7 +138,7 @@ edit_init_buffers (WEdit *edit)
 
     edit->curs1 = 0;
     edit->curs2 = 0;
-    edit->buffers2[0] = g_malloc (EDIT_BUF_SIZE);
+    edit->buffers2[0] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
 }
 
 /*
@@ -159,7 +163,7 @@ edit_load_file_fast (WEdit *edit, const char *filename)
     }
 
     if (!edit->buffers2[buf2])
-	edit->buffers2[buf2] = g_malloc (EDIT_BUF_SIZE);
+	edit->buffers2[buf2] = g_malloc (EDIT_BUF_SIZE  * sizeof(mc_wchar_t));
 
     mc_read (file,
 	     (char *) edit->buffers2[buf2] + EDIT_BUF_SIZE -
@@ -169,7 +173,7 @@ edit_load_file_fast (WEdit *edit, const char *filename)
     for (buf = buf2 - 1; buf >= 0; buf--) {
 	/* edit->buffers2[0] is already allocated */
 	if (!edit->buffers2[buf])
-	    edit->buffers2[buf] = g_malloc (EDIT_BUF_SIZE);
+	    edit->buffers2[buf] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
 	mc_read (file, (char *) edit->buffers2[buf], EDIT_BUF_SIZE);
     }
 
@@ -242,9 +246,44 @@ edit_insert_stream (WEdit * edit, FILE * f)
 {
     int c;
     long i = 0;
-    while ((c = fgetc (f)) >= 0) {
+#ifndef UTF8
+    while ((c = fgetc (f)) != EOF) {
 	edit_insert (edit, c);
 	i++;
+#else /* UTF8 */
+    unsigned char buf[MB_LEN_MAX];
+    int charpos = 0;
+    mbstate_t mbs;
+
+    while ((c = fgetc (f)) != EOF) {
+	mc_wchar_t wc;
+	int size;
+	int j;
+
+	buf[charpos++] = c;
+
+        memset (&mbs, 0, sizeof (mbs));
+	size = mbrtowc(&wc, (char *)buf, charpos, &mbs);
+
+	if (size == -2)
+	    continue; /* incomplete */
+
+	else if (size >= 0) {
+	    edit_insert (edit, wc);
+	    i++;
+	    charpos = 0;
+	    continue;
+	}
+	else {
+
+		/* invalid  */
+#ifdef __STDC_ISO_10646__
+		for (j=0; j<charpos; j++)
+		    edit_insert (edit, BINARY_CHAR_OFFSET + (mc_wchar_t)buf[j]);
+#endif
+		charpos = 0;
+	}
+#endif /* UTF8 */
     }
     return i;
 }
@@ -252,9 +291,32 @@ edit_insert_stream (WEdit * edit, FILE * f)
 long edit_write_stream (WEdit * edit, FILE * f)
 {
     long i;
+#ifndef UTF8
     for (i = 0; i < edit->last_byte; i++)
 	if (fputc (edit_get_byte (edit, i), f) < 0)
 	    break;
+#else /* UTF8 */
+    for (i = 0; i < edit->last_byte; i++) {
+	mc_wchar_t wc = edit_get_byte (edit, i);
+	int res;
+	char tmpbuf[MB_LEN_MAX];
+        mbstate_t mbs;
+
+        memset (&mbs, 0, sizeof (mbs));
+
+#ifdef __STDC_ISO_10646__
+	if (wc >= BINARY_CHAR_OFFSET && wc < (BINARY_CHAR_OFFSET + 256)) {
+	    res = 1;
+	    tmpbuf[0] = (char) (wc - BINARY_CHAR_OFFSET);
+	} else
+#endif
+	res = wcrtomb(tmpbuf, wc, &mbs);
+	if (res > 0) {
+	    if (fwrite(tmpbuf, res, 1, f) != 1)
+		break;
+	}
+    }
+#endif /* UTF8 */
     return i;
 }
 
@@ -293,12 +355,46 @@ edit_insert_file (WEdit *edit, const char *filename)
 	int i, file, blocklen;
 	long current = edit->curs1;
 	unsigned char *buf;
+#ifdef UTF8
+	mbstate_t mbs;
+	int bufstart = 0;
[...6618 lines suppressed...]
     char *text;			/* text of check button */
     int hotkey;                 /* hot KEY */
     int hotpos;			/* offset hot KEY char in text */
+    wchar_t hotwc;
 } WCheck;
 
 typedef struct WGauge {
@@ -74,16 +76,20 @@ char *show_hist (GList *history, int widget_y, int widget_x);
 
 typedef struct {
     Widget widget;
-    int  point;			/* cursor position in the input line */
-    int  mark;			/* The mark position */
-    int  first_shown;		/* Index of the first shown character */
-    int  current_max_len;	/* Maximum length of input line */
-    int  field_len;		/* Length of the editing field */
+    int  point;			/* cursor position in the input line (mb chars) */
+    int  mark;			/* The mark position (mb chars) */
+    int  first_shown;		/* Index of the first shown character (mb chars) */
+    int  current_max_len;	/* Maximum length of input line (bytes) */
+    int  field_len;		/* Length of the editing field (mb chars) */
     int  color;			/* color used */
     int  first;			/* Is first keystroke? */
     int  disable_update;	/* Do we want to skip updates? */
     int  is_password;		/* Is this a password input line? */
     char *buffer;		/* pointer to editing buffer */
+#ifdef UTF8
+    char charbuf[MB_LEN_MAX];
+#endif /* UTF8 */
+    int charpoint;
     GList *history;		/* The history */
     int  need_push;		/* need to push the current Input on hist? */
     char **completions;		/* Possible completions array */
@@ -181,6 +187,10 @@ void button_set_text (WButton *b, const char *text);
 /* 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);
diff --git a/src/wtools.c b/src/wtools.c
index ba317e9..a6eaffa 100644
--- a/src/wtools.c
+++ b/src/wtools.c
@@ -49,11 +49,11 @@ create_listbox_window (int cols, int lines, const char *title, const char *help)
     /* Adjust sizes */
     lines = (lines > LINES - 6) ? LINES - 6 : lines;
 
-    if (title && (cols < (len = strlen (title) + 2)))
+    if (title && (cols < (len = mbstrlen (title) + 2)))
 	cols = len;
 
     /* no &, but 4 spaces around button for brackets and such */
-    if (cols < (len = strlen (cancel_string) + 3))
+    if (cols < (len = mbstrlen (cancel_string) + 3))
 	cols = len;
 
     cols = cols > COLS - 6 ? COLS - 6 : cols;
@@ -124,7 +124,7 @@ query_dialog (const char *header, const char *text, int flags, int count, ...)
 	va_start (ap, count);
 	for (i = 0; i < count; i++) {
 	    char *cp = va_arg (ap, char *);
-	    win_len += strlen (cp) + 6;
+	    win_len += mbstrlen (cp) + 6;
 	    if (strchr (cp, '&') != NULL)
 		win_len--;
 	}
@@ -133,7 +133,7 @@ query_dialog (const char *header, const char *text, int flags, int count, ...)
 
     /* count coordinates */
     msglen (text, &lines, &cols);
-    cols = 6 + max (win_len, max ((int) strlen (header), cols));
+    cols = 6 + max (win_len, max ((int) mbstrlen (header), cols));
     lines += 4 + (count > 0 ? 2 : 0);
     xpos = COLS / 2 - cols / 2;
     ypos = LINES / 3 - (lines - 3) / 2;
@@ -148,7 +148,7 @@ query_dialog (const char *header, const char *text, int flags, int count, ...)
 	va_start (ap, count);
 	for (i = 0; i < count; i++) {
 	    cur_name = va_arg (ap, char *);
-	    xpos = strlen (cur_name) + 6;
+	    xpos = mbstrlen (cur_name) + 6;
 	    if (strchr (cur_name, '&') != NULL)
 		xpos--;
 
@@ -467,7 +467,7 @@ fg_input_dialog_help (const char *header, const char *text, const char *help,
     }
 
     msglen (text, &lines, &cols);
-    len = max ((int) strlen (header), cols) + 4;
+    len = max ((int) mbstrlen (header), cols) + 4;
     len = max (len, 64);
 
     /* The special value of def_text is used to identify password boxes
@@ -489,7 +489,7 @@ fg_input_dialog_help (const char *header, const char *text, const char *help,
     quick_widgets[1].text = _(quick_widgets[1].text);
     quick_widgets[0].relative_x = len / 2 + 4;
     quick_widgets[1].relative_x =
-	len / 2 - (strlen (quick_widgets[1].text) + 9);
+	len / 2 - (mbstrlen (quick_widgets[1].text) + 9);
     quick_widgets[0].x_divisions = quick_widgets[1].x_divisions = len;
 #endif				/* ENABLE_NLS */
 
diff --git a/vfs/vfs.c b/vfs/vfs.c
index 39fdc73..1658eaa 100644
--- a/vfs/vfs.c
+++ b/vfs/vfs.c
@@ -56,6 +56,11 @@
 #include "smbfs.h"
 #include "local.h"
 
+#include "../src/panel.h"
+#ifdef HAVE_CHARSET
+#include "../src/recode.h"
+#endif
+
 /* They keep track of the current directory */
 static struct vfs_class *current_vfs;
 static char *current_dir;
@@ -688,8 +693,66 @@ mc_chdir (const char *path)
     vfsid old_vfsid;
     int result;
 
+#ifdef HAVE_CHARSET
+    char* errmsg;
+#endif
+    WPanel* p=ret_panel;
+
     new_dir = vfs_canon (path);
     new_vfs = vfs_get_class (new_dir);
+    old_vfsid = vfs_getid (current_vfs, current_dir);
+    old_vfs = current_vfs;
+
+    if(p) {
+
+      // Change from localfs to ftpfs
+      ret_panel=NULL;
+      if(    (strcmp(old_vfs->name,"localfs")==0) &&
+            (strcmp(new_vfs->name,"ftpfs")==0)){
+        p->is_return=1;
+        strncpy(p->retdir,current_dir, MC_MAXPATHLEN);
+#ifdef HAVE_CHARSET
+       p->ret_codepage=p->src_codepage;
+        p->src_codepage=ftp_codepage;
+        errmsg=my_init_tt(display_codepage,p->src_codepage,p->tr_table);
+        if(errmsg) {
+          panel_reset_codepage(p);
+          message( 1, MSG_ERROR, "%s", errmsg );
+        }
+        errmsg=my_init_tt(p->src_codepage,display_codepage,p->tr_table_input);
+       if(errmsg) {
+          panel_reset_codepage(p);
+          message( 1, MSG_ERROR, "%s", errmsg );
+        }
+#endif
+      }
+
+      // Change from ftpfs to localfs
+      if(    (strcmp(old_vfs->name,"ftpfs")==0) &&
+            (strcmp(new_vfs->name,"localfs")==0) &&
+             p->is_return){
+        p->is_return=0;
+       g_free(new_dir);
+       new_dir = vfs_canon (p->retdir);
+        new_vfs = vfs_get_class (new_dir);
+#ifdef HAVE_CHARSET
+        p->src_codepage=p->ret_codepage;
+        errmsg=my_init_tt(display_codepage,p->src_codepage,p->tr_table);
+        if(errmsg) {
+          panel_reset_codepage(p);
+          message( 1, MSG_ERROR, "%s", errmsg );
+        }
+        errmsg=my_init_tt(p->src_codepage,display_codepage,p->tr_table_input);
+        if(errmsg) {
+          panel_reset_codepage(p);
+          message( 1, MSG_ERROR, "%s", errmsg );
+        }
+#endif
+      }
+    }
+
+
+
     if (!new_vfs->chdir) {
     	g_free (new_dir);
 	return -1;
@@ -703,9 +766,6 @@ mc_chdir (const char *path)
 	return -1;
     }
 
-    old_vfsid = vfs_getid (current_vfs, current_dir);
-    old_vfs = current_vfs;
-
     /* Actually change directory */
     g_free (current_dir);
     current_dir = new_dir;

mc-edit-segv.patch:

--- NEW FILE mc-edit-segv.patch ---
diff -up mc-4.6.2-pre1/edit/edit.c.segv mc-4.6.2-pre1/edit/edit.c
--- mc-4.6.2-pre1/edit/edit.c.segv	2009-05-15 11:42:08.000000000 +0200
+++ mc-4.6.2-pre1/edit/edit.c	2009-05-15 11:54:29.000000000 +0200
@@ -1808,6 +1808,7 @@ my_type_of (int c)
 	c = '0';
     else if (iswspace (c))
 	c = ' ';
+    if ( c > 0xff ) c = ' ';
 #endif /* UTF8 */
     q = strchr (option_chars_move_whole_word, c);
     if (!q)


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/mc/F-11/.cvsignore,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -r1.36 -r1.37
--- .cvsignore	25 Feb 2008 15:07:57 -0000	1.36
+++ .cvsignore	28 May 2009 08:29:04 -0000	1.37
@@ -1 +1 @@
-mc-4.6.2-pre1.tar.gz
+mc-4.6.2.tar.gz

mc-etcmc.patch:

Index: mc-etcmc.patch
===================================================================
RCS file: /cvs/pkgs/rpms/mc/F-11/mc-etcmc.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- mc-etcmc.patch	25 Feb 2006 11:34:56 -0000	1.1
+++ mc-etcmc.patch	28 May 2009 08:29:04 -0000	1.2
@@ -1,6 +1,66 @@
---- mc-4.6.1a/src/charsets.c.etcmc	2005-05-27 05:35:15.000000000 +0200
-+++ mc-4.6.1a/src/charsets.c	2006-02-24 15:17:05.000000000 +0100
-@@ -45,12 +45,17 @@ load_codepages_list (void)
+diff -up mc-4.6.2/edit/editcmd.c.etcmc mc-4.6.2/edit/editcmd.c
+--- mc-4.6.2/edit/editcmd.c.etcmc	2009-05-26 18:05:21.000000000 +0200
++++ 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 buf[256];
      extern char *mc_home;
@@ -8,135 +68,21 @@
      extern int display_codepage;
      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"))) {
 -	fprintf (stderr, _("Warning: file %s not found\n"), 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"))) {
 +	    fprintf (stderr, _("Warning: file %s not found\n"), fname);
 +        }
  	g_free (fname);
  	return -1;
      }
---- mc-4.6.1a/src/main.h.etcmc	2006-02-24 15:17:05.000000000 +0100
-+++ mc-4.6.1a/src/main.h	2006-02-24 15:17:05.000000000 +0100
-@@ -112,7 +112,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, *mc_home_alt;
- char *get_mc_lib_dir (void);
- 
- int maybe_cd (int move_up_dir);
---- mc-4.6.1a/src/ext.c.etcmc	2005-07-31 22:29:35.000000000 +0200
-+++ mc-4.6.1a/src/ext.c	2006-02-24 15:17:05.000000000 +0100
-@@ -444,6 +444,10 @@ regex_command (const char *filename, con
- 	    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
- if CONS_SAVER
- pkglibexec_PROGRAMS = cons.saver
- AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
--	-DSAVERDIR=\""$(pkglibexecdir)"\"
-+	-DSAVERDIR=\""$(pkglibexecdir)"\" \
-+	-DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
- else
--AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"
-+AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
-+	-DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
- endif
- 
- noinst_PROGRAMS = man2hlp
---- mc-4.6.1a/src/util.c.etcmc	2006-02-24 15:17:05.000000000 +0100
-+++ mc-4.6.1a/src/util.c	2006-02-24 15:17:05.000000000 +0100
-@@ -40,7 +40,7 @@
- #include "tty.h"
- #include "global.h"
- #include "profile.h"
--#include "main.h"		/* mc_home */
-+#include "main.h"		/* mc_home, mc_home_alt */
- #include "cmd.h"		/* guess_message_value */
- #include "mountlist.h"
- #include "win.h"		/* xterm_flag */
-@@ -950,16 +950,25 @@ load_mc_home_file (const char *filename,
- 
-     if (!data) {
- 	g_free (hintfile);
--	/* Fall back to the two-letter language code */
--	if (lang[0] && lang[1])
--	    lang[2] = 0;
-+	g_free (hintfile_base);
-+
-+	hintfile_base = concat_dir_and_file (mc_home_alt, filename);
-+
- 	hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
- 	data = load_file (hintfile);
--
-+	
- 	if (!data) {
--	    g_free (hintfile);
--	    hintfile = hintfile_base;
--	    data = load_file (hintfile_base);
-+	    /* Fall back to the two-letter language code */
-+	    if (lang[0] && lang[1])
-+	        lang[2] = 0;
-+	    hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
-+	    data = load_file (hintfile);
-+
-+	    if (!data) {
-+	        g_free (hintfile);
-+	        hintfile = hintfile_base;
-+	        data = load_file (hintfile_base);
-+	    }
- 	}
-     }
- 
---- mc-4.6.1a/src/cmd.c.etcmc	2006-02-04 12:12:28.000000000 +0100
-+++ mc-4.6.1a/src/cmd.c	2006-02-24 15:17:05.000000000 +0100
-@@ -570,8 +570,13 @@ void ext_cmd (void)
+diff -up mc-4.6.2/src/cmd.c.etcmc mc-4.6.2/src/cmd.c
+--- mc-4.6.2/src/cmd.c.etcmc	2009-05-26 18:05:21.000000000 +0200
++++ 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);
@@ -144,50 +90,65 @@
 +    } else if (dir == 1) {
 +    	if (!exist_file(extdir)) {
 +	    g_free (extdir);
-+	    extdir = concat_dir_and_file (mc_home_alt, MC_LIB_EXT);
++	    extdir = mhl_str_dir_plus_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)
+@@ -616,6 +621,11 @@ menu_edit_cmd (int where)
      );
  
-     menufile = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+     menufile = mhl_str_dir_plus_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);
++    	menufile = mhl_str_dir_plus_file (mc_home_alt, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
 +    }
  
      switch (dir) {
  	case 0:
-@@ -608,6 +618,10 @@ menu_edit_cmd (int where)
+@@ -630,6 +640,10 @@ menu_edit_cmd (int where)
  	
  	case 2:
- 	    buffer = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
+ 	    buffer = mhl_str_dir_plus_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);
++	        buffer = mhl_str_dir_plus_file (mc_home_alt, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
 +	    }
  	    break;
  
  	default:
-@@ -666,7 +680,7 @@ edit_syntax_cmd (void)
+@@ -688,7 +702,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");
+-    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 = 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;
+ 	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 */
@@ -199,7 +160,7 @@
  char cmd_buf[512];
  
  static void
-@@ -1817,8 +1820,9 @@ OS_Setup (void)
+@@ -1858,8 +1861,9 @@ OS_Setup (void)
      if ((mc_libdir = getenv ("MC_DATADIR")) != NULL) {
  	mc_home = g_strdup (mc_libdir);
      } else {
@@ -210,7 +171,7 @@
  }
  
  static void
-@@ -1948,7 +1952,7 @@ process_args (poptContext ctx, int c, co
+@@ -1989,7 +1993,7 @@ process_args (poptContext ctx, int c, co
  	break;
  
      case 'f':
@@ -219,7 +180,7 @@
  	exit (0);
  	break;
  
-@@ -2326,6 +2330,7 @@ main (int argc, char *argv[])
+@@ -2339,6 +2343,7 @@ main (int argc, char *argv[])
      }
      g_free (last_wd_string);
  
@@ -227,118 +188,169 @@
      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
+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 *edit_one_file;
+-extern char *mc_home;
++extern char *mc_home, *mc_home_alt;
+ char *get_mc_lib_dir (void);
+ 
+ int maybe_cd (int move_up_dir);
+diff -up mc-4.6.2/src/Makefile.am.etcmc mc-4.6.2/src/Makefile.am
+--- mc-4.6.2/src/Makefile.am.etcmc	2009-05-26 18:05:21.000000000 +0200
++++ mc-4.6.2/src/Makefile.am	2009-05-26 18:05:21.000000000 +0200
+@@ -8,9 +8,11 @@ bin_PROGRAMS = mc mcmfmt
+ if CONS_SAVER
+ pkglibexec_PROGRAMS = cons.saver
+ AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
+-	-DSAVERDIR=\""$(pkglibexecdir)"\"
++	-DSAVERDIR=\""$(pkglibexecdir)"\" \
++	-DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
+ else
+-AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"
++AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
++	-DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
+ endif
+ 
+ noinst_PROGRAMS = man2hlp
+diff -up mc-4.6.2/src/Makefile.in.etcmc mc-4.6.2/src/Makefile.in
+--- mc-4.6.2/src/Makefile.in.etcmc	2009-02-01 20:46:26.000000000 +0100
++++ 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@
 - at CONS_SAVER_FALSE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"
-+ at CONS_SAVER_FALSE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
-+ at CONS_SAVER_FALSE@	-DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
- @CONS_SAVER_TRUE at AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
+- at CONS_SAVER_TRUE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
 - at CONS_SAVER_TRUE@	-DSAVERDIR=\""$(pkglibexecdir)"\"
-+ at CONS_SAVER_TRUE@	-DSAVERDIR=\""$(pkglibexecdir)"\" -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
++ at CONS_SAVER_FALSE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
++ at CONS_SAVER_TRUE@AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" -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
+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 = concat_dir_and_file \
+ 	    menu = mhl_str_dir_plus_file \
                          (mc_home, edit_widget ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
 +	    if (!exist_file (menu)) {
 +	        g_free (menu);
-+	        menu = concat_dir_and_file \
++	        menu = mhl_str_dir_plus_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;
+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 "global.h"
+ #include "profile.h"
+-#include "main.h"		/* mc_home */
++#include "main.h"		/* mc_home, mc_home_alt */
+ #include "cmd.h"		/* guess_message_value */
+ #include "mountlist.h"
+ #include "win.h"		/* xterm_flag */
+@@ -978,16 +978,25 @@ load_mc_home_file (const char *filename,
+ 
+     if (!data) {
+ 	g_free (hintfile);
+-	/* Fall back to the two-letter language code */
+-	if (lang[0] && lang[1])
+-	    lang[2] = 0;
++	g_free (hintfile_base);
++
++	hintfile_base = mhl_str_dir_plus_file (mc_home_alt, filename);
++
+ 	hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
+ 	data = load_file (hintfile);
+-
++	
+ 	if (!data) {
+-	    g_free (hintfile);
+-	    hintfile = hintfile_base;
+-	    data = load_file (hintfile_base);
++	    /* Fall back to the two-letter language code */
++	    if (lang[0] && lang[1])
++	        lang[2] = 0;
++	    hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
++	    data = load_file (hintfile);
++
++	    if (!data) {
++	        g_free (hintfile);
++	        hintfile = hintfile_base;
++	        data = load_file (hintfile_base);
 +	    }
  	}
- 	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
+diff -up mc-4.6.2/vfs/extfs.c.etcmc mc-4.6.2/vfs/extfs.c
+--- mc-4.6.2/vfs/extfs.c.etcmc	2009-02-01 20:30:21.000000000 +0100
++++ mc-4.6.2/vfs/extfs.c	2009-05-26 18:05:21.000000000 +0200
+@@ -249,7 +249,7 @@ extfs_open_archive (int fstype, const ch
  	tmp = name_quote (name, 0);
      }
  
--    mc_extfsdir = concat_dir_and_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, "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[fstype], " list ",
  		     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);
      quoted_localname = name_quote (localname, 0);
  
--    mc_extfsdir = concat_dir_and_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, "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],
  		       extfs_cmd, archive_name, " ", quoted_file, " ",
  		       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);
  
      archive_name = name_quote (extfs_get_archive_name (archive), 0);
--    mc_extfsdir = concat_dir_and_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, "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],
  		       " run ", archive_name, " ", q, (char *) NULL);
      g_free (mc_extfsdir);

mc-extensions.patch:

Index: mc-extensions.patch
===================================================================
RCS file: /cvs/pkgs/rpms/mc/F-11/mc-extensions.patch,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- mc-extensions.patch	7 Mar 2008 14:37:40 -0000	1.11
+++ mc-extensions.patch	28 May 2009 08:29:04 -0000	1.12
@@ -1,7 +1,19 @@
-diff -up mc-4.6.2-pre1/configure.extensions mc-4.6.2-pre1/configure
---- mc-4.6.2-pre1/configure.extensions	2007-09-11 16:33:32.000000000 +0200
-+++ mc-4.6.2-pre1/configure	2008-03-07 14:28:51.000000000 +0100
-@@ -5736,7 +5736,7 @@
+diff -up mc-4.6.2/configure.ac.extensions mc-4.6.2/configure.ac
+--- mc-4.6.2/configure.ac.extensions	2009-02-01 20:30:21.000000000 +0100
++++ mc-4.6.2/configure.ac	2009-05-26 14:42:48.000000000 +0200
+@@ -81,7 +81,7 @@ AC_PROG_LN_S
+ AC_CHECK_TOOL(AR, ar, ar)
+ 
+ dnl Only list browsers here that can be run in background (i.e. with `&')
+-AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla konqueror opera netscape])
++AC_CHECK_PROGS(X11_WWW, [firefox gnome-moz-remote mozilla konqueror opera netscape])
+ 
+ dnl
+ dnl Ovverriding mmap support.  This has to be before AC_FUNC_MMAP is used.
+diff -up mc-4.6.2/configure.extensions mc-4.6.2/configure
+--- mc-4.6.2/configure.extensions	2009-02-01 20:46:23.000000000 +0100
++++ mc-4.6.2/configure	2009-05-26 14:42:48.000000000 +0200
+@@ -6843,7 +6843,7 @@ else
  fi
  
  
@@ -10,10 +22,10 @@ diff -up mc-4.6.2-pre1/configure.extensi
  do
    # Extract the first word of "$ac_prog", so it can be a program name with args.
  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
---- mc-4.6.2-pre1/lib/mc.ext.in.extensions	2006-12-28 04:57:01.000000000 +0100
-+++ mc-4.6.2-pre1/lib/mc.ext.in	2008-03-07 14:28:31.000000000 +0100
-@@ -119,6 +119,11 @@
+diff -up mc-4.6.2/lib/mc.ext.in.extensions mc-4.6.2/lib/mc.ext.in
+--- mc-4.6.2/lib/mc.ext.in.extensions	2009-02-01 20:30:21.000000000 +0100
++++ 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)$
  	Open=%cd %p#utar
  	View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
  
@@ -25,7 +37,18 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  # .tar.F - used in QNX
  regex/\.tar\.F$
  	# Open=%cd %p#utar
-@@ -220,14 +225,25 @@
+@@ -198,8 +203,8 @@ regex/\.(rpm|spm)$
+ 
+ # deb
+ regex/\.u?deb$
+-	Open=%cd %p#deb
+-	View=%view{ascii} dpkg-deb -I %f && echo && dpkg-deb -c %f
++	Open=%cd %p#uar
++	View=%view{ascii} file %f && nm %f
+ 
+ # ISO9660
+ regex/\.iso$
+@@ -220,14 +225,25 @@ type/^ASCII\ mail\ text
  
  # C
  shell/.c
@@ -54,7 +77,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  	Open=%var{EDITOR:vi} %f
  
  # Object
-@@ -251,10 +267,12 @@
+@@ -251,10 +267,12 @@ regex/\.(te?xi|texinfo)$
  
  # GNU Info page
  type/^Info\ text
@@ -69,7 +92,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  
  # Manual page
  # Exception - .so libraries are not manual pages
-@@ -298,6 +316,10 @@
+@@ -298,6 +316,10 @@ regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|
  	Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
  	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
  
@@ -80,7 +103,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  
  ### Images ###
  
-@@ -328,18 +350,24 @@
+@@ -328,18 +350,24 @@ type/^PPM
  type/^Netpbm
  	Include=image
  
@@ -107,7 +130,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  	View=%view{ascii} identify %f
  	#View=%view{ascii} asciiview %f
  
-@@ -347,7 +375,8 @@
+@@ -347,7 +375,8 @@ include/image
  ### Sound files ###
  
  regex/\.([wW][aA][vV]|[sS][nN][dD]|[vV][oO][cC]|[aA][uU]|[sS][mM][pP]|[aA][iI][fF][fF]|[sS][nN][dD])$
@@ -117,7 +140,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  
  regex/\.([mM][oO][dD]|[sS]3[mM]|[xX][mM]|[iI][tT]|[mM][tT][mM]|669|[sS][tT][mM]|[uU][lL][tT]|[fF][aA][rR])$
         Open=mikmod %f
-@@ -357,11 +386,16 @@
+@@ -357,11 +386,16 @@ regex/\.([wW][aA][wW]22)$
         Open=vplay -s 22 %f
  
  regex/\.([mM][pP]3)$
@@ -137,7 +160,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  	View=%view{ascii} ogginfo %s
  
  regex/\.([mM][iI][dD][iI]?|[rR][mM][iI][dD]?)$
-@@ -371,11 +405,15 @@
+@@ -371,11 +405,15 @@ regex/\.([wW][mM][aA])$
  	Open=mplayer -vo null %f
  	View=%view{ascii} mplayer -quiet -slave -frames 0 -vo null -ao null -identify %f 2>/dev/null | tail +13 || file %f
  
@@ -154,23 +177,17 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  
  
  ### Video ###
-@@ -395,20 +433,27 @@
- regex/\.([mM][pP]4|[mM][pP][eE]?[gG])$
+@@ -389,6 +427,9 @@ regex/\.([aA][sS][fFxX])$
+ regex/\.([dD][iI][vV][xX])$
  	Include=video
  
 +regex/\.([mM][kK][vV])$
 +	Include=video
 +
- regex/\.([vV][oO][bB])$
+ regex/\.([mM][oO][vV]|[qQ][tT])$
  	Include=video
  
- regex/\.([wW][mM][vV])$
- 	Include=video
- 
-+regex/\.([fF][lL][iIcC])$
-+	Include=video
-+
- regex/\.([oO][gG][mM])$
+@@ -408,10 +449,11 @@ regex/\.([oO][gG][mM])$
  	Include=video
  
  regex/\.([rR][aA]?[mM])$
@@ -183,7 +200,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  	#Open=(gtv %f >/dev/null 2>&1 &)
  	#Open=(xanim %f >/dev/null 2>&1 &)
  
-@@ -417,12 +462,13 @@
+@@ -420,12 +462,13 @@ include/video
  
  # Postscript
  type/^PostScript
@@ -199,7 +216,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  	#Open=(acroread %f &)
  	#Open=(ghostview %f &)
  	View=%view{ascii} pdftotext %f -
-@@ -433,7 +479,7 @@
+@@ -436,7 +479,7 @@ type/^PDF
  # html
  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
@@ -208,7 +225,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  
  # StarOffice 5.2
  shell/.sdw
-@@ -450,22 +496,27 @@
+@@ -453,22 +496,27 @@ shell/.abw
  
  # Microsoft Word Document
  regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
@@ -241,7 +258,7 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  	View=%view{ascii} xls2csv %f || strings %f
  
  # Use OpenOffice.org to open any MS Office documents
-@@ -542,6 +593,11 @@
+@@ -545,6 +593,11 @@ type/^compress
  	Open=gzip -dc %f | %var{PAGER:more}
  	View=%view{ascii} gzip -dc %f 2>/dev/null
  
@@ -253,15 +270,3 @@ diff -up mc-4.6.2-pre1/lib/mc.ext.in.ext
  
  ### Default ###
  
-diff -up mc-4.6.2-pre1/configure.ac.extensions mc-4.6.2-pre1/configure.ac
---- mc-4.6.2-pre1/configure.ac.extensions	2007-09-10 16:25:30.000000000 +0200
-+++ mc-4.6.2-pre1/configure.ac	2008-03-07 14:28:51.000000000 +0100
-@@ -83,7 +83,7 @@
- AC_CHECK_TOOL(AR, ar, ar)
- 
- dnl Only list browsers here that can be run in background (i.e. with `&')
--AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla konqueror opera netscape])
-+AC_CHECK_PROGS(X11_WWW, [firefox gnome-moz-remote mozilla konqueror opera netscape])
- 
- dnl
- dnl Ovverriding mmap support.  This has to be before AC_FUNC_MMAP is used.

mc-newlinedir.patch:

Index: mc-newlinedir.patch
===================================================================
RCS file: /cvs/pkgs/rpms/mc/F-11/mc-newlinedir.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- mc-newlinedir.patch	20 Nov 2006 14:08:49 -0000	1.1
+++ mc-newlinedir.patch	28 May 2009 08:29:04 -0000	1.2
@@ -1,9 +1,10 @@
---- mc-2006-11-14-16/src/main.c.newlinedir	2006-11-20 14:54:21.000000000 +0100
-+++ mc-2006-11-14-16/src/main.c	2006-11-20 14:47:52.000000000 +0100
-@@ -647,7 +647,7 @@
-     }
+diff -up mc-4.6.2/src/main.c.newlinedir mc-4.6.2/src/main.c
+--- mc-4.6.2/src/main.c.newlinedir	2009-05-26 15:55:43.000000000 +0200
++++ 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;
  
+     ret_panel=panel;
 -    if (mc_chdir (directory) == -1) {
 +    if (strchr(directory,'\n') || mc_chdir (directory) == -1) {
  	strcpy (panel->cwd, olddir);

mc-showfree.patch:

Index: mc-showfree.patch
===================================================================
RCS file: /cvs/pkgs/rpms/mc/F-11/mc-showfree.patch,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- mc-showfree.patch	15 Feb 2007 14:11:18 -0000	1.11
+++ mc-showfree.patch	28 May 2009 08:29:04 -0000	1.12
@@ -1,133 +1,7 @@
---- mc-2007-01-24-03/src/setup.c.showfree	2006-02-23 16:45:06.000000000 +0100
-+++ mc-2007-01-24-03/src/setup.c	2007-02-15 09:53:48.000000000 +0100
-@@ -134,6 +134,7 @@
-     { "show_mini_info", &show_mini_info },
-     { "permission_mode", &permission_mode },
-     { "filetype_mode", &filetype_mode },
-+    { "free_space", &free_space },
-     { 0, 0 }
- };
- 
---- mc-2007-01-24-03/src/main.c.showfree	2007-02-15 09:53:48.000000000 +0100
-+++ mc-2007-01-24-03/src/main.c	2007-02-15 09:53:48.000000000 +0100
-@@ -61,6 +61,7 @@
- #include "listmode.h"
- #include "execute.h"
- #include "ext.h"		/* For flush_extension_file() */
-+#include "mountlist.h"		/* my_statfs */
- 
- /* Listbox for the command history feature */
- #include "widget.h"
-@@ -231,6 +232,12 @@
- /* We need to paint it after CONSOLE_RESTORE, see: load_prompt */
- int update_prompt = 0;
- 
-+/* Old current working directory for displaying free space */
-+char *old_cwd = NULL;
-+
-+/* Used to figure out how many free space we have */
-+struct my_statfs myfs_stats;
-+
- /* The home directory */
- const char *home_dir = NULL;
- 
-@@ -402,6 +409,8 @@
-     int reload_other = !(force_update & UP_ONLY_CURRENT);
-     WPanel *panel;
- 
-+    show_free_space(current_panel);
-+
-     update_one_panel (get_current_index (), force_update, current_file);
-     if (reload_other)
- 	update_one_panel (get_other_index (), force_update, UP_KEEPSEL);
-@@ -467,6 +476,38 @@
-     }
- }
- 
-+void
-+show_free_space(WPanel *panel)
-+{
-+    /* Don't try to stat non-local fs */
-+    if (!vfs_file_is_local(panel->cwd) || !free_space)
-+	return;
-+   
-+    if (old_cwd == NULL || strcmp(old_cwd, panel->cwd) != 0) {
-+	char rpath[PATH_MAX];
-+    
-+	init_my_statfs();
-+	g_free(old_cwd);
-+	old_cwd = g_strdup(panel->cwd);
-+	
-+	if (mc_realpath (panel->cwd, rpath) == NULL)
-+            return;
-+	my_statfs (&myfs_stats, rpath);
-+    }
-+   
-+    if (myfs_stats.avail > 0 || myfs_stats.total > 0) {
-+	char buffer1 [6], buffer2[6], *tmp;
-+	size_trunc_len (buffer1, 5, myfs_stats.avail, 1);
-+	size_trunc_len (buffer2, 5, myfs_stats.total, 1);
-+	tmp = g_strdup_printf (_("%s (%d%%) of %s"), buffer1, myfs_stats.total > 0 ?
-+			       (int)(100 * (double)myfs_stats.avail / myfs_stats.total) : 0,
-+			       buffer2);
-+	widget_move (&panel->widget, panel->widget.lines-1, panel->widget.cols-2-strlen(tmp));
-+	addstr (tmp);
-+	g_free (tmp);
-+    }
-+}
-+                                                                                                                                                                                                                                 
- static int
- quit_cmd_internal (int quiet)
- {
---- mc-2007-01-24-03/src/main.h.showfree	2007-02-15 09:53:48.000000000 +0100
-+++ mc-2007-01-24-03/src/main.h	2007-02-15 09:53:48.000000000 +0100
-@@ -55,6 +55,7 @@
- extern int show_all_if_ambiguous;
- extern int slow_terminal;
- extern int update_prompt;	/* To comunicate with subshell */
-+extern char *old_cwd;
- extern int safe_delete;
- extern int confirm_delete;
- extern int confirm_directory_hotlist_delete;
-@@ -102,6 +103,7 @@
- int load_prompt     (int, void *);
- void save_cwds_stat (void);
- void quiet_quit_cmd (void);	/* For cmd.c and command.c */
-+void show_free_space(WPanel *panel);
- 
- void touch_bar      (void);
- void update_xterm_title_path (void);
---- mc-2007-01-24-03/src/screen.c.showfree	2007-02-15 09:53:48.000000000 +0100
-+++ mc-2007-01-24-03/src/screen.c	2007-02-15 09:53:48.000000000 +0100
-@@ -47,7 +47,7 @@
- #include "widget.h"
- #include "menu.h"		/* menubar_visible */
- #define WANT_WIDGETS
--#include "main.h"		/* the_menubar */
-+#include "main.h"		/* the_menubar, show_free_space() */
- #include "unixcompat.h"
- 
- #define ELEMENTS(arr) ( sizeof(arr) / sizeof((arr)[0]) )
-@@ -866,6 +866,7 @@
-     hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
- 	   panel->widget.cols - 2);
- #endif				/* !HAVE_SLANG */
-+    show_free_space (panel);
- }
- 
- static void
-@@ -910,6 +911,8 @@
-     widget_move (&panel->widget, 0, panel->widget.cols - 3);
-     addstr ("v");
- 
-+    mini_info_separator (panel);
-+
-     if (panel->active)
- 	standend ();
- }
---- mc-2007-01-24-03/src/layout.c.showfree	2007-02-15 09:53:47.000000000 +0100
-+++ mc-2007-01-24-03/src/layout.c	2007-02-15 09:53:48.000000000 +0100
-@@ -96,6 +96,9 @@
+diff -up mc-4.6.2/src/layout.c.showfree mc-4.6.2/src/layout.c
+--- mc-4.6.2/src/layout.c.showfree	2009-05-26 14:57:36.000000000 +0200
++++ mc-4.6.2/src/layout.c	2009-05-26 14:57:36.000000000 +0200
+@@ -97,6 +97,9 @@ int message_visible = 1;
  /* Set to show current working dir in xterm window title */
  int xterm_title = 1;
  
@@ -137,7 +11,7 @@
  /* The starting line for the output of the subprogram */
  int output_start_y = 0;
  
-@@ -125,6 +128,7 @@
+@@ -126,6 +129,7 @@ static int _command_prompt;
  static int _keybar_visible;
  static int _message_visible;
  static int _xterm_title;
@@ -145,7 +19,7 @@
  static int _permission_mode;
  static int _filetype_mode;
  
-@@ -155,6 +159,7 @@
+@@ -156,6 +160,7 @@ static struct {
      int    *variable;
      WCheck *widget;
  } check_options [] = {
@@ -153,7 +27,7 @@
      { N_("&Xterm window title"), &xterm_title,   0 },
      { N_("h&Intbar visible"),  &message_visible, 0 },
      { N_("&Keybar visible"),   &keybar_visible,  0 },
-@@ -226,8 +231,8 @@
+@@ -227,8 +232,8 @@ static int b2left_cback (int action)
      if (_equal_split){
  	/* Turn equal split off */
  	_equal_split = 0;
@@ -164,7 +38,7 @@
  	dlg_select_widget (bleft_widget);
      }
      _first_panel_size++;
-@@ -241,8 +246,8 @@
+@@ -242,8 +247,8 @@ static int b2right_cback (int action)
      if (_equal_split){
  	/* Turn equal split off */
  	_equal_split = 0;
@@ -175,7 +49,7 @@
  	dlg_select_widget (bright_widget);
      }
      _first_panel_size--;
-@@ -288,23 +293,24 @@
+@@ -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);
@@ -210,7 +84,7 @@
  	if (console_flag){
  	    int minimum;
  	    if (_output_lines < 0)
-@@ -332,7 +338,7 @@
+@@ -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);
@@ -219,7 +93,7 @@
  		tty_printf ("%02d", _output_lines);
  	    }
  	}
-@@ -371,7 +377,7 @@
+@@ -372,7 +378,7 @@ init_layout (void)
  		first_width = l1;
  	}
  
@@ -228,7 +102,7 @@
  	    check_options[i].text = _(check_options[i].text);
  	    l1 = mbstrlen (check_options[i].text) + 7;
  	    if (l1 > first_width)
-@@ -388,7 +394,7 @@
+@@ -389,7 +395,7 @@ init_layout (void)
  
  
  	second_width = mbstrlen (title3) + 1;
@@ -237,7 +111,7 @@
  	    check_options[i].text = _(check_options[i].text);
  	    l1 = mbstrlen (check_options[i].text) + 7;
  	    if (l1 > second_width)
-@@ -443,23 +449,23 @@
+@@ -444,23 +450,23 @@ init_layout (void)
  			    0));
      if (console_flag) {
  	add_widget (layout_dlg,
@@ -268,7 +142,7 @@
  
      _filetype_mode = filetype_mode;
      _permission_mode = permission_mode;
-@@ -469,20 +475,21 @@
+@@ -470,20 +476,21 @@ init_layout (void)
      _keybar_visible = keybar_visible;
      _message_visible = message_visible;
      _xterm_title = xterm_title;
@@ -292,9 +166,10 @@
      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 @@
+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;
@@ -302,3 +177,134 @@
  
  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 "execute.h"
+ #include "ext.h"		/* For flush_extension_file() */
++#include "mountlist.h"		/* my_statfs */
+ 
+ /* Listbox for the command history feature */
+ #include "widget.h"
+@@ -233,6 +234,12 @@ Dlg_head *midnight_dlg;
+ /* We need to paint it after CONSOLE_RESTORE, see: load_prompt */
+ int update_prompt = 0;
+ 
++/* Old current working directory for displaying free space */
++char *old_cwd = NULL;
++
++/* Used to figure out how many free space we have */
++struct my_statfs myfs_stats;
++
+ /* The home directory */
+ const char *home_dir = NULL;
+ 
+@@ -404,6 +411,8 @@ update_panels (int force_update, const c
+     int reload_other = !(force_update & UP_ONLY_CURRENT);
+     WPanel *panel;
+ 
++    show_free_space(current_panel);
++
+     update_one_panel (get_current_index (), force_update, current_file);
+     if (reload_other)
+ 	update_one_panel (get_other_index (), force_update, UP_KEEPSEL);
+@@ -469,6 +478,38 @@ stop_dialogs (void)
+     }
+ }
+ 
++void
++show_free_space(WPanel *panel)
++{
++    /* Don't try to stat non-local fs */
++    if (!vfs_file_is_local(panel->cwd) || !free_space)
++	return;
++   
++    if (old_cwd == NULL || strcmp(old_cwd, panel->cwd) != 0) {
++	char rpath[PATH_MAX];
++    
++	init_my_statfs();
++	g_free(old_cwd);
++	old_cwd = g_strdup(panel->cwd);
++	
++	if (mc_realpath (panel->cwd, rpath) == NULL)
++            return;
++	my_statfs (&myfs_stats, rpath);
++    }
++   
++    if (myfs_stats.avail > 0 || myfs_stats.total > 0) {
++	char buffer1 [6], buffer2[6], *tmp;
++	size_trunc_len (buffer1, 5, myfs_stats.avail, 1);
++	size_trunc_len (buffer2, 5, myfs_stats.total, 1);
++	tmp = g_strdup_printf (_("%s (%d%%) of %s"), buffer1, myfs_stats.total > 0 ?
++			       (int)(100 * (double)myfs_stats.avail / myfs_stats.total) : 0,
++			       buffer2);
++	widget_move (&panel->widget, panel->widget.lines-1, panel->widget.cols-2-strlen(tmp));
++	addstr (tmp);
++	g_free (tmp);
++    }
++}
++                                                                                                                                                                                                                                 
+ static int
+ quit_cmd_internal (int quiet)
+ {
+diff -up mc-4.6.2/src/main.h.showfree mc-4.6.2/src/main.h
+--- mc-4.6.2/src/main.h.showfree	2009-05-26 14:57:36.000000000 +0200
++++ 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 slow_terminal;
+ extern int update_prompt;	/* To comunicate with subshell */
++extern char *old_cwd;
+ extern int safe_delete;
+ extern int confirm_delete;
+ extern int confirm_directory_hotlist_delete;
+@@ -102,6 +103,7 @@ void change_panel   (void);
+ int load_prompt     (int, void *);
+ void save_cwds_stat (void);
+ void quiet_quit_cmd (void);	/* For cmd.c and command.c */
++void show_free_space(WPanel *panel);
+ 
+ void touch_bar      (void);
+ void update_xterm_title_path (void);
+diff -up mc-4.6.2/src/screen.c.showfree mc-4.6.2/src/screen.c
+--- mc-4.6.2/src/screen.c.showfree	2009-05-26 14:57:36.000000000 +0200
++++ mc-4.6.2/src/screen.c	2009-05-26 14:59:37.000000000 +0200
+@@ -49,7 +49,7 @@
+ #include "widget.h"
+ #include "menu.h"		/* menubar_visible */
+ #define WANT_WIDGETS
+-#include "main.h"		/* the_menubar */
++#include "main.h"		/* the_menubar, show_free_space() */
+ #include "unixcompat.h"
+ 
+ #ifdef HAVE_CHARSET
+@@ -884,6 +884,7 @@ mini_info_separator (WPanel *panel)
+     hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
+ 	   panel->widget.cols - 2);
+ #endif				/* !HAVE_SLANG */
++    show_free_space (panel);
+ }
+ 
+ void
+@@ -938,6 +939,8 @@ show_dir (WPanel *panel)
+     widget_move (&panel->widget, 0, panel->widget.cols - 3);
+     addstr ("v");
+ 
++    mini_info_separator (panel);
++
+     if (panel->active)
+ 	standend ();
+ }
+diff -up mc-4.6.2/src/setup.c.showfree mc-4.6.2/src/setup.c
+--- mc-4.6.2/src/setup.c.showfree	2009-05-26 14:57:36.000000000 +0200
++++ mc-4.6.2/src/setup.c	2009-05-26 14:57:36.000000000 +0200
+@@ -138,6 +138,7 @@ static const struct {
+     { "show_mini_info", &show_mini_info },
+     { "permission_mode", &permission_mode },
+     { "filetype_mode", &filetype_mode },
++    { "free_space", &free_space },
+     { 0, 0 }
+ };
+ 

mc-userhost.patch:

Index: mc-userhost.patch
===================================================================
RCS file: /cvs/pkgs/rpms/mc/F-11/mc-userhost.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- mc-userhost.patch	17 Oct 2005 13:48:53 -0000	1.4
+++ mc-userhost.patch	28 May 2009 08:29:05 -0000	1.5
@@ -1,14 +1,51 @@
---- mc-4.6.1a/src/main.c.userhost	2005-10-16 18:11:07.000000000 +0200
-+++ mc-4.6.1a/src/main.c	2005-10-16 18:14:26.000000000 +0200
-@@ -28,6 +28,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <pwd.h>
- 
- #include <sys/types.h>
- #include <sys/stat.h>
-@@ -1608,9 +1609,22 @@ void
+diff -up mc-4.6.2/edit/editwidget.c.userhost mc-4.6.2/edit/editwidget.c
+--- mc-4.6.2/edit/editwidget.c.userhost	2009-05-26 14:45:19.000000000 +0200
++++ mc-4.6.2/edit/editwidget.c	2009-05-26 14:49:35.000000000 +0200
+@@ -46,6 +46,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;
+@@ -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)
  {
      char *p, *s;
@@ -16,6 +53,7 @@
 +    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 */
@@ -31,19 +69,30 @@
  	do {
  #ifndef UTF8
  	    if (!is_printable ((unsigned char) *s))
---- mc-4.6.1a/src/main.h.viewfile	2005-09-05 04:10:48.000000000 +0200
-+++ mc-4.6.1a/src/main.h	2005-10-17 14:41:46.000000000 +0200
-@@ -67,6 +67,7 @@ extern int alternate_plus_minus;
+@@ -1639,7 +1656,7 @@ update_xterm_title_path (void)
+ 	    numeric_keypad_mode ();
+ 	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 output_starts_shell;
  extern int midnight_shutdown;
 +extern char *xterm_title_str;
+ extern gboolean is_utf8;
  extern char cmd_buf [512];
  extern const char *shell;
- 
---- mc-4.6.1a/src/view.c.viewfile	2005-10-17 14:41:46.000000000 +0200
-+++ mc-4.6.1a/src/view.c	2005-10-17 15:11:54.000000000 +0200
-@@ -3344,6 +3344,11 @@ mc_internal_viewer (const char *command,
+diff -up mc-4.6.2/src/view.c.userhost mc-4.6.2/src/view.c
+--- mc-4.6.2/src/view.c.userhost	2009-05-26 14:45:19.000000000 +0200
++++ mc-4.6.2/src/view.c	2009-05-26 14:45:19.000000000 +0200
+@@ -3368,6 +3368,11 @@ mc_internal_viewer (const char *command,
      WButtonBar *bar;
      Dlg_head *view_dlg;
  
@@ -55,7 +104,7 @@
      /* Create dialog and widgets, put them on the dialog */
      view_dlg =
  	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);
  
@@ -64,65 +113,3 @@
      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;
- }


Index: mc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mc/F-11/mc.spec,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -p -r1.139 -r1.140
--- mc.spec	25 Feb 2009 23:57:54 -0000	1.139
+++ mc.spec	28 May 2009 08:29:05 -0000	1.140
@@ -1,40 +1,38 @@
 Summary:	User-friendly text console file manager and visual shell
 Name:		mc
 Version:	4.6.2
-Release:	9.pre1%{?dist}
+Release:	10%{?dist}
 Epoch:		1
 License:	GPLv2
 Group:		System Environment/Shells
-Source0:	http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/snapshots/mc-%{version}-pre1.tar.gz
-URL:		http://www.ibiblio.org/mc/
+# tarball from http://www.midnight-commander.org/downloads/3
+Source0:	mc-%{version}.tar.gz
+URL:		http://www.midnight-commander.org/
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	glib2-devel e2fsprogs-devel slang-devel
+BuildRequires:	gettext cvs automake autoconf
 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
 Patch2:		mc-userhost.patch
 Patch3:		mc-64bit.patch
-Patch4:		mc-utf8-look-and-feel.patch
-Patch5:		mc-concat.patch
 Patch6:		mc-showfree.patch
 Patch7:		mc-cedit.patch
 Patch8:		mc-delcheck.patch
 Patch9:		mc-etcmc.patch
 Patch10:	mc-exit.patch
-Patch11:	mc-utf8-8bit-hex.patch
 Patch12:	mc-ipv6.patch
 Patch13:	mc-newlinedir.patch
-Patch14:	mc-cloexec.patch
 Patch15:	mc-prompt.patch
 Patch16:	mc-refresh.patch
-Patch17:	mc-preserveattr.patch
 Patch18:	mc-lzma.patch
 Patch19:	mc-hintchk.patch
-Patch20:	mc-7zip.patch
 Patch21:	mc-oldrpmtags.patch
 Patch22:	mc-shellcwd.patch
 Patch23:	mc-cedit-configurable-highlight.patch
+Patch24:	mc-edit-segv.patch
 
 %description
 Midnight Commander is a visual shell much like a file manager, only
@@ -44,31 +42,26 @@ ability to FTP, view tar and zip files, 
 specific files.
 
 %prep
-%setup -q -n %{name}-%{version}-pre1
+%setup -q
 %patch0 -p1 -b .utf8
 %patch1 -p1 -b .extensions
 %patch2 -p1 -b .userhost
 %patch3 -p1 -b .64bit
-%patch4 -p1 -b .laf
-%patch5 -p1 -b .concat
 %patch6 -p1 -b .showfree
 %patch7 -p1 -b .cedit
 %patch8 -p1 -b .delcheck
 %patch9 -p1 -b .etcmc
 %patch10 -p1 -b .exit
-%patch11 -p1 -b .8bit-hex
 %patch12 -p1 -b .ipv6
 %patch13 -p1 -b .newlinedir
-%patch14 -p1 -b .cloexec
 %patch15 -p1 -b .prompt
 %patch16 -p1 -b .refresh
-%patch17 -p1 -b .preserveattr
 %patch18 -p1 -b .lzmavfs
 %patch19 -p1 -b .hintchk
-%patch20 -p1 -b .7zip
 %patch21 -p1 -b .oldrpmtags
 %patch22 -p1 -b .shellcwd
 %patch23 -p1 -b .cedit-configurable-highlight
+%patch24 -p1 -b .edit-segv
 
 # convert files in /lib to UTF-8
 pushd lib
@@ -130,6 +123,7 @@ done
 popd
 
 %build
+./autogen.sh
 export CFLAGS="-DUTF8=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS -fgnu89-inline"
 %configure --with-screen=slang \
 	     --enable-charset \
@@ -206,6 +200,17 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_libexecdir}/mc
 
 %changelog
+* Wed May 17 2009 Jindrich Novy <jnovy at redhat.com> 4.6.2-10
+- update to mc-4.6.2 release
+- fix segfault in mc editor when pressing ctrl+right (skip one word)
+  in binary file (#500818)
+- don't use dpkg tools for *.deb files (#495649), thanks to Dan Horak
+- 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
+
 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1:4.6.2-9.pre1
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/mc/F-11/sources,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -p -r1.44 -r1.45
--- sources	25 Feb 2008 15:07:57 -0000	1.44
+++ sources	28 May 2009 08:29:05 -0000	1.45
@@ -1 +1 @@
-7626c446f016b09fd1210f00b9d0c292  mc-4.6.2-pre1.tar.gz
+ec92966f4d0c8b50c344fe901859ae2a  mc-4.6.2.tar.gz


--- mc-7zip.patch DELETED ---


--- mc-cloexec.patch DELETED ---


--- mc-concat.patch DELETED ---


--- mc-preserveattr.patch DELETED ---


--- mc-utf8-8bit-hex.patch DELETED ---


--- mc-utf8-look-and-feel.patch DELETED ---


--- mc-utf8.patch DELETED ---




More information about the fedora-extras-commits mailing list