SOURCES: mc-utf8-8bit-hex.patch (NEW), mc-utf8-look-and-feel.patch...

arekm arekm at pld-linux.org
Wed Sep 27 22:59:17 CEST 2006


Author: arekm                        Date: Wed Sep 27 20:59:17 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new/updated

---- Files affected:
SOURCES:
   mc-utf8-8bit-hex.patch (NONE -> 1.1)  (NEW), mc-utf8-look-and-feel.patch (1.1 -> 1.2) , mc-utf8.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/mc-utf8-8bit-hex.patch
diff -u /dev/null SOURCES/mc-utf8-8bit-hex.patch:1.1
--- /dev/null	Wed Sep 27 22:59:17 2006
+++ SOURCES/mc-utf8-8bit-hex.patch	Wed Sep 27 22:59:12 2006
@@ -0,0 +1,26 @@
+--- 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);

================================================================
Index: SOURCES/mc-utf8-look-and-feel.patch
diff -u SOURCES/mc-utf8-look-and-feel.patch:1.1 SOURCES/mc-utf8-look-and-feel.patch:1.2
--- SOURCES/mc-utf8-look-and-feel.patch:1.1	Wed Jan 18 22:56:48 2006
+++ SOURCES/mc-utf8-look-and-feel.patch	Wed Sep 27 22:59:12 2006
@@ -78,7 +78,7 @@
 +#else
 +    if (color) attrset (MARKED_COLOR);
 +    if (is_utf8)
-+	SLsmg_write_string("â–˛");
++	SLsmg_write_string("â–´");
 +    else
 +        addch ('^');
 +    if (color) attrset (NORMAL_COLOR);
@@ -98,7 +98,7 @@
 +#else
 +    if (color) attrset (MARKED_COLOR);
 +    if (is_utf8)
-+	SLsmg_write_string("â–ź");
++	SLsmg_write_string("â–ž");
      else
 -	addch ('v');
 +	addch('v');
@@ -136,7 +136,7 @@
 +        else {
 +            if (color) attrset (MARKED_COLOR);
 +            if (is_utf8)
-+		SLsmg_write_string("●");
++		SLsmg_write_string("â—ˆ");
 +	    else
 +		addch('*');
 +            if (color) attrset (NORMAL_COLOR);

================================================================
Index: SOURCES/mc-utf8.patch
diff -u SOURCES/mc-utf8.patch:1.4 SOURCES/mc-utf8.patch:1.5
--- SOURCES/mc-utf8.patch:1.4	Tue Feb 28 17:52:01 2006
+++ SOURCES/mc-utf8.patch	Wed Sep 27 22:59:12 2006
@@ -1,6 +1,6 @@
---- mc-4.6.1a/acinclude.m4.utf8	2005-11-16 00:27:27.000000000 +0100
-+++ mc-4.6.1a/acinclude.m4	2006-02-01 14:25:01.000000000 +0100
-@@ -768,14 +768,14 @@ AC_DEFUN([MC_WITH_SLANG], [
+--- mc-2006-06-30-18/acinclude.m4.utf8	2006-06-30 20:32:27.000000000 +0200
++++ mc-2006-06-30-18/acinclude.m4	2006-07-11 10:39:54.000000000 +0200
+@@ -443,14 +443,14 @@
      fi
  
      dnl Unless external S-Lang was requested, reject S-Lang with UTF-8 hacks
@@ -23,9 +23,9 @@
  
      if test x$with_screen = xslang; then
  	AC_DEFINE(HAVE_SYSTEM_SLANG, 1,
---- mc-4.6.1a/src/layout.c.utf8	2005-09-05 03:40:45.000000000 +0200
-+++ mc-4.6.1a/src/layout.c	2006-02-01 14:25:01.000000000 +0100
-@@ -369,36 +369,36 @@ init_layout (void)
+--- mc-2006-06-30-18/src/layout.c.utf8	2006-02-28 18:44:28.000000000 +0100
++++ mc-2006-06-30-18/src/layout.c	2006-07-11 10:39:54.000000000 +0200
+@@ -369,36 +369,36 @@
  
  	while (i--) {
  	    s_split_direction[i] = _(s_split_direction[i]);
@@ -69,7 +69,7 @@
  	    if (l1 > second_width)
  		second_width = l1;
  	}
-@@ -412,14 +412,14 @@ init_layout (void)
+@@ -412,14 +412,14 @@
  	 *
  	 * Now the last thing to do - properly space buttons...
  	 */
@@ -89,7 +89,7 @@
  
  	i18n_layt_flag = 1;
      }
-@@ -687,7 +687,7 @@ setup_panels (void)
+@@ -687,7 +687,7 @@
      panel_do_cols (0);
      panel_do_cols (1);
  
@@ -98,9 +98,9 @@
  
      widget_set_size (&the_menubar->widget, 0, 0, 1, COLS);
  
---- mc-4.6.1a/src/tty.c.utf8	2006-01-07 13:17:07.000000000 +0100
-+++ mc-4.6.1a/src/tty.c	2006-02-01 14:25:01.000000000 +0100
-@@ -123,10 +123,12 @@ tty_print_char(int c)
+--- mc-2006-06-30-18/src/tty.c.utf8	2006-05-23 16:20:39.000000000 +0200
++++ mc-2006-06-30-18/src/tty.c	2006-07-11 10:39:54.000000000 +0200
+@@ -134,10 +134,12 @@
       * defined or not. Congratulations! At least, they left the API call
       * for SLsmg_write_nchars as it has always been.
       */
@@ -117,9 +117,9 @@
  #else
      addch(c);
  #endif
---- mc-4.6.1a/src/option.c.utf8	2005-05-27 05:35:15.000000000 +0200
-+++ mc-4.6.1a/src/option.c	2006-02-01 14:25:01.000000000 +0100
-@@ -123,12 +123,12 @@ init_configure (void)
+--- mc-2006-06-30-18/src/option.c.utf8	2006-02-28 18:44:28.000000000 +0100
++++ mc-2006-06-30-18/src/option.c	2006-07-11 10:39:54.000000000 +0200
+@@ -123,12 +123,12 @@
  	title2 = _(" Pause after run... ");
  	title3 = _(" Other options ");
  
@@ -135,7 +135,7 @@
  	    if (i >= OTHER_OPTIONS) {
  		if (l1 > first_width)
  		    first_width = l1;
-@@ -141,23 +141,23 @@ init_configure (void)
+@@ -141,23 +141,23 @@
  	i = PAUSE_OPTIONS;
  	while (i--) {
  	    pause_options[i] = _(pause_options[i]);
@@ -166,9 +166,9 @@
  
  	i18n_config_flag = 1;
      }
---- mc-4.6.1a/src/menu.h.utf8	2004-12-03 20:17:47.000000000 +0100
-+++ mc-4.6.1a/src/menu.h	2006-02-01 14:25:01.000000000 +0100
-@@ -21,6 +21,8 @@ typedef struct Menu {
+--- mc-2006-06-30-18/src/menu.h.utf8	2004-12-03 20:17:47.000000000 +0100
++++ mc-2006-06-30-18/src/menu.h	2006-07-11 10:39:54.000000000 +0200
+@@ -21,6 +21,8 @@
      menu_entry *entries;
      int    start_x;		/* position relative to menubar start */
      char   *help_node;
@@ -177,8 +177,8 @@
  } Menu;
  
  extern int menubar_visible;
---- mc-4.6.1a/src/menu.c.utf8	2005-09-05 04:12:09.000000000 +0200
-+++ mc-4.6.1a/src/menu.c	2006-02-01 14:25:01.000000000 +0100
+--- mc-2006-06-30-18/src/menu.c.utf8	2005-09-06 22:36:23.000000000 +0200
++++ mc-2006-06-30-18/src/menu.c	2006-07-11 10:39:54.000000000 +0200
 @@ -22,6 +22,7 @@
  #include <string.h>
  
@@ -187,7 +187,7 @@
  
  #include "global.h"
  #include "tty.h"
-@@ -53,35 +54,95 @@ create_menu (const char *name, menu_entr
+@@ -53,35 +54,95 @@
  {
      Menu *menu;
      const char *cp;
@@ -289,7 +289,7 @@
      menu->start_x = 0;
      menu->help_node = g_strdup (help_node);
      return menu;
-@@ -112,8 +173,26 @@ static void menubar_paint_idx (WMenu *me
+@@ -112,8 +173,26 @@
  	const char *text;
  
  	addch((unsigned char)menu->entries [idx].first_letter);
@@ -318,7 +318,7 @@
  		if (*text != '&')
  		    addch(*text);
  		else {
-@@ -122,7 +201,7 @@ static void menubar_paint_idx (WMenu *me
+@@ -122,7 +201,7 @@
  		    addch(*(++text));
  		    attrset(color);
  		}
@@ -327,7 +327,7 @@
      }
      widget_move (&menubar->widget, y, x + 1);
  }
-@@ -168,6 +247,12 @@ static void menubar_draw (WMenu *menubar
+@@ -168,6 +247,12 @@
  	if (menubar->active)
  	    attrset(i == menubar->selected?MENU_SELECTED_COLOR:SELECTED_COLOR);
  	widget_move (&menubar->widget, 0, menubar->menu [i]->start_x);
@@ -340,7 +340,7 @@
  	tty_printf ("%s", menubar->menu [i]->name);
      }
  
-@@ -493,7 +578,13 @@ menubar_arrange(WMenu* menubar)
+@@ -493,7 +578,13 @@
  
  	for (i = 0; i < items; i++)
  	{
@@ -355,7 +355,7 @@
  		menubar->menu[i]->start_x = start_x;
  		start_x += len + gap;
  	}
-@@ -506,7 +597,13 @@ menubar_arrange(WMenu* menubar)
+@@ -506,7 +597,13 @@
  	for (i = 0; i < items; i++)
  	{
  		/* preserve length here, to be used below */
@@ -370,7 +370,7 @@
  	}
  
  	gap /= (items - 1);
-@@ -530,6 +627,9 @@ menubar_arrange(WMenu* menubar)
+@@ -530,6 +627,9 @@
  void
  destroy_menu (Menu *menu)
  {
@@ -380,8 +380,8 @@
      g_free (menu->name);
      g_free (menu->help_node);
      g_free (menu);
---- mc-4.6.1a/src/filegui.c.utf8	2006-01-30 10:22:33.000000000 +0100
-+++ mc-4.6.1a/src/filegui.c	2006-02-01 14:25:01.000000000 +0100
+--- mc-2006-06-30-18/src/filegui.c.utf8	2006-01-30 18:01:58.000000000 +0100
++++ mc-2006-06-30-18/src/filegui.c	2006-07-11 10:39:54.000000000 +0200
 @@ -65,6 +65,7 @@
  #include "filegui.h"
  #include "key.h"		/* get_event */
@@ -390,7 +390,7 @@
  
  /* }}} */
  
-@@ -563,8 +564,8 @@ init_replace (FileOpContext *ctx, enum O
+@@ -563,8 +564,8 @@
  	 * longest of "Overwrite..." labels 
  	 * (assume "Target date..." are short enough)
  	 */
@@ -401,7 +401,7 @@
  
  	/* longest of button rows */
  	i = sizeof (rd_widgets) / sizeof (rd_widgets[0]);
-@@ -575,7 +576,7 @@ init_replace (FileOpContext *ctx, enum O
+@@ -575,7 +576,7 @@
  		    l2 = max (l2, l);
  		    l = 0;
  		}
@@ -410,7 +410,7 @@
  	    }
  	}
  	l2 = max (l2, l);	/* last row */
-@@ -593,12 +594,12 @@ init_replace (FileOpContext *ctx, enum O
+@@ -593,12 +594,12 @@
  		    l = l1;
  		}
  		rd_widgets[i].xpos = l;
@@ -425,7 +425,7 @@
      }
  #endif				/* ENABLE_NLS */
  
-@@ -617,7 +618,7 @@ init_replace (FileOpContext *ctx, enum O
+@@ -617,7 +618,7 @@
  
      ADD_RD_LABEL (ui, 0,
  		  name_trunc (ui->replace_filename,
@@ -434,7 +434,7 @@
      ADD_RD_BUTTON (1);
  
      ADD_RD_BUTTON (2);
-@@ -804,36 +805,36 @@ fmd_init_i18n (int force)
+@@ -804,36 +805,36 @@
  	if (fmd_widgets[i].text[0] != '\0')
  	    fmd_widgets[i].text = _(fmd_widgets[i].text);
  
@@ -481,7 +481,7 @@
  
      chkbox_xpos (FMCB0);
      chkbox_xpos (FMCB21);
-@@ -855,7 +856,7 @@ fmd_init_i18n (int force)
+@@ -855,7 +856,7 @@
  
  char *
  file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text,
@@ -490,7 +490,7 @@
  {
      int source_easy_patterns = easy_patterns;
      char *source_mask, *orig_mask, *dest_dir, *tmpdest;
-@@ -864,12 +865,20 @@ file_mask_dialog (FileOpContext *ctx, Fi
+@@ -864,12 +865,20 @@
      struct stat buf;
      int val;
      QuickDialog Quick_input;
@@ -512,7 +512,7 @@
      fmd_init_i18n (FALSE);
  
      /* Set up the result pointers */
-@@ -928,6 +937,7 @@ file_mask_dialog (FileOpContext *ctx, Fi
+@@ -928,6 +937,7 @@
      orig_mask = source_mask;
      if (!dest_dir || !*dest_dir) {
  	g_free (source_mask);
@@ -520,16 +520,16 @@
  	return dest_dir;
      }
      if (source_easy_patterns) {
-@@ -981,5 +991,6 @@ file_mask_dialog (FileOpContext *ctx, Fi
+@@ -981,5 +991,6 @@
      }
      if (val == B_USER)
  	*do_background = 1;
 +    g_free(def_text);
      return dest_dir;
  }
---- mc-4.6.1a/src/panelize.c.utf8	2005-05-27 05:35:15.000000000 +0200
-+++ mc-4.6.1a/src/panelize.c	2006-02-01 14:25:01.000000000 +0100
-@@ -127,7 +127,7 @@ init_panelize (void)
+--- mc-2006-06-30-18/src/panelize.c.utf8	2005-05-27 05:35:15.000000000 +0200
++++ mc-2006-06-30-18/src/panelize.c	2006-07-11 10:39:54.000000000 +0200
+@@ -127,7 +127,7 @@
  	i = sizeof (panelize_but) / sizeof (panelize_but[0]);
  	while (i--) {
  	    panelize_but[i].text = _(panelize_but[i].text);
@@ -538,7 +538,7 @@
  	}
  	maxlen += 10;
  
-@@ -136,11 +136,11 @@ init_panelize (void)
+@@ -136,11 +136,11 @@
      panelize_cols = max (panelize_cols, maxlen);
  
      panelize_but[2].x =
@@ -553,9 +553,9 @@
  
  #endif				/* ENABLE_NLS */
  
---- mc-4.6.1a/src/slint.c.utf8	2005-09-05 04:14:29.000000000 +0200
-+++ mc-4.6.1a/src/slint.c	2006-02-01 14:25:01.000000000 +0100
-@@ -141,7 +141,9 @@ void
+--- mc-2006-06-30-18/src/slint.c.utf8	2005-09-06 22:36:23.000000000 +0200
++++ mc-2006-06-30-18/src/slint.c	2006-07-11 10:39:54.000000000 +0200
+@@ -141,7 +141,9 @@
  slang_init (void)
  {
      SLtt_get_terminfo ();
@@ -566,9 +566,9 @@
     /*
      * If the terminal in not in terminfo but begins with a well-known
      * string such as "linux" or "xterm" S-Lang will go on, but the
---- mc-4.6.1a/src/main.c.utf8	2006-01-29 21:26:05.000000000 +0100
-+++ mc-4.6.1a/src/main.c	2006-02-01 14:25:01.000000000 +0100
-@@ -704,7 +704,7 @@ load_prompt (int fd, void *unused)
+--- mc-2006-06-30-18/src/main.c.utf8	2006-05-15 17:46:14.000000000 +0200
++++ mc-2006-06-30-18/src/main.c	2006-07-11 10:39:54.000000000 +0200
+@@ -704,7 +704,7 @@
  	int prompt_len;
  
  	tmp_prompt = strip_ctrl_codes (subshell_prompt);
@@ -577,7 +577,7 @@
  
  	/* Check for prompts too big */
  	if (COLS > 8 && prompt_len > COLS - 8) {
-@@ -1617,7 +1617,11 @@ update_xterm_title_path (void)
+@@ -1612,7 +1612,11 @@
      if (xterm_flag && xterm_title) {
  	p = s = g_strdup (strip_home_and_password (current_panel->cwd));
  	do {
@@ -589,8 +589,8 @@
  		*s = '?';
  	} while (*++s);
  	fprintf (stdout, "\33]0;mc - %s\7", p);
---- mc-4.6.1a/src/view.c.utf8	2006-01-31 15:39:30.000000000 +0100
-+++ mc-4.6.1a/src/view.c	2006-02-01 14:25:01.000000000 +0100
+--- mc-2006-06-30-18/src/view.c.utf8	2006-02-06 17:55:43.000000000 +0100
++++ mc-2006-06-30-18/src/view.c	2006-07-11 10:39:54.000000000 +0200
 @@ -43,6 +43,10 @@
  #include <sys/stat.h>
  #include <unistd.h>
@@ -602,7 +602,7 @@
  #include "global.h"
  #include "tty.h"
  #include "cmd.h"		/* For view_other_cmd */
-@@ -1627,7 +1631,7 @@ view_display_status (WView *view)
+@@ -1627,7 +1631,7 @@
      hline (' ', width);
  
      file_label = _("File: %s");
@@ -611,7 +611,7 @@
      file_name = view->filename ? view->filename
  	: view->command ? view->command
  	: "";
-@@ -1895,6 +1899,12 @@ view_display_text (WView * view)
+@@ -1895,6 +1899,12 @@
      offset_type from;
      int c;
      struct hexedit_change_node *curr = view->change_list;
@@ -624,9 +624,9 @@
  
      view_display_clean (view);
      view_display_ruler (view);
-@@ -1907,8 +1917,37 @@ view_display_text (WView * view)
+@@ -1907,8 +1917,37 @@
  
-     attrset (NORMAL_COLOR);
+     tty_setcolor (NORMAL_COLOR);
      for (row = 0, col = 0; row < height && (c = get_byte (view, from)) != -1; from++) {
 -
 +#ifndef UTF8
@@ -663,7 +663,7 @@
  	    int c_prev;
  	    int c_next;
  
-@@ -1967,10 +2006,17 @@ view_display_text (WView * view)
+@@ -1967,10 +2006,17 @@
  	if (col >= view->dpy_text_column
  	    && col - view->dpy_text_column < width) {
  	    widget_move (view, top + row, left + (col - view->dpy_text_column));
@@ -680,10 +680,10 @@
 +#endif
  	}
  	col++;
- 	attrset (NORMAL_COLOR);
---- mc-4.6.1a/src/screen.c.utf8	2005-11-11 04:32:40.000000000 +0100
-+++ mc-4.6.1a/src/screen.c	2006-02-01 14:25:01.000000000 +0100
-@@ -171,21 +171,56 @@ add_permission_string (char *dest, int w
+ 	tty_setcolor (NORMAL_COLOR);
+--- mc-2006-06-30-18/src/screen.c.utf8	2006-02-09 02:59:16.000000000 +0100
++++ mc-2006-06-30-18/src/screen.c	2006-07-11 10:39:54.000000000 +0200
+@@ -171,21 +171,56 @@
  static const char *
  string_file_name (file_entry *fe, int len)
  {
@@ -711,7 +711,9 @@
 +	for (i = 0; i < sizeof (buffer) - 1; i++) {
 +	    wchar_t wc;
 +	    int len;
-+
+ 
+-	if (!is_printable(c))
+-	    c = '?';
 +	    len = mbrtowc (&wc, str, mbmax, &s);
 +	    if (!len)
 +		break;
@@ -738,18 +740,16 @@
 +
 +	    c = fe->fname[i];
  
--	if (!is_printable(c))
--	    c = '?';
-+	    if (!c) break;
- 
 -	buffer[i] = c;
++	    if (!c) break;
++
 +	    if (!is_printable(c)) c = '?';
 +
 +	    buffer[i] = c;
      }
  
      buffer[i] = 0;
-@@ -450,42 +485,6 @@ static struct {
+@@ -450,42 +485,6 @@
  { "dot",   1,  0, J_RIGHT,	" ",		0, string_dot,		   NULL },
  };
  
@@ -792,7 +792,7 @@
  static int
  file_compute_color (int attr, file_entry *fe)
  {
-@@ -539,14 +538,18 @@ file_compute_color (int attr, file_entry
+@@ -539,14 +538,18 @@
  
  /* Formats the file number file_index of panel in the buffer dest */
  static void
@@ -810,11 +810,11 @@
 +#else
 +    char     buffer[BUF_MEDIUM];
 +#endif
-+    int txtwidth;
++    int txtwidth = 0;
  
      length     = 0;
      empty_line = (file_index >= panel->count);
-@@ -564,34 +567,137 @@ format_file (char *dest, int limit, WPan
+@@ -564,34 +567,137 @@
  	    break;
  
  	if (format->string_fn){
@@ -892,7 +892,7 @@
 +	    default:
 +		break;
 +	    }
- 
++
 +	    attrset (color);
 +
 +	    if (wide) {
@@ -954,7 +954,7 @@
 +			    len - txtlen - still);
 +		}
 +		buffer[len] = '\0';
-+
+ 
 +		if (perm)
 +		    add_permission_string (buffer, format->field_len, fe,
 +					   attr, color, perm - 1);
@@ -966,7 +966,7 @@
  	} else {
              if (attr == SELECTED || attr == MARKED_SELECTED)
                  attrset (SELECTED_COLOR);
-@@ -614,7 +720,6 @@ repaint_file (WPanel *panel, int file_in
+@@ -614,7 +720,6 @@
  {
      int    second_column = 0;
      int	   width, offset;
@@ -974,7 +974,7 @@
  
      offset = 0;
      if (!isstatus && panel->split){
-@@ -643,7 +748,7 @@ repaint_file (WPanel *panel, int file_in
+@@ -643,7 +748,7 @@
  	    widget_move (&panel->widget, file_index - panel->top_file + 2, 1);
      }
  
@@ -983,7 +983,7 @@
  
      if (!isstatus && panel->split){
  	if (second_column)
-@@ -692,7 +797,7 @@ display_mini_info (WPanel *panel)
+@@ -692,7 +797,7 @@
  		   ngettext("%s in %d file", "%s in %d files", panel->marked),
  		   b_bytes, panel->marked);
  
@@ -992,7 +992,7 @@
  	    buffer [cols] = 0;
  	    p += 2;
  	} else
-@@ -1101,6 +1206,12 @@ paint_frame (WPanel *panel)
+@@ -1101,6 +1206,12 @@
      int  side, width;
  
      const char *txt;
@@ -1005,7 +1005,7 @@
      if (!panel->split)
  	adjust_top_file (panel);
  
-@@ -1125,16 +1236,38 @@ paint_frame (WPanel *panel)
+@@ -1125,16 +1236,38 @@
              if (format->string_fn){
                  txt = format->title;
  
@@ -1047,9 +1047,72 @@
  	    } else {
  		attrset (NORMAL_COLOR);
  		one_vline ();
---- mc-4.6.1a/src/widget.h.utf8	2005-06-14 15:02:31.000000000 +0200
-+++ mc-4.6.1a/src/widget.h	2006-02-01 14:25:01.000000000 +0100
-@@ -22,6 +22,7 @@ typedef struct WButton {
+@@ -1891,11 +2024,24 @@
+     int i;
+     int wrapped = 0;
+     int found;
++    int prevpos, pos;
++    int j;
++    mbstate_t mbs;
+ 
+     l = strlen (panel->search_buffer);
+     if (c_code == KEY_BACKSPACE) {
+-	if (l)
+-	    panel->search_buffer[--l] = '\0';
++	if (l) {
++	    prevpos = pos = 0;
++	    memset (&mbs, 0, sizeof (mbs));
++	    while (pos < l) {
++		prevpos = pos;
++		j = mbrlen (panel->search_buffer + pos, l - pos, &mbs);
++		if (j <= 0) break;
++		pos += j;
++	    }
++	    --l;
++	    panel->search_buffer[prevpos] = 0;
++	}
+     } else {
+ 	if (c_code && l < sizeof (panel->search_buffer)) {
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/mc-utf8-look-and-feel.patch?r1=1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/SOURCES/mc-utf8.patch?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list