Submitted By: Alexander E. Patrakov Date: 2007-01-19 Initial Package Version: 4.6.1 Origin: Debian Upstream Status: partially applied Description: This patch adds UTF-8 support to MC, enables recoding of FTP filenames, fixes 64-bit issues, mcedit segfaults, moves configuration files to /etc/mc, and contains other changes from the Debian mc package. diff -urN mc-4.6.1.orig/doc/mc.1.in mc-4.6.1/doc/mc.1.in --- mc-4.6.1.orig/doc/mc.1.in 2005-06-08 18:27:06.000000000 +0600 +++ mc-4.6.1/doc/mc.1.in 2007-01-19 18:33:58.000000000 +0500 @@ -1377,7 +1377,7 @@ but only if it is owned by user or root and is not world-writable. If no such file found, ~/.mc/menu is tried in the same way, and otherwise mc uses the default system-wide menu -@prefix@/share/mc/mc.menu. +/etc/mc/mc.menu. .PP The format of the menu file is very simple. Lines that start with anything but space or tab are considered entries for the menu (in @@ -1903,7 +1903,7 @@ At startup the Midnight Commander will try to load initialization information from the ~/.mc/ini file. If this file doesn't exist, it will load the information from the system-wide configuration file, located in -@prefix@/share/mc/mc.ini. If the system-wide configuration file doesn't +/etc/mc/mc.ini. If the system-wide configuration file doesn't exist, MC uses the default settings. .PP The @@ -3235,7 +3235,7 @@ .IP The help file for the program. .PP -.I @prefix@/share/mc/mc.ext +.I /etc/mc/mc.ext .IP The default system-wide extensions file. .PP @@ -3244,12 +3244,12 @@ User's own extension, view configuration and edit configuration file. They override the contents of the system wide files if present. .PP -.I @prefix@/share/mc/mc.ini +.I /etc/mc/mc.ini .IP The default system-wide setup for the Midnight Commander, used only if the user doesn't have his own ~/.mc/ini file. .PP -.I @prefix@/share/mc/mc.lib +.I /etc/mc/mc.lib .IP Global settings for the Midnight Commander. Settings in this file affect all users, whether they have ~/.mc/ini or not. Currently, only @@ -3267,7 +3267,7 @@ .IP This file contains the hints displayed by the program. .PP -.I @prefix@/share/mc/mc.menu +.I /etc/mc/mc.menu .IP This file contains the default system-wide applications menu. .PP diff -urN mc-4.6.1.orig/doc/mcedit.1.in mc-4.6.1/doc/mcedit.1.in --- mc-4.6.1.orig/doc/mcedit.1.in 2005-06-08 18:27:07.000000000 +0600 +++ mc-4.6.1/doc/mcedit.1.in 2007-01-19 18:33:58.000000000 +0500 @@ -464,12 +464,12 @@ .IP The help file for the program. .PP -.I @prefix@/share/mc/mc.ini +.I /etc/mc/mc.ini .IP The default system-wide setup for GNU Midnight Commander, used only if the user's own ~/.mc/ini file is missing. .PP -.I @prefix@/share/mc/mc.lib +.I /etc/mc/mc.lib .IP Global settings for the Midnight Commander. Settings in this file affect all users, whether they have ~/.mc/ini or not. diff -urN mc-4.6.1.orig/doc/mcview.1.in mc-4.6.1/doc/mcview.1.in --- mc-4.6.1.orig/doc/mcview.1.in 2005-06-08 18:27:07.000000000 +0600 +++ mc-4.6.1/doc/mcview.1.in 2007-01-19 18:33:58.000000000 +0500 @@ -65,12 +65,12 @@ .IP The help file for the program. .PP -.I @prefix@/share/mc/mc.ini +.I /etc/mc/mc.ini .IP The default system-wide setup for GNU Midnight Commander, used only if the user's own ~/.mc/ini file is missing. .PP -.I @prefix@/share/mc/mc.lib +.I /etc/mc/mc.lib .IP Global settings for the Midnight Commander. Settings in this file affect all users, whether they have ~/.mc/ini or not. diff -urN mc-4.6.1.orig/edit/edit.c mc-4.6.1/edit/edit.c --- mc-4.6.1.orig/edit/edit.c 2005-05-27 20:19:18.000000000 +0600 +++ mc-4.6.1/edit/edit.c 2007-01-19 18:33:58.000000000 +0500 @@ -93,7 +93,7 @@ #ifndef NO_INLINE_GETBYTE -int edit_get_byte (WEdit * edit, long byte_index) +mc_wchar_t edit_get_byte (WEdit * edit, long byte_index) { unsigned long p; if (byte_index >= (edit->curs1 + edit->curs2) || byte_index < 0) @@ -125,7 +125,7 @@ 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)); } /* @@ -152,7 +152,7 @@ } 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 - @@ -162,7 +162,7 @@ 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 +242,44 @@ { 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; jlast_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; } @@ -294,12 +352,46 @@ int i, file, blocklen; long current = edit->curs1; unsigned char *buf; +#ifdef UTF8 + mbstate_t mbs; + int bufstart = 0; + + memset (&mbs, 0, sizeof (mbs)); +#endif /* UTF8 */ if ((file = mc_open (filename, O_RDONLY | O_BINARY)) == -1) return 0; buf = g_malloc (TEMP_BUF_LEN); +#ifndef UTF8 while ((blocklen = mc_read (file, (char *) buf, TEMP_BUF_LEN)) > 0) { for (i = 0; i < blocklen; i++) edit_insert (edit, buf[i]); +#else /* UTF8 */ + while ((blocklen = mc_read (file, (char *) buf + bufstart, TEMP_BUF_LEN - bufstart)) > 0) { + blocklen += bufstart; + bufstart = 0; + for (i = 0; i < blocklen; ) { + mc_wchar_t wc; + int j; + int size = mbrtowc(&wc, (char *)buf + i, blocklen - i, &mbs); + if (size == -2) { /*incomplete char*/ + bufstart = blocklen - i; + memcpy(buf, buf+i, bufstart); + i = blocklen; + memset (&mbs, 0, sizeof (mbs)); + } + else if (size <= 0) { +#ifdef __STDC_ISO_10646__ + edit_insert (edit, BINARY_CHAR_OFFSET + (mc_wchar_t)buf[i]); +#endif + memset (&mbs, 0, sizeof (mbs)); + i++; /* skip broken char */ + } + else { + edit_insert (edit, wc); + i+=size; + } + } +#endif /* UTF8 */ } edit_cursor_move (edit, current - edit->curs1); g_free (buf); @@ -393,7 +485,11 @@ static int edit_load_file (WEdit *edit) { +#ifndef UTF8 int fast_load = 1; +#else /* UTF8 */ + int fast_load = 0; /* can't be used with multibyte characters */ +#endif /* UTF8 */ /* Cannot do fast load if a filter is used */ if (edit_find_filter (edit->filename) >= 0) @@ -540,7 +636,7 @@ edit_set_filename (edit, filename); edit->stack_size = START_STACK_SIZE; edit->stack_size_mask = START_STACK_SIZE - 1; - edit->undo_stack = g_malloc ((edit->stack_size + 10) * sizeof (long)); + edit->undo_stack = g_malloc ((edit->stack_size + 10) * sizeof (struct action)); if (edit_load_file (edit)) { /* edit_load_file already gives an error message */ if (to_free) @@ -565,7 +661,9 @@ edit_move_display (edit, line - 1); edit_move_to_line (edit, line - 1); } - +#ifdef UTF8 + edit->charpoint = 0; +#endif return edit; } @@ -693,13 +791,23 @@ { unsigned long sp = edit->stack_pointer; unsigned long spm1; - long *t; + + struct action *t; + mc_wchar_t ch = 0; + + if (c == CHAR_INSERT || c == CHAR_INSERT_AHEAD) { + va_list ap; + va_start (ap, c); + ch = va_arg (ap, mc_wint_t); + va_end (ap); + } + /* first enlarge the stack if necessary */ if (sp > edit->stack_size - 10) { /* say */ if (option_max_undo < 256) option_max_undo = 256; if (edit->stack_size < (unsigned long) option_max_undo) { - t = g_realloc (edit->undo_stack, (edit->stack_size * 2 + 10) * sizeof (long)); + t = g_realloc (edit->undo_stack, (edit->stack_size * 2 + 10) * sizeof (struct action)); if (t) { edit->undo_stack = t; edit->stack_size <<= 1; @@ -714,7 +822,7 @@ #ifdef FAST_MOVE_CURSOR if (c == CURS_LEFT_LOTS || c == CURS_RIGHT_LOTS) { va_list ap; - edit->undo_stack[sp] = c == CURS_LEFT_LOTS ? CURS_LEFT : CURS_RIGHT; + edit->undo_stack[sp].flags = c == CURS_LEFT_LOTS ? CURS_LEFT : CURS_RIGHT; edit->stack_pointer = (edit->stack_pointer + 1) & edit->stack_size_mask; va_start (ap, c); c = -(va_arg (ap, int)); @@ -725,12 +833,14 @@ && spm1 != edit->stack_bottom && ((sp - 2) & edit->stack_size_mask) != edit->stack_bottom) { int d; - if (edit->undo_stack[spm1] < 0) { - d = edit->undo_stack[(sp - 2) & edit->stack_size_mask]; - if (d == c) { - if (edit->undo_stack[spm1] > -1000000000) { + mc_wchar_t d_ch; + if (edit->undo_stack[spm1].flags < 0) { + d = edit->undo_stack[(sp - 2) & edit->stack_size_mask].flags; + d_ch = edit->undo_stack[(sp - 2) & edit->stack_size_mask].ch; + if (d == c && d_ch == ch) { + if (edit->undo_stack[spm1].flags > -1000000000) { if (c < KEY_PRESS) /* --> no need to push multiple do-nothings */ - edit->undo_stack[spm1]--; + edit->undo_stack[spm1].flags--; return; } } @@ -738,19 +848,20 @@ #ifndef NO_STACK_CURSMOVE_ANIHILATION else if ((c == CURS_LEFT && d == CURS_RIGHT) || (c == CURS_RIGHT && d == CURS_LEFT)) { /* a left then a right anihilate each other */ - if (edit->undo_stack[spm1] == -2) + if (edit->undo_stack[spm1].flags == -2) edit->stack_pointer = spm1; else - edit->undo_stack[spm1]++; + edit->undo_stack[spm1].flags++; return; } #endif } else { - d = edit->undo_stack[spm1]; - if (d == c) { + d = edit->undo_stack[spm1].flags; + d_ch = edit->undo_stack[spm1].ch; + if (d == c && d_ch == ch) { if (c >= KEY_PRESS) return; /* --> no need to push multiple do-nothings */ - edit->undo_stack[sp] = -2; + edit->undo_stack[sp].flags = -2; goto check_bottom; } #ifndef NO_STACK_CURSMOVE_ANIHILATION @@ -762,7 +873,9 @@ #endif } } - edit->undo_stack[sp] = c; + edit->undo_stack[sp].flags = c; + edit->undo_stack[sp].ch = ch; + check_bottom: edit->stack_pointer = (edit->stack_pointer + 1) & edit->stack_size_mask; @@ -775,10 +888,10 @@ (((unsigned long) c + 1) & edit->stack_size_mask) == edit->stack_bottom) do { edit->stack_bottom = (edit->stack_bottom + 1) & edit->stack_size_mask; - } while (edit->undo_stack[edit->stack_bottom] < KEY_PRESS && edit->stack_bottom != edit->stack_pointer); + } while (edit->undo_stack[edit->stack_bottom].flags < KEY_PRESS && edit->stack_bottom != edit->stack_pointer); /*If a single key produced enough pushes to wrap all the way round then we would notice that the [stack_bottom] does not contain KEY_PRESS. The stack is then initialised: */ - if (edit->stack_pointer != edit->stack_bottom && edit->undo_stack[edit->stack_bottom] < KEY_PRESS) + if (edit->stack_pointer != edit->stack_bottom && edit->undo_stack[edit->stack_bottom].flags < KEY_PRESS) edit->stack_bottom = edit->stack_pointer = 0; } @@ -787,30 +900,30 @@ then the file should be as it was when he loaded up. Then set edit->modified to 0. */ static long -pop_action (WEdit * edit) +pop_action (WEdit * edit, struct action *c) { - long c; unsigned long sp = edit->stack_pointer; if (sp == edit->stack_bottom) { - return STACK_BOTTOM; + c->flags = STACK_BOTTOM; + return c->flags; } sp = (sp - 1) & edit->stack_size_mask; - if ((c = edit->undo_stack[sp]) >= 0) { -/* edit->undo_stack[sp] = '@'; */ + *c = edit->undo_stack[sp]; + if (edit->undo_stack[sp].flags >= 0) { edit->stack_pointer = (edit->stack_pointer - 1) & edit->stack_size_mask; - return c; + return c->flags; } if (sp == edit->stack_bottom) { return STACK_BOTTOM; } - c = edit->undo_stack[(sp - 1) & edit->stack_size_mask]; - if (edit->undo_stack[sp] == -2) { -/* edit->undo_stack[sp] = '@'; */ + *c = edit->undo_stack[(sp - 1) & edit->stack_size_mask]; + + if (edit->undo_stack[sp].flags == -2) { edit->stack_pointer = sp; } else - edit->undo_stack[sp]++; + edit->undo_stack[sp].flags++; - return c; + return c->flags; } /* is called whenever a modification is made by one of the four routines below */ @@ -831,7 +944,7 @@ */ void -edit_insert (WEdit *edit, int c) +edit_insert (WEdit *edit, mc_wchar_t c) { /* check if file has grown to large */ if (edit->last_byte >= SIZE_LIMIT) @@ -869,12 +982,11 @@ /* add a new buffer if we've reached the end of the last one */ if (!(edit->curs1 & M_EDIT_BUF_SIZE)) edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = - g_malloc (EDIT_BUF_SIZE); + g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t)); /* perform the insertion */ - edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE][edit-> - curs1 & M_EDIT_BUF_SIZE] - = (unsigned char) c; + edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] + [edit->curs1 & M_EDIT_BUF_SIZE] = c; /* update file length */ edit->last_byte++; @@ -885,7 +997,7 @@ /* same as edit_insert and move left */ -void edit_insert_ahead (WEdit * edit, int c) +void edit_insert_ahead (WEdit * edit, mc_wchar_t c) { if (edit->last_byte >= SIZE_LIMIT) return; @@ -908,7 +1020,7 @@ edit->last_get_rule += (edit->last_get_rule >= edit->curs1); if (!((edit->curs2 + 1) & M_EDIT_BUF_SIZE)) - edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE); + edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t)); edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE) - 1] = c; edit->last_byte++; @@ -918,7 +1030,7 @@ int edit_delete (WEdit * edit) { - int p; + mc_wint_t p; if (!edit->curs2) return 0; @@ -942,7 +1054,7 @@ edit->total_lines--; edit->force |= REDRAW_AFTER_CURSOR; } - edit_push_action (edit, p + 256); + edit_push_action (edit, CHAR_INSERT_AHEAD, p); if (edit->curs1 < edit->start_display) { edit->start_display--; if (p == '\n') @@ -956,7 +1068,7 @@ static int edit_backspace (WEdit * edit) { - int p; + mc_wint_t p; if (!edit->curs1) return 0; @@ -980,7 +1092,7 @@ edit->total_lines--; edit->force |= REDRAW_AFTER_CURSOR; } - edit_push_action (edit, p); + edit_push_action (edit, CHAR_INSERT, p); if (edit->curs1 < edit->start_display) { edit->start_display--; @@ -993,10 +1105,18 @@ #ifdef FAST_MOVE_CURSOR -static void memqcpy (WEdit * edit, unsigned char *dest, unsigned char *src, int n) +static void memqcpy (WEdit * edit, mc_wchar_t *dest, mc_wchar_t *src, int n) { unsigned long next; +#ifndef UTF8 while ((next = (unsigned long) memccpy (dest, src, '\n', n))) { +#else /* UTF8 */ + while (n) { + next = 0; + while (next < n && src[next]!='\n') next++; + if (next < n) next++; + wmemcpy (dest, src, next) +#endif /* UTF8 */ edit->curs_line--; next -= (unsigned long) dest; n -= next; @@ -1009,7 +1129,7 @@ edit_move_backward_lots (WEdit *edit, long increment) { int r, s, t; - unsigned char *p; + mc_wchar_t *p; if (increment > edit->curs1) increment = edit->curs1; @@ -1049,7 +1169,7 @@ edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = p; else edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = - g_malloc (EDIT_BUF_SIZE); + g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t)); } else { g_free (p); } @@ -1087,7 +1207,7 @@ edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = p; else edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = - g_malloc (EDIT_BUF_SIZE); + g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t)); } else { g_free (p); } @@ -1119,7 +1239,7 @@ c = edit_get_byte (edit, edit->curs1 - 1); if (!((edit->curs2 + 1) & M_EDIT_BUF_SIZE)) - edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE); + edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t)); edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE) - 1] = c; edit->curs2++; c = edit->buffers1[(edit->curs1 - 1) >> S_EDIT_BUF_SIZE][(edit->curs1 - 1) & M_EDIT_BUF_SIZE]; @@ -1144,7 +1264,7 @@ c = edit_get_byte (edit, edit->curs1); if (!(edit->curs1 & M_EDIT_BUF_SIZE)) - edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE); + edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t)); edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE][edit->curs1 & M_EDIT_BUF_SIZE] = c; edit->curs1++; c = edit->buffers2[(edit->curs2 - 1) >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - ((edit->curs2 - 1) & M_EDIT_BUF_SIZE) - 1]; @@ -1251,7 +1371,7 @@ q = edit->last_byte + 2; for (col = 0, p = current; p < q; p++) { - int c; + mc_wchar_t c; if (cols != -10) { if (col == cols) return p; @@ -1269,7 +1389,7 @@ } else if (c < 32 || c == 127) col += 2; /* Caret notation for control characters */ else - col++; + col += wcwidth(c); } return col; } @@ -1402,7 +1522,7 @@ is_blank (WEdit *edit, long offset) { long s, f; - int c; + mc_wchar_t c; s = edit_bol (edit, offset); f = edit_eol (edit, offset) - 1; while (s <= f) { @@ -1774,13 +1894,13 @@ static void edit_do_undo (WEdit * edit) { - long ac; + struct action ac; long count = 0; edit->stack_disable = 1; /* don't record undo's onto undo stack! */ - while ((ac = pop_action (edit)) < KEY_PRESS) { - switch ((int) ac) { + while (pop_action (edit, &ac) < KEY_PRESS) { + switch ((int) ac.flags) { case STACK_BOTTOM: goto done_undo; case CURS_RIGHT: @@ -1801,31 +1921,33 @@ case COLUMN_OFF: column_highlighting = 0; break; + case CHAR_INSERT: + edit_insert (edit, ac.ch); + break; + case CHAR_INSERT_AHEAD: + edit_insert_ahead (edit, ac.ch); + break; } - if (ac >= 256 && ac < 512) - edit_insert_ahead (edit, ac - 256); - if (ac >= 0 && ac < 256) - edit_insert (edit, ac); - if (ac >= MARK_1 - 2 && ac < MARK_2 - 2) { - edit->mark1 = ac - MARK_1; + if (ac.flags >= MARK_1 - 2 && ac.flags < MARK_2 - 2) { + edit->mark1 = ac.flags - MARK_1; edit->column1 = edit_move_forward3 (edit, edit_bol (edit, edit->mark1), 0, edit->mark1); - } else if (ac >= MARK_2 - 2 && ac < KEY_PRESS) { - edit->mark2 = ac - MARK_2; + } else if (ac.flags >= MARK_2 - 2 && ac.flags < KEY_PRESS) { + edit->mark2 = ac.flags - MARK_2; edit->column2 = edit_move_forward3 (edit, edit_bol (edit, edit->mark2), 0, edit->mark2); } if (count++) edit->force |= REDRAW_PAGE; /* more than one pop usually means something big */ } - if (edit->start_display > ac - KEY_PRESS) { - edit->start_line -= edit_count_lines (edit, ac - KEY_PRESS, edit->start_display); + if (edit->start_display > ac.flags - KEY_PRESS) { + edit->start_line -= edit_count_lines (edit, ac.flags - KEY_PRESS, edit->start_display); edit->force |= REDRAW_PAGE; - } else if (edit->start_display < ac - KEY_PRESS) { - edit->start_line += edit_count_lines (edit, edit->start_display, ac - KEY_PRESS); + } else if (edit->start_display < ac.flags - KEY_PRESS) { + edit->start_line += edit_count_lines (edit, edit->start_display, ac.flags - KEY_PRESS); edit->force |= REDRAW_PAGE; } - edit->start_display = ac - KEY_PRESS; /* see push and pop above */ + edit->start_display = ac.flags - KEY_PRESS; /* see push and pop above */ edit_update_curs_row (edit); done_undo:; @@ -2102,7 +2224,7 @@ * passed as -1. Commands are executed, and char_for_insertion is * inserted at the cursor. */ -void edit_execute_key_command (WEdit *edit, int command, int char_for_insertion) +void edit_execute_key_command (WEdit *edit, int command, mc_wint_t char_for_insertion) { if (command == CK_Begin_Record_Macro) { edit->macro_i = 0; @@ -2137,7 +2259,7 @@ all of them. It also does not check for the Undo command. */ void -edit_execute_cmd (WEdit *edit, int command, int char_for_insertion) +edit_execute_cmd (WEdit *edit, int command, mc_wint_t char_for_insertion) { edit->force |= REDRAW_LINE; @@ -2170,7 +2292,7 @@ } /* An ordinary key press */ - if (char_for_insertion >= 0) { + if (char_for_insertion != (mc_wint_t) -1) { if (edit->overwrite) { if (edit_get_byte (edit, edit->curs1) != '\n') edit_delete (edit); diff -urN mc-4.6.1.orig/edit/editcmd.c mc-4.6.1/edit/editcmd.c --- mc-4.6.1.orig/edit/editcmd.c 2005-05-27 20:19:18.000000000 +0600 +++ mc-4.6.1/edit/editcmd.c 2007-01-19 18:33:58.000000000 +0500 @@ -24,7 +24,6 @@ /* #define PIPE_BLOCKS_SO_READ_BYTE_BY_BYTE */ #include -#include #include "edit.h" #include "editlock.h" @@ -46,7 +45,7 @@ #define edit_get_save_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) struct selection { - unsigned char * text; + mc_wchar_t *text; int len; }; @@ -69,12 +68,16 @@ #define MAX_REPL_LEN 1024 static int edit_save_cmd (WEdit *edit); -static unsigned char *edit_get_block (WEdit *edit, long start, +static mc_wchar_t *edit_get_block (WEdit *edit, long start, long finish, int *l); -static inline int my_lower_case (int c) +static inline mc_wchar_t my_lower_case (mc_wchar_t c) { +#ifndef UTF8 return tolower(c & 0xFF); +#else + return towlower(c); +#endif } static const char *strcasechr (const unsigned char *s, int c) @@ -108,11 +111,11 @@ #endif /* !HAVE_MEMMOVE */ /* #define itoa MY_itoa <---- this line is now in edit.h */ -static char * +static mc_wchar_t * MY_itoa (int i) { - static char t[14]; - char *s = t + 13; + static mc_wchar_t t[14]; + mc_wchar_t *s = t + 13; int j = i; *s-- = 0; do { @@ -196,6 +199,48 @@ doupdate(); } +#ifdef UTF8 + +static size_t +wchar_write(int fd, mc_wchar_t *buf, size_t len) +{ + char *tmpbuf = g_malloc(len + MB_LEN_MAX); + mbstate_t mbs; + size_t i; + size_t outlen = 0; + size_t res; + + for (i = 0; i < len; i++) { + if (outlen >= len) { + if ((res = mc_write(fd, tmpbuf, outlen)) != outlen) { + g_free(tmpbuf); + return -1; + } + outlen = 0; + } + memset (&mbs, 0, sizeof (mbs)); +#ifdef __STDC_ISO_10646__ + if (buf[i] >= BINARY_CHAR_OFFSET && buf[i] < (BINARY_CHAR_OFFSET + 256)) { + res = 1; + tmpbuf[outlen] = (char) (buf[i] - BINARY_CHAR_OFFSET); + + } else +#endif + res = wcrtomb(tmpbuf + outlen, buf[i], &mbs); + if (res > 0) { + outlen += res; + } + } + if ((res = mc_write(fd, tmpbuf, outlen)) != outlen) { + g_free(tmpbuf); + return -1; + } + g_free(tmpbuf); + return len; +} + +#endif /* UTF8 */ + /* If 0 (quick save) then a) create/truncate file, b) save to ; if 1 (safe save) then a) save to , @@ -225,7 +270,7 @@ } if (!vfs_file_is_local (filename) || - (fd = mc_open (filename, O_WRONLY | O_BINARY)) == -1) { + (fd = mc_open (filename, O_RDONLY | O_BINARY)) == -1) { /* * The file does not exists yet, so no safe save or * backup are necessary. @@ -303,32 +348,48 @@ buf = 0; filelen = edit->last_byte; while (buf <= (edit->curs1 >> S_EDIT_BUF_SIZE) - 1) { +#ifndef UTF8 if (mc_write (fd, (char *) edit->buffers1[buf], EDIT_BUF_SIZE) +#else /* UTF8 */ + if (wchar_write (fd, edit->buffers1[buf], EDIT_BUF_SIZE) +#endif /* UTF8 */ != EDIT_BUF_SIZE) { mc_close (fd); goto error_save; } buf++; } +#ifndef UTF8 if (mc_write (fd, (char *) edit->buffers1[buf], +#else /* UTF8 */ + if (wchar_write + (fd, edit->buffers1[buf], +#endif /* UTF8 */ edit->curs1 & M_EDIT_BUF_SIZE) != (edit->curs1 & M_EDIT_BUF_SIZE)) { filelen = -1; } else if (edit->curs2) { edit->curs2--; buf = (edit->curs2 >> S_EDIT_BUF_SIZE); - if (mc_write - (fd, - (char *) edit->buffers2[buf] + EDIT_BUF_SIZE - +#ifndef UTF8 + if (mc_write(fd, (char *) edit->buffers2[buf] + EDIT_BUF_SIZE - +#else /* UTF8 */ + if (wchar_write(fd, edit->buffers2[buf] + EDIT_BUF_SIZE - +#endif /* UTF8 */ (edit->curs2 & M_EDIT_BUF_SIZE) - 1, 1 + (edit->curs2 & M_EDIT_BUF_SIZE)) != 1 + (edit->curs2 & M_EDIT_BUF_SIZE)) { filelen = -1; } else { while (--buf >= 0) { +#ifndef UTF8 if (mc_write (fd, (char *) edit->buffers2[buf], +#else /* UTF8 */ + if (wchar_write + (fd, edit->buffers2[buf], +#endif /* UTF8 */ EDIT_BUF_SIZE) != EDIT_BUF_SIZE) { filelen = -1; break; @@ -643,13 +704,21 @@ if (!n || n == EOF) break; n = 0; +#ifndef UTF8 while (fscanf (f, "%hd %hd, ", ¯o[n].command, ¯o[n].ch)) +#else /* UTF8 */ + while (fscanf (f, "%hd %lu, ", ¯o[n].command, ¯o[n].ch)) +#endif /* UTF8 */ n++; fscanf (f, ";\n"); if (s != k) { fprintf (g, ("key '%d 0': "), s); for (i = 0; i < n; i++) +#ifndef UTF8 fprintf (g, "%hd %hd, ", macro[i].command, macro[i].ch); +#else /* UTF8 */ + fprintf (g, "%hd %lu, ", macro[i].command, macro[i].ch); +#endif /* UTF8 */ fprintf (g, ";\n"); } } @@ -685,7 +754,11 @@ if (f) { fprintf (f, ("key '%d 0': "), s); for (i = 0; i < n; i++) +#ifndef UTF8 fprintf (f, "%hd %hd, ", macro[i].command, macro[i].ch); +#else /* UTF8 */ + fprintf (f, "%hd %lu, ", macro[i].command, macro[i].ch); +#endif /* UTF8 */ fprintf (f, ";\n"); fclose (f); if (saved_macros_loaded) { @@ -734,10 +807,18 @@ saved_macro[i++] = s; if (!found) { *n = 0; +#ifndef UTF8 while (*n < MAX_MACRO_LENGTH && 2 == fscanf (f, "%hd %hd, ", ¯o[*n].command, ¯o[*n].ch)) +#else /* UTF8 */ + while (*n < MAX_MACRO_LENGTH && 2 == fscanf (f, "%hd %lu, ", ¯o[*n].command, ¯o[*n].ch)) +#endif /* UTF8 */ (*n)++; } else { +#ifndef UTF8 while (2 == fscanf (f, "%hd %hd, ", &dummy.command, &dummy.ch)); +#else /* UTF8 */ + while (2 == fscanf (f, "%hd %lu, ", &dummy.command, &dummy.ch)); +#endif /* UTF8 */ } fscanf (f, ";\n"); if (s == k) @@ -886,7 +967,7 @@ #define space_width 1 static void -edit_insert_column_of_text (WEdit * edit, unsigned char *data, int size, int width) +edit_insert_column_of_text (WEdit * edit, mc_wchar_t *data, int size, int width) { long cursor; int i, col; @@ -934,7 +1015,7 @@ { long start_mark, end_mark, current = edit->curs1; int size, x; - unsigned char *copy_buf; + mc_wchar_t *copy_buf; edit_update_curs_col (edit); x = edit->curs_col; @@ -979,7 +1060,7 @@ { long count; long current; - unsigned char *copy_buf; + mc_wchar_t *copy_buf; long start_mark, end_mark; int deleted = 0; int x = 0; @@ -1040,7 +1121,7 @@ edit_push_action (edit, COLUMN_ON); column_highlighting = 0; } else { - copy_buf = g_malloc (end_mark - start_mark); + copy_buf = g_malloc ((end_mark - start_mark) * sizeof(mc_wchar_t)); edit_cursor_move (edit, start_mark - edit->curs1); edit_scroll_screen_over_cursor (edit); count = start_mark; @@ -1371,7 +1452,11 @@ /* This function is a modification of mc-3.2.10/src/view.c:regexp_view_search() */ /* returns -3 on error in pattern, -1 on not found, found_len = 0 if either */ static int +#ifndef UTF8 string_regexp_search (char *pattern, char *string, int len, int match_type, +#else /* UTF8 */ +string_regexp_search (char *pattern, mc_wchar_t *wstring, int match_type, +#endif /* UTF8 */ int match_bol, int icase, int *found_len, void *d) { static regex_t r; @@ -1380,6 +1465,11 @@ regmatch_t *pmatch; static regmatch_t s[1]; +#ifdef UTF8 + char *string; + int i; +#endif /* UTF8 */ + pmatch = (regmatch_t *) d; if (!pmatch) pmatch = s; @@ -1399,13 +1489,51 @@ old_type = match_type; old_icase = icase; } + +#ifdef UTF8 + string = wchar_to_mbstr(wstring); + if (string == NULL) + return -1; +#endif /* UTF8 */ + if (regexec (&r, string, d ? NUM_REPL_ARGS : 1, pmatch, ((match_bol || match_type != match_normal) ? 0 : REG_NOTBOL)) != 0) { *found_len = 0; + +#ifdef UTF8 + g_free(string); +#endif /* UTF8 */ + return -1; } + +#ifdef UTF8 + for (i = 0; i < (d ? NUM_REPL_ARGS : 1); i++) { + char tmp; + int new_o; + + if (pmatch[i].rm_so < 0) + continue; + tmp = string[pmatch[i].rm_so]; + string[pmatch[i].rm_so] = 0; + new_o = mbstrlen(string); + string[pmatch[i].rm_so] = tmp; + pmatch[i].rm_so = new_o; + + if (pmatch[i].rm_eo < 0) + continue; + tmp = string[pmatch[i].rm_eo]; + string[pmatch[i].rm_eo] = 0; + new_o = mbstrlen(string); + string[pmatch[i].rm_eo] = tmp; + pmatch[i].rm_eo = new_o; + } + + g_free(string); +#endif /* UTF8 */ + *found_len = pmatch[0].rm_eo - pmatch[0].rm_so; return (pmatch[0].rm_so); } @@ -1413,13 +1541,29 @@ /* thanks to Liviu Daia for getting this (and the above) routines to work properly - paul */ +#ifndef UTF8 typedef int (*edit_getbyte_fn) (WEdit *, long); +#else /* UTF8 */ +typedef mc_wchar_t (*edit_getbyte_fn) (WEdit *, long); +#endif /* UTF8 */ static long +#ifndef UTF8 edit_find_string (long start, unsigned char *exp, int *len, long last_byte, edit_getbyte_fn get_byte, void *data, int once_only, void *d) +#else /* UTF8 */ +edit_find_string (long start, unsigned char *exp_mb, int *len, long last_byte, edit_getbyte_fn get_byte, void *data, int once_only, void *d) +#endif /* UTF8 */ { long p, q = 0; - long l = strlen ((char *) exp), f = 0; + long f = 0; + +#ifndef UTF8 + long l = strlen ((char *) exp); +#else /* UTF8 */ + mc_wchar_t *exp = mbstr_to_wchar((char *)exp_mb); + mc_wchar_t *exp_backup = exp; + long l = wcslen(exp); +#endif /* UTF8 */ int n = 0; for (p = 0; p < l; p++) /* count conversions... */ @@ -1428,19 +1572,22 @@ n++; if (replace_scanf || replace_regexp) { - int c; - unsigned char *buf; - unsigned char mbuf[MAX_REPL_LEN * 2 + 3]; + mc_wint_t c; + mc_wchar_t *buf; + mc_wchar_t mbuf[MAX_REPL_LEN * 2 + 3]; replace_scanf = (!replace_regexp); /* can't have both */ buf = mbuf; if (replace_scanf) { - unsigned char e[MAX_REPL_LEN]; - if (n >= NUM_REPL_ARGS) - return -3; - + mc_wchar_t e[MAX_REPL_LEN]; + if (n >= NUM_REPL_ARGS) { +#ifdef UTF8 + g_free(exp_backup); +#endif /* UTF8 */ + return -3; + } if (replace_case) { for (p = start; p < last_byte && p < start + MAX_REPL_LEN; p++) buf[p - start] = (*get_byte) (data, p); @@ -1454,20 +1601,36 @@ } buf[(q = p - start)] = 0; +#ifndef UTF8 strcpy ((char *) e, (char *) exp); strcat ((char *) e, "%n"); +#else /* UTF8 */ + wcscpy (e, exp); + wcscat (e, L"%n"); +#endif /* UTF8 */ exp = e; while (q) { *((int *) sargs[n]) = 0; /* --> here was the problem - now fixed: good */ +#ifndef UTF8 if (n == sscanf ((char *) buf, (char *) exp, SCANF_ARGS)) { +#else /* UTF8 */ + if (n == swscanf (buf, exp, SCANF_ARGS)) { +#endif /* UTF8 */ if (*((int *) sargs[n])) { *len = *((int *) sargs[n]); +#ifdef UTF8 + g_free(exp_backup); +#endif /* UTF8 */ return start; } } - if (once_only) + if (once_only) { +#ifdef UTF8 + g_free(exp_backup); +#endif /* UTF8 */ return -2; + } if (q + start < last_byte) { if (replace_case) { buf[q] = (*get_byte) (data, q + start); @@ -1481,7 +1644,11 @@ start++; buf++; /* move the window along */ if (buf == mbuf + MAX_REPL_LEN) { /* the window is about to go past the end of array, so... */ +#ifndef UTF8 memmove (mbuf, buf, strlen ((char *) buf) + 1); /* reset it */ +#else /* UTF8 */ + wmemmove (mbuf, buf, (wcslen (buf) + 1)); /* reset it */ +#endif /* UTF8 */ buf = mbuf; } q--; @@ -1507,10 +1674,17 @@ buf = mbuf; while (q) { +#ifndef UTF8 found_start = string_regexp_search ((char *) exp, (char *) buf, q, match_normal, match_bol, !replace_case, len, d); +#else /* UTF8 */ + found_start = string_regexp_search ((char *) exp_mb, buf, match_normal, match_bol, !replace_case, len, d); +#endif /* UTF8 */ if (found_start <= -2) { /* regcomp/regexec error */ *len = 0; +#ifdef UTF8 + g_free (exp_backup); +#endif /* UTF8 */ return -3; } else if (found_start == -1) /* not found: try next line */ @@ -1521,15 +1695,27 @@ match_bol = 0; continue; } - else /* found */ + else { /* found */ +#ifdef UTF8 + g_free(exp_backup); +#endif /* UTF8 */ return (start + offset - q + found_start); + } } - if (once_only) + if (once_only) { +#ifdef UTF8 + g_free(exp_backup); +#endif /* UTF8 */ return -2; + } if (buf[q - 1] != '\n') { /* incomplete line: try to recover */ buf = mbuf + MAX_REPL_LEN / 2; +#ifndef UTF8 q = strlen ((const char *) buf); +#else /* UTF8 */ + q = wcslen (buf); +#endif /* UTF8 */ memmove (mbuf, buf, q); p = start + q; move_win = 1; @@ -1539,36 +1725,59 @@ } } } else { +#ifndef UTF8 *len = strlen ((const char *) exp); +#else /* UTF8 */ + *len = wcslen (exp); +#endif /* UTF8 */ if (replace_case) { for (p = start; p <= last_byte - l; p++) { - if ((*get_byte) (data, p) == (unsigned char)exp[0]) { /* check if first char matches */ + if ((*get_byte) (data, p) == exp[0]) { /* check if first char matches */ for (f = 0, q = 0; q < l && f < 1; q++) - if ((*get_byte) (data, q + p) != (unsigned char)exp[q]) + if ((*get_byte) (data, q + p) != exp[q]) f = 1; - if (f == 0) + if (f == 0) { +#ifdef UTF8 + g_free (exp_backup); +#endif /* UTF8 */ return p; + } } - if (once_only) + if (once_only) { +#ifdef UTF8 + g_free(exp_backup); +#endif /* UTF8 */ return -2; + } } } else { for (p = 0; exp[p] != 0; p++) exp[p] = my_lower_case (exp[p]); for (p = start; p <= last_byte - l; p++) { - if (my_lower_case ((*get_byte) (data, p)) == (unsigned char)exp[0]) { + if (my_lower_case ((*get_byte) (data, p)) == exp[0]) { for (f = 0, q = 0; q < l && f < 1; q++) - if (my_lower_case ((*get_byte) (data, q + p)) != (unsigned char)exp[q]) + if (my_lower_case ((*get_byte) (data, q + p)) != exp[q]) f = 1; - if (f == 0) + if (f == 0) { +#ifdef UTF8 + g_free (exp_backup); +#endif /* UTF8 */ return p; + } } - if (once_only) + if (once_only) { +#ifdef UTF8 + g_free (exp_backup); +#endif /* UTF8 */ return -2; + } } } } +#ifdef UTF8 + g_free (exp_backup); +#endif /* UTF8 */ return -2; } @@ -1582,9 +1791,14 @@ while ((p = edit_find_string (p, exp, len, last_byte, get_byte, data, once_only, d)) >= 0) { if (replace_whole) { +#ifndef UTF8 /*If the bordering chars are not in option_whole_chars_search then word is whole */ if (!strcasechr (option_whole_chars_search, (*get_byte) (data, p - 1)) && !strcasechr (option_whole_chars_search, (*get_byte) (data, p + *len))) +#else /* UTF8 */ + if (!iswalnum((*get_byte) (data, p - 1)) + && !iswalnum((*get_byte) (data, p + *len))) +#endif /* UTF8 */ return p; if (once_only) return -2; @@ -1616,6 +1830,7 @@ #define is_digit(x) ((x) >= '0' && (x) <= '9') +#ifndef UTF8 #define snprint(v) { \ *p1++ = *p++; \ *p1 = '\0'; \ @@ -1623,33 +1838,48 @@ if (n >= (size_t) (e - s)) goto nospc; \ s += n; \ } +#else /* UTF8 */ +#define snprint(v) { \ + *p1++ = *p++; \ + *p1 = '\0'; \ + n = swprintf(s, e-s, q1,v); \ + if (n >= (size_t) (e - s)) goto nospc; \ + s += n; \ + } +#endif /* UTF8 */ /* this function uses the sprintf command to do a vprintf */ /* it takes pointers to arguments instead of the arguments themselves */ /* The return value is the number of bytes written excluding '\0' if successfull, -1 if the resulting string would be too long and -2 if the format string is errorneous. */ -static int snprintf_p (char *str, size_t size, const char *fmt,...) - __attribute__ ((format (printf, 3, 4))); - -static int snprintf_p (char *str, size_t size, const char *fmt,...) +static int snprintf_p (mc_wchar_t *str, size_t size, const mc_wchar_t *fmt,...) { va_list ap; size_t n; - const char *q, *p; - char *s = str, *e = str + size; - char q1[40]; - char *p1; + const mc_wchar_t *q, *p; + mc_wchar_t *s = str, *e = str + size; + mc_wchar_t q1[40]; + + mc_wchar_t *p1; int nargs = 0; va_start (ap, fmt); p = q = fmt; +#ifndef UTF8 while ((p = strchr (p, '%'))) { +#else /* UTF8 */ + while ((p = wcschr (p, L'%'))) { +#endif /* UTF8 */ n = p - q; if (n >= (size_t) (e - s)) goto nospc; +#ifndef UTF8 memcpy (s, q, n); /* copy stuff between format specifiers */ +#else /* UTF8 */ + wmemcpy (s, q, n); /* copy stuff between format specifiers */ +#endif /* UTF8 */ s += n; q = p; p1 = q1; @@ -1677,45 +1907,78 @@ *p1++ = *p++; if (*p == '*') { p++; +#ifndef UTF8 strcpy (p1, MY_itoa (*va_arg (ap, int *))); /* replace field width with a number */ p1 += strlen (p1); +#else /* UTF8 */ + wcscpy (p1, MY_itoa (*va_arg (ap, int *))); /* replace field width with a number */ + p1 += wcslen (p1); +#endif /* UTF8 */ } else { - while (is_digit (*p) && p1 < q1 + 20) +#ifndef UTF8 + while (is_digit (*p) +#else /* UTF8 */ + while (iswdigit (*p) +#endif /* UTF8 */ + && p1 < q1 + 20) *p1++ = *p++; - if (is_digit (*p)) +#ifndef UTF8 + if (is_digit (*p)) +#else /* UTF8 */ + if (iswdigit (*p)) +#endif /* UTF8 */ goto err; } if (*p == '.') *p1++ = *p++; if (*p == '*') { p++; +#ifndef UTF8 strcpy (p1, MY_itoa (*va_arg (ap, int *))); /* replace precision with a number */ p1 += strlen (p1); +#else /* UTF8 */ + wcscpy (p1, MY_itoa (*va_arg (ap, int *))); /* replace precision with a number */ + p1 += wcslen (p1); +#endif /* UTF8 */ } else { - while (is_digit (*p) && p1 < q1 + 32) +#ifndef UTF8 + while (is_digit (*p) +#else /* UTF8 */ + while (iswdigit (*p) +#endif /* UTF8 */ + && p1 < q1 + 32) *p1++ = *p++; - if (is_digit (*p)) +#ifndef UTF8 + if (is_digit (*p)) +#else /* UTF8 */ + if (iswdigit (*p)) +#endif /* UTF8 */ goto err; } /* flags done, now get argument */ if (*p == 's') { +#ifndef UTF8 snprint (va_arg (ap, char *)); +#else /* UTF8 */ + *p1++ = 'l'; + snprint (va_arg (ap, mc_wchar_t *)); +#endif /* UTF8 */ } else if (*p == 'h') { - if (strchr ("diouxX", *p)) + if (*p < 128 && strchr ("diouxX", *p)) snprint (*va_arg (ap, short *)); } else if (*p == 'l') { *p1++ = *p++; - if (strchr ("diouxX", *p)) + if (*p < 128 && strchr ("diouxX", *p)) snprint (*va_arg (ap, long *)); - } else if (strchr ("cdiouxX", *p)) { + } else if (*p < 128 && strchr ("cdiouxX", *p)) { snprint (*va_arg (ap, int *)); } else if (*p == 'L') { *p1++ = *p++; - if (strchr ("EefgG", *p)) + if (*p < 128 && strchr ("EefgG", *p)) snprint (*va_arg (ap, double *)); /* should be long double */ - } else if (strchr ("EefgG", *p)) { + } else if (*p < 128 && strchr ("EefgG", *p)) { snprint (*va_arg (ap, double *)); - } else if (strchr ("DOU", *p)) { + } else if (*p < 128 && strchr ("DOU", *p)) { snprint (*va_arg (ap, long *)); } else if (*p == 'p') { snprint (*va_arg (ap, void **)); @@ -1724,10 +1987,17 @@ q = p; } va_end (ap); +#ifndef UTF8 n = strlen (q); if (n >= (size_t) (e - s)) return -1; memcpy (s, q, n + 1); +#else /* UTF8 */ + n = wcslen (q); + if (n >= (size_t) (e - s)) + return -1; + wmemcpy (s, q, n + 1); +#endif /* UTF8 */ return s + n - str; nospc: va_end (ap); @@ -1902,8 +2172,11 @@ } } if (replace_yes) { /* delete then insert new */ +#ifdef UTF8 + mc_wchar_t *winput2 = mbstr_to_wchar(exp2); +#endif /* UTF8 */ if (replace_scanf || replace_regexp) { - char repl_str[MAX_REPL_LEN + 2]; + mc_wchar_t repl_str[MAX_REPL_LEN + 2]; int ret = 0; /* we need to fill in sargs just like with scanf */ @@ -1912,17 +2185,25 @@ for (k = 1; k < NUM_REPL_ARGS && pmatch[k].rm_eo >= 0; k++) { +#ifndef UTF8 unsigned char *t; +#else /* UTF8 */ + mc_wchar_t *t; +#endif if (pmatch[k].rm_eo - pmatch[k].rm_so > 255) { ret = -1; break; } +#ifndef UTF8 t = (unsigned char *) &sargs[k - 1][0]; +#else /* UTF8 */ + t = (mc_wchar_t *) &sargs[k - 1][0]; +#endif /* UTF8 */ for (j = 0; j < pmatch[k].rm_eo - pmatch[k].rm_so && j < 255; j++, t++) - *t = (unsigned char) edit_get_byte (edit, + *t = edit_get_byte (edit, edit-> search_start - @@ -1939,13 +2220,22 @@ sargs[k - 1][0] = 0; } if (!ret) +#ifndef UTF8 ret = snprintf_p (repl_str, MAX_REPL_LEN + 2, exp2, PRINTF_ARGS); +#else /* UTF8 */ + ret = snprintf_p (repl_str, MAX_REPL_LEN + 2, winput2, PRINTF_ARGS); +#endif /* UTF8 */ if (ret >= 0) { times_replaced++; while (i--) edit_delete (edit); +#ifndef UTF8 while (repl_str[++i]) edit_insert (edit, repl_str[i]); +#else /* UTF8 */ + while (winput2[++i]) + edit_insert (edit, winput2[i]); +#endif /* UTF8 */ } else { edit_error_dialog (_(" Replace "), ret == -2 @@ -1957,10 +2247,18 @@ times_replaced++; while (i--) edit_delete (edit); +#ifndef UTF8 while (exp2[++i]) edit_insert (edit, exp2[i]); +#else /* UTF8 */ + while (winput2[++i]) + edit_insert (edit, winput2[i]); +#endif } edit->found_len = i; +#ifdef UTF8 + g_free (winput2); +#endif /* UTF8 */ } /* so that we don't find the same string again */ if (replace_backwards) { @@ -2132,16 +2430,17 @@ #define TEMP_BUF_LEN 1024 /* Return a null terminated length of text. Result must be g_free'd */ -static unsigned char * +static mc_wchar_t * edit_get_block (WEdit *edit, long start, long finish, int *l) { - unsigned char *s, *r; - r = s = g_malloc (finish - start + 1); + mc_wchar_t *s, *r; + r = s = g_malloc ((finish - start + 1) * sizeof(mc_wchar_t)); if (column_highlighting) { *l = 0; /* copy from buffer, excluding chars that are out of the column 'margins' */ while (start < finish) { - int c, x; + mc_wchar_t c; + int x; x = edit_move_forward3 (edit, edit_bol (edit, start), 0, start); c = edit_get_byte (edit, start); @@ -2174,11 +2473,15 @@ return 0; if (column_highlighting) { - unsigned char *block, *p; + mc_wchar_t *block, *p; int r; p = block = edit_get_block (edit, start, finish, &len); while (len) { +#ifndef UTF8 r = mc_write (file, p, len); +#else /* UTF8 */ + r = wchar_write (file, p, len); +#endif /* UTF8 */ if (r < 0) break; p += r; @@ -2186,15 +2489,19 @@ } g_free (block); } else { - unsigned char *buf; + mc_wchar_t *buf; int i = start, end; len = finish - start; - buf = g_malloc (TEMP_BUF_LEN); + buf = g_malloc (TEMP_BUF_LEN * sizeof(mc_wchar_t)); while (start != finish) { end = min (finish, start + TEMP_BUF_LEN); for (; i < end; i++) buf[i - start] = edit_get_byte (edit, i); +#ifndef UTF8 len -= mc_write (file, (char *) buf, end - start); +#else /* UTF8 */ + len -= wchar_write (file, buf, end - start); +#endif /* UTF8 */ start = end; } g_free (buf); @@ -2531,17 +2838,20 @@ /* prints at the cursor */ /* returns the number of chars printed */ +#ifndef UTF8 int edit_print_string (WEdit * e, const char *s) +#else /* UTF8 */ +int edit_print_wstring (WEdit * e, mc_wchar_t *s) +#endif /* UTF8 */ { int i = 0; while (s[i]) - edit_execute_cmd (e, -1, (unsigned char) s[i++]); + edit_execute_cmd (e, -1, s[i++]); e->force |= REDRAW_COMPLETELY; edit_update_screen (e); return i; } - static void pipe_mail (WEdit *edit, char *to, char *subject, char *cc) { FILE *p = 0; @@ -2635,15 +2945,20 @@ /* find first character of current word */ static int edit_find_word_start (WEdit *edit, long *word_start, int *word_len) { - int i, c, last; + int i; + mc_wint_t c, last; /* return if at begin of file */ if (edit->curs1 <= 0) return 0; - c = (unsigned char) edit_get_byte (edit, edit->curs1 - 1); + c = edit_get_byte (edit, edit->curs1 - 1); /* return if not at end or in word */ +#ifndef UTF8 if (isspace (c) || !(isalnum (c) || c == '_')) +#else /* UTF8 */ + if (iswspace (c) || !(iswalnum (c) || c == '_')) +#endif /* UTF8 */ return 0; /* search start of word to be completed */ @@ -2653,11 +2968,19 @@ return 0; last = c; - c = (unsigned char) edit_get_byte (edit, edit->curs1 - i); + c = edit_get_byte (edit, edit->curs1 - i); +#ifndef UTF8 if (!(isalnum (c) || c == '_')) { +#else /* UTF8 */ + if (!(iswalnum (c) || c == '_')) { +#endif /* UTF8 */ /* return if word starts with digit */ +#ifndef UTF8 if (isdigit (last)) +#else /* UTF8 */ + if (iswdigit (last)) +#endif /* UTF8 */ return 0; *word_start = edit->curs1 - (i - 1); /* start found */ @@ -2690,7 +3013,7 @@ int *num) { int len, max_len = 0, i, skip; - char *bufpos; + mc_wchar_t *bufpos; /* collect max MAX_WORD_COMPLETIONS completions */ while (*num < MAX_WORD_COMPLETIONS) { @@ -2711,9 +3034,16 @@ buffers1[start >> S_EDIT_BUF_SIZE][start & M_EDIT_BUF_SIZE]; skip = 0; for (i = 0; i < *num; i++) { +#ifndef UTF8 if (strncmp (&compl[i].text[word_len], &bufpos[word_len], - max (len, compl[i].len) - word_len) == 0) { + max (len, +#else /* UTF8 */ + if (wcsncmp + ((wchar_t *) &compl[i].text[word_len], + (wchar_t *) &bufpos[word_len], max (len, +#endif /* UTF8 */ + compl[i].len) - word_len) == 0) { skip = 1; break; /* skip it, already added */ } @@ -2721,7 +3051,7 @@ if (skip) continue; - compl[*num].text = g_malloc (len + 1); + compl[*num].text = g_malloc ((len + 1) * sizeof(mc_wchar_t)); compl[*num].len = len; for (i = 0; i < len; i++) compl[*num].text[i] = *(bufpos + i); @@ -2735,6 +3065,18 @@ return max_len; } +#ifdef UTF8 +int edit_print_string (WEdit * e, const char *s) +{ + int i; + mc_wchar_t *ws = mbstr_to_wchar(s); + i = edit_print_wstring (e, ws); + g_free(ws); + return i; +} + +#endif /* UTF8 */ + /* let the user select its preferred completion */ static void @@ -2747,6 +3089,10 @@ WListbox *compl_list; int compl_dlg_h; /* completion dialog height */ int compl_dlg_w; /* completion dialog width */ +#ifdef UTF8 + char *mbtext; +#endif /* UTF8 */ + /* calculate the dialog metrics */ compl_dlg_h = num_compl + 2; @@ -2782,8 +3128,16 @@ add_widget (compl_dlg, compl_list); /* fill the listbox with the completions */ +#ifndef UTF8 for (i = 0; i < num_compl; i++) listbox_add_item (compl_list, 0, 0, compl[i].text, NULL); +#else /* UTF8 */ + for (i = 0; i < num_compl; i++) { + mbtext = wchar_to_mbstr(compl[i].text); + listbox_add_item (compl_list, 0, 0, mbtext, NULL); + g_free(mbtext); + } +#endif /* UTF8 */ /* pop up the dialog */ run_dlg (compl_dlg); @@ -2791,9 +3145,17 @@ /* apply the choosen completion */ if (compl_dlg->ret_value == B_ENTER) { listbox_get_current (compl_list, &curr, NULL); - if (curr) + if (curr){ +#ifndef UTF8 for (curr += word_len; *curr; curr++) edit_insert (edit, *curr); +#else /* UTF8 */ + mc_wchar_t *wc, *wccurr = mbstr_to_wchar(curr); + for (wc = wccurr + word_len; *wc; wc++) + edit_insert (edit, *wc); + g_free(wccurr); +#endif /* UTF8 */ + } } /* destroy dialog before return */ @@ -2810,8 +3172,9 @@ { int word_len = 0, i, num_compl = 0, max_len; long word_start = 0; - char *bufpos; - char *match_expr; + mc_wchar_t *bufpos; + mc_wchar_t *match_expr; + char *mbmatch_expr; struct selection compl[MAX_WORD_COMPLETIONS]; /* completions */ /* don't want to disturb another search */ @@ -2828,16 +3191,32 @@ /* prepare match expression */ bufpos = &edit->buffers1[word_start >> S_EDIT_BUF_SIZE] [word_start & M_EDIT_BUF_SIZE]; + + match_expr = g_malloc((word_len + 14) * sizeof(mc_wchar_t)); +#ifndef UTF8 match_expr = g_strdup_printf ("%.*s[a-zA-Z_0-9]+", word_len, bufpos); +#else /* UTF8 */ + wcsncpy (match_expr, bufpos, word_len); + match_expr[word_len] = '\0'; + wcscat (match_expr, L"[a-zA-Z_0-9]+"); +#endif /* UTF8 */ /* init search: backward, regexp, whole word, case sensitive */ edit_set_search_parameters (0, 1, 1, 1, 1); /* collect the possible completions */ /* start search from curs1 down to begin of file */ +#ifndef UTF8 max_len = edit_collect_completions (edit, word_start, word_len, match_expr, (struct selection *) &compl, &num_compl); +#else /* UTF8 */ + mbmatch_expr = wchar_to_mbstr(match_expr); + max_len = + edit_collect_completions (edit, word_start, word_len, mbmatch_expr, + (struct selection *) &compl, &num_compl); + g_free(mbmatch_expr); +#endif /* UTF8 */ if (num_compl > 0) { /* insert completed word if there is only one match */ diff -urN mc-4.6.1.orig/edit/editdraw.c mc-4.6.1/edit/editdraw.c --- mc-4.6.1.orig/edit/editdraw.c 2005-05-27 20:19:18.000000000 +0600 +++ mc-4.6.1/edit/editdraw.c 2007-01-19 18:33:59.000000000 +0500 @@ -48,7 +48,7 @@ static void status_string (WEdit * edit, char *s, int w) { - char byte_str[16]; + char byte_str[32]; /* * If we are at the end of file, print , @@ -56,11 +56,16 @@ * as decimal and as hex. */ if (edit->curs1 < edit->last_byte) { - unsigned char cur_byte = edit_get_byte (edit, edit->curs1); + mc_wchar_t cur_byte = edit_get_byte (edit, edit->curs1); +#ifndef UTF8 g_snprintf (byte_str, sizeof (byte_str), "%c %3d 0x%02X", is_printable (cur_byte) ? cur_byte : '.', - (int) cur_byte, - (unsigned) cur_byte); +#else /* UTF8 */ + g_snprintf (byte_str, sizeof(byte_str), "%lc %3d 0x%02X", + iswprint(cur_byte) ? cur_byte : '.', +#endif /* UTF8 */ + (int) cur_byte, + (unsigned) cur_byte); } else { strcpy (byte_str, ""); } @@ -183,11 +188,16 @@ #define lowlevel_set_color(x) attrset(MY_COLOR_PAIR(color)) #endif +struct line_s { + mc_wchar_t ch; + unsigned int style; +}; + static void print_to_widget (WEdit *edit, long row, int start_col, int start_col_real, - long end_col, unsigned int line[]) + long end_col, struct line_s line[]) { - unsigned int *p; + struct line_s *p; int x = start_col_real + EDIT_TEXT_HORIZONTAL_OFFSET; int x1 = start_col + EDIT_TEXT_HORIZONTAL_OFFSET; @@ -201,9 +211,9 @@ edit_move (x1 + FONT_OFFSET_X, y + FONT_OFFSET_Y); p = line; - while (*p) { + while (p->ch) { int style; - int textchar; + mc_wchar_t textchar; int color; if (cols_to_skip) { @@ -212,9 +222,9 @@ continue; } - style = *p & 0xFF00; - textchar = *p & 0xFF; - color = *p >> 16; + style = p->style & 0xFF00; + textchar = p->ch; + color = p->style >> 16; if (style & MOD_ABNORMAL) { /* Non-printable - use black background */ @@ -228,8 +238,11 @@ } else { lowlevel_set_color (color); } - +#ifdef UTF8 + SLsmg_write_nwchars(&textchar, 1); +#else addch (textchar); +#endif p++; } } @@ -239,11 +252,11 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col, long end_col) { - static unsigned int line[MAX_LINE_LEN]; - unsigned int *p = line; + struct line_s line[MAX_LINE_LEN]; + struct line_s *p = line; long m1 = 0, m2 = 0, q, c1, c2; int col, start_col_real; - unsigned int c; + mc_wint_t c; int color; int i, book_mark = -1; @@ -265,66 +278,96 @@ if (row <= edit->total_lines - edit->start_line) { while (col <= end_col - edit->start_col) { - *p = 0; + p->ch = 0; + p->style = 0; if (q == edit->curs1) - *p |= MOD_CURSOR; + p->style |= MOD_CURSOR; if (q >= m1 && q < m2) { if (column_highlighting) { int x; x = edit_move_forward3 (edit, b, 0, q); if (x >= c1 && x < c2) - *p |= MOD_MARKED; + p->style |= MOD_MARKED; } else - *p |= MOD_MARKED; + p->style |= MOD_MARKED; } if (q == edit->bracket) - *p |= MOD_BOLD; + p->style |= MOD_BOLD; if (q >= edit->found_start && q < edit->found_start + edit->found_len) - *p |= MOD_BOLD; + p->style |= MOD_BOLD; c = edit_get_byte (edit, q); /* we don't use bg for mc - fg contains both */ if (book_mark == -1) { edit_get_syntax_color (edit, q, &color); - *p |= color << 16; + p->style |= color << 16; } else { - *p |= book_mark << 16; + p->style |= book_mark << 16; } q++; switch (c) { case '\n': col = end_col - edit->start_col + 1; /* quit */ - *(p++) |= ' '; + p->ch = ' '; + p++; break; case '\t': i = TAB_SIZE - ((int) col % TAB_SIZE); - *p |= ' '; - c = *(p++) & ~MOD_CURSOR; + p->ch = ' '; + c = p->style & ~MOD_CURSOR; + p++; col += i; - while (--i) - *(p++) = c; + while (--i) { + p->ch = ' '; p->style = c; + p++; + } break; default: c = convert_to_display_c (c); /* Caret notation for control characters */ if (c < 32) { - *(p++) = '^' | MOD_ABNORMAL; - *(p++) = (c + 0x40) | MOD_ABNORMAL; + p->ch = '^'; + p->style = MOD_ABNORMAL; + p++; + p->ch = c + 0x40; + p->style = MOD_ABNORMAL; col += 2; break; } if (c == 127) { - *(p++) = '^' | MOD_ABNORMAL; - *(p++) = '?' | MOD_ABNORMAL; + p->ch = '^'; + p->style = MOD_ABNORMAL; + p++; + p->ch = '?'; + p->style = MOD_ABNORMAL; + p++; col += 2; break; } - if (is_printable (c)) { - *(p++) |= c; +#ifndef UTF8 + if (is_printable (c) +#else /* UTF8 */ + if (iswprint (c) +#ifdef __STDC_ISO_10646__ + && (c < BINARY_CHAR_OFFSET || c >= (BINARY_CHAR_OFFSET + 256)) +#endif +#endif /* UTF8 */ + ) { + p->ch = c; + p++; + +#ifdef UTF8 + i = wcwidth(c); + if (i > 1) { + col += i - 1; + } +#endif /* UTF8 */ } else { - *(p++) = '.' | MOD_ABNORMAL; + p->ch = '.'; + p->style = MOD_ABNORMAL; + p++; } col++; break; @@ -334,7 +377,7 @@ } else { start_col_real = start_col = 0; } - *p = 0; + p->ch = 0; print_to_widget (edit, row, start_col, start_col_real, end_col, line); } diff -urN mc-4.6.1.orig/edit/edit.h mc-4.6.1/edit/edit.h --- mc-4.6.1.orig/edit/edit.h 2005-05-27 20:19:18.000000000 +0600 +++ mc-4.6.1/edit/edit.h 2007-01-19 18:33:58.000000000 +0500 @@ -39,6 +39,27 @@ #include "../src/global.h" +#include "src/tty.h" + +#ifdef UTF8 +#include +#include + +#define mc_wchar_t wchar_t +#define mc_wint_t wint_t + +#else + +#define mc_wchar_t unsigned char +#define mc_wint_t int + +#endif + + +/* unicode private use area */ +#define BINARY_CHAR_OFFSET 0xFFE00 + + #define N_menus 5 #define SEARCH_DIALOG_OPTION_NO_SCANF 1 @@ -99,6 +120,8 @@ #define START_STACK_SIZE 32 /* Some codes that may be pushed onto or returned from the undo stack */ +#define CHAR_INSERT 65 +#define CHAR_INSERT_AHEAD 66 #define CURS_LEFT 601 #define CURS_RIGHT 602 #define DELCHAR 603 @@ -118,7 +141,7 @@ struct macro { short command; - short ch; + mc_wchar_t ch; }; struct WEdit; @@ -132,26 +155,8 @@ void menu_save_mode_cmd (void); int edit_raw_key_query (const char *heading, const char *query, int cancel); int edit_file (const char *_file, int line); -int edit_translate_key (WEdit *edit, long x_key, int *cmd, int *ch); - -#ifndef NO_INLINE_GETBYTE -int edit_get_byte (WEdit * edit, long byte_index); -#else -static inline int edit_get_byte (WEdit * edit, long byte_index) -{ - unsigned long p; - if (byte_index >= (edit->curs1 + edit->curs2) || byte_index < 0) - return '\n'; - - if (byte_index >= edit->curs1) { - p = edit->curs1 + edit->curs2 - byte_index - 1; - return edit->buffers2[p >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (p & M_EDIT_BUF_SIZE) - 1]; - } else { - return edit->buffers1[byte_index >> S_EDIT_BUF_SIZE][byte_index & M_EDIT_BUF_SIZE]; - } -} -#endif - +int edit_translate_key (WEdit *edit, long x_key, int *cmd, mc_wint_t *ch); +mc_wchar_t edit_get_byte (WEdit * edit, long byte_index); int edit_count_lines (WEdit * edit, long current, int upto); long edit_move_forward (WEdit * edit, long current, int lines, long upto); long edit_move_forward3 (WEdit * edit, long current, int cols, long upto); @@ -176,11 +181,11 @@ void edit_delete_line (WEdit * edit); int edit_delete (WEdit * edit); -void edit_insert (WEdit * edit, int c); +void edit_insert (WEdit * edit, mc_wchar_t c); int edit_cursor_move (WEdit * edit, long increment); void edit_push_action (WEdit * edit, long c, ...); void edit_push_key_press (WEdit * edit); -void edit_insert_ahead (WEdit * edit, int c); +void edit_insert_ahead (WEdit * edit, mc_wchar_t c); long edit_write_stream (WEdit * edit, FILE * f); char *edit_get_write_filter (const char *writename, const char *filename); int edit_save_confirm_cmd (WEdit * edit); @@ -212,7 +217,7 @@ int eval_marks (WEdit * edit, long *start_mark, long *end_mark); void edit_status (WEdit * edit); void edit_execute_key_command (WEdit *edit, int command, - int char_for_insertion); + mc_wint_t char_for_insertion); void edit_update_screen (WEdit * edit); int edit_print_string (WEdit * e, const char *s); void edit_move_to_line (WEdit * e, long line); @@ -256,7 +261,7 @@ void format_paragraph (WEdit *edit, int force); /* either command or char_for_insertion must be passed as -1 */ -void edit_execute_cmd (WEdit *edit, int command, int char_for_insertion); +void edit_execute_cmd (WEdit *edit, int command, mc_wint_t char_for_insertion); #define get_sys_error(s) (s) diff -urN mc-4.6.1.orig/edit/editkeys.c mc-4.6.1/edit/editkeys.c --- mc-4.6.1.orig/edit/editkeys.c 2005-05-27 20:19:18.000000000 +0600 +++ mc-4.6.1/edit/editkeys.c 2007-01-19 18:33:59.000000000 +0500 @@ -162,10 +162,10 @@ * 'command' is one of the editor commands from editcmddef.h. */ int -edit_translate_key (WEdit *edit, long x_key, int *cmd, int *ch) +edit_translate_key (WEdit *edit, long x_key, int *cmd, mc_wint_t *ch) { int command = CK_Insert_Char; - int char_for_insertion = -1; + mc_wint_t char_for_insertion = -1; int i = 0; static const long *key_map; @@ -205,7 +205,7 @@ #ifdef HAVE_CHARSET if (x_key == XCTRL ('t')) { - do_select_codepage (); + do_select_codepage (_(" Choose codepage ")); edit->force = REDRAW_COMPLETELY; command = CK_Refresh; @@ -242,9 +242,30 @@ /* an ordinary insertable character */ if (x_key < 256) { int c = convert_from_input_c (x_key); - +#ifdef UTF8 + mbstate_t mbs; + int res; + mc_wchar_t wc; + + memset (&mbs, 0, sizeof (mbs)); + + if (edit->charpoint >= MB_CUR_MAX) edit->charpoint = 0; + + edit->charbuf[edit->charpoint++] = c; + + res = mbrtowc(&wc, (char *)edit->charbuf, edit->charpoint, &mbs); + if (res < 0) { + if (res != -2) edit->charpoint = 0; /* broken multibyte char, skip */ + return 0; + } + edit->charpoint = 0; + + if (iswprint (wc)) { + char_for_insertion = wc; +#else if (is_printable (c)) { char_for_insertion = c; +#endif /* UTF8 */ goto fin; } } @@ -285,7 +306,7 @@ *cmd = command; *ch = char_for_insertion; - if (command == CK_Insert_Char && char_for_insertion == -1) { + if (command == CK_Insert_Char && char_for_insertion == (mc_wint_t)-1) { /* unchanged, key has no function here */ return 0; } diff -urN mc-4.6.1.orig/edit/editwidget.c mc-4.6.1/edit/editwidget.c --- mc-4.6.1.orig/edit/editwidget.c 2005-05-27 20:19:18.000000000 +0600 +++ mc-4.6.1/edit/editwidget.c 2007-01-19 18:33:58.000000000 +0500 @@ -337,7 +337,8 @@ case WIDGET_KEY: { - int cmd, ch; + int cmd; + mc_wint_t ch; /* first check alt-f, alt-e, alt-s, etc for drop menus */ if (edit_drop_hotkey_menu (e, parm)) diff -urN mc-4.6.1.orig/edit/edit-widget.h mc-4.6.1/edit/edit-widget.h --- mc-4.6.1.orig/edit/edit-widget.h 2003-10-29 13:54:47.000000000 +0500 +++ mc-4.6.1/edit/edit-widget.h 2007-01-19 18:33:58.000000000 +0500 @@ -24,6 +24,11 @@ unsigned char border; }; +struct action { + mc_wchar_t ch; + long flags; +}; + struct WEdit { Widget widget; @@ -36,8 +41,17 @@ /* 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 */ @@ -81,7 +95,7 @@ /* 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; @@ -92,6 +106,7 @@ /* syntax higlighting */ struct _syntax_marker *syntax_marker; struct context_rule **rules; + size_t rules_count; /* number of rules that are defined */ long last_get_rule; struct syntax_rule rule; char *syntax_type; /* description of syntax highlighting type being used */ diff -urN mc-4.6.1.orig/edit/syntax.c mc-4.6.1/edit/syntax.c --- mc-4.6.1.orig/edit/syntax.c 2005-05-27 20:19:18.000000000 +0600 +++ mc-4.6.1/edit/syntax.c 2007-01-19 18:33:58.000000000 +0500 @@ -662,6 +662,7 @@ strcpy (whole_right, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890"); r = edit->rules = g_malloc (alloc_contexts * sizeof (struct context_rule *)); + edit->rules_count = 0; if (!edit->defines) edit->defines = g_tree_new ((GCompareFunc) strcmp); @@ -892,6 +893,7 @@ if (num_contexts == -1) { return line; } + edit->rules_count = num_contexts; { char *first_chars, *p; @@ -916,17 +918,18 @@ void edit_free_syntax_rules (WEdit * edit) { - int i, j; + size_t i, j; if (!edit) return; if (edit->defines) destroy_defines (&edit->defines); if (!edit->rules) return; - edit_get_rule (edit, -1); + if (edit->rules_count > 0) + edit_get_rule (edit, -1); syntax_g_free (edit->syntax_type); edit->syntax_type = 0; - for (i = 0; edit->rules[i]; i++) { + for (i = 0; i < edit->rules_count; i++) { if (edit->rules[i]->keyword) { for (j = 0; edit->rules[i]->keyword[j]; j++) { syntax_g_free (edit->rules[i]->keyword[j]->keyword); diff -urN mc-4.6.1.orig/edit/wordproc.c mc-4.6.1/edit/wordproc.c --- mc-4.6.1.orig/edit/wordproc.c 2005-05-27 20:19:18.000000000 +0600 +++ mc-4.6.1/edit/wordproc.c 2007-01-19 18:33:58.000000000 +0500 @@ -24,7 +24,12 @@ #define tab_width option_tab_spacing +#ifndef UTF8 #define NO_FORMAT_CHARS_START "-+*\\,.;:&>" +#else /* UTF8 */ +#define NO_FORMAT_CHARS_START L"-+*\\,.;:&>" +#endif /* UTF8 */ + #define FONT_MEAN_WIDTH 1 static long @@ -41,14 +46,21 @@ p = edit_move_forward (edit, p, line - l, 0); p = edit_bol (edit, p); + +#ifndef UTF8 while (strchr ("\t ", edit_get_byte (edit, p))) +#else /* UTF8 */ + while (wcschr (L"\t ", edit_get_byte (edit, p))) +#endif /* UTF8 */ + p++; return p; } static int bad_line_start (WEdit * edit, long p) { - int c; + mc_wint_t c; + c = edit_get_byte (edit, p); if (c == '.') { /* `...' is acceptable */ if (edit_get_byte (edit, p + 1) == '.') @@ -62,7 +74,13 @@ return 0; /* `---' is acceptable */ return 1; } + +#ifndef UTF8 if (strchr (NO_FORMAT_CHARS_START, c)) +#else /* UTF8 */ + if (wcschr (NO_FORMAT_CHARS_START, c)) +#endif /* UTF8 */ + return 1; return 0; } @@ -115,33 +133,37 @@ i - edit->curs_line, 0)); } -static unsigned char * +static mc_wchar_t * get_paragraph (WEdit *edit, long p, long q, int indent, int *size) { - unsigned char *s, *t; + mc_wchar_t *s, *t; #if 0 - t = g_malloc ((q - p) + 2 * (q - p) / option_word_wrap_line_length + - 10); + t = g_malloc (((q - p) + 2 * (q - p) / option_word_wrap_line_length + + 10) * sizeof(mc_wchar_t)); #else - t = g_malloc (2 * (q - p) + 100); + t = g_malloc ((2 * (q - p) + 100) * sizeof(mc_wchar_t)); #endif if (!t) return 0; for (s = t; p < q; p++, s++) { if (indent) if (edit_get_byte (edit, p - 1) == '\n') +#ifndef UTF8 while (strchr ("\t ", edit_get_byte (edit, p))) +#else /* UTF8 */ + while (wcschr (L"\t ", edit_get_byte (edit, p))) +#endif /* UTF8 */ p++; *s = edit_get_byte (edit, p); } - *size = (unsigned long) s - (unsigned long) t; + *size = s - t; t[*size] = '\n'; return t; } -static void strip_newlines (unsigned char *t, int size) +static void strip_newlines (mc_wchar_t *t, int size) { - unsigned char *p = t; + mc_wchar_t *p = t; while (size--) { *p = *p == '\n' ? ' ' : *p; p++; @@ -158,7 +180,7 @@ { return x += tab_width - x % tab_width; } -static int line_pixel_length (unsigned char *t, long b, int l) +static int line_pixel_length (mc_wchar_t *t, long b, int l) { int x = 0, c, xn = 0; for (;;) { @@ -182,7 +204,7 @@ } /* find the start of a word */ -static int next_word_start (unsigned char *t, int q, int size) +static int next_word_start (mc_wchar_t *t, int q, int size) { int i; for (i = q;; i++) { @@ -203,7 +225,7 @@ } /* find the start of a word */ -static int word_start (unsigned char *t, int q, int size) +static int word_start (mc_wchar_t *t, int q, int size) { int i = q; if (t[q] == ' ' || t[q] == '\t') @@ -222,7 +244,7 @@ } /* replaces ' ' with '\n' to properly format a paragraph */ -static void format_this (unsigned char *t, int size, int indent) +static void format_this (mc_wchar_t *t, int size, int indent) { int q = 0, ww; strip_newlines (t, size); @@ -250,7 +272,7 @@ } } -static void replace_at (WEdit * edit, long q, int c) +static void replace_at (WEdit * edit, long q, mc_wint_t c) { edit_cursor_move (edit, q - edit->curs1); edit_delete (edit); @@ -258,18 +280,27 @@ } /* replaces a block of text */ -static void put_paragraph (WEdit * edit, unsigned char *t, long p, long q, int indent, int size) +static void put_paragraph (WEdit * edit, mc_wchar_t *t, long p, long q, int indent, int size) { long cursor; - int i, c = 0; + int i; + mc_wchar_t c = 0; cursor = edit->curs1; if (indent) +#ifndef UTF8 while (strchr ("\t ", edit_get_byte (edit, p))) +#else /* UTF8 */ + while (wcschr (L"\t ", edit_get_byte (edit, p))) +#endif /* UTF8 */ p++; for (i = 0; i < size; i++, p++) { if (i && indent) { if (t[i - 1] == '\n' && c == '\n') { +#ifndef UTF8 while (strchr ("\t ", edit_get_byte (edit, p))) +#else /* UTF8 */ + while (wcschr (L"\t ", edit_get_byte (edit, p))) +#endif /* UTF8 */ p++; } else if (t[i - 1] == '\n') { long curs; @@ -281,7 +312,11 @@ p = edit->curs1; } else if (c == '\n') { edit_cursor_move (edit, p - edit->curs1); +#ifndef UTF8 while (strchr ("\t ", edit_get_byte (edit, p))) { +#else /* UTF8 */ + while (wcschr (L"\t ", edit_get_byte (edit, p))) { +#endif /* UTF8 */ edit_delete (edit); if (cursor > edit->curs1) cursor--; @@ -314,7 +349,7 @@ { long p, q; int size; - unsigned char *t; + mc_wchar_t *t; int indent = 0; if (option_word_wrap_line_length < 2) return; @@ -324,17 +359,25 @@ q = end_paragraph (edit, force); indent = test_indent (edit, p, q); t = get_paragraph (edit, p, q, indent, &size); - if (!t) + if (!t) return; if (!force) { int i; +#ifndef UTF8 if (strchr (NO_FORMAT_CHARS_START, *t)) { +#else /* UTF8 */ + if (wcschr (NO_FORMAT_CHARS_START, *t)) { +#endif /* UTF8 */ g_free (t); return; } for (i = 0; i < size - 1; i++) { if (t[i] == '\n') { +#ifndef UTF8 if (strchr (NO_FORMAT_CHARS_START "\t ", t[i + 1])) { +#else /* UTF8 */ + if (wcschr (NO_FORMAT_CHARS_START "\t", t[i + 1])) { +#endif /* UTF8 */ g_free (t); return; } diff -urN mc-4.6.1.orig/lib/mc.menu mc-4.6.1/lib/mc.menu --- mc-4.6.1.orig/lib/mc.menu 2004-08-17 14:31:16.000000000 +0600 +++ mc-4.6.1/lib/mc.menu 2007-01-19 18:33:58.000000000 +0500 @@ -15,7 +15,7 @@ 0 Edit a bug report and send it to root I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1 - ${EDITOR-vi} $I + ${EDITOR-editor} $I test -r $I && mail root < $I rm -f $I @@ -330,3 +330,7 @@ o Open next a free console open -s -- sh +=+ f \.dsc$ & t r +x Extract the contents of a Debian source package + dpkg-source -x %f + diff -urN mc-4.6.1.orig/po/de.po mc-4.6.1/po/de.po --- mc-4.6.1.orig/po/de.po 2005-07-23 22:53:27.000000000 +0600 +++ mc-4.6.1/po/de.po 2007-01-19 18:33:58.000000000 +0500 @@ -1412,7 +1412,7 @@ #: src/cmd.c:988 #, c-format msgid " edit symlink: %s " -msgstr " symbolschen Link barbeiten: %s" +msgstr " symbolschen Link bearbeiten: %s" #: src/cmd.c:999 #, c-format @@ -1562,7 +1562,7 @@ " Cannot create temporary command file \n" " %s " msgstr "" -" Kann temporäre Befehlsdaei nicht anlegen \n" +" Kann temporäre Befehlsdatei nicht anlegen \n" " %s " #: src/ext.c:117 src/user.c:606 @@ -1670,7 +1670,7 @@ " Cannot stat source file \"%s\" \n" " %s " msgstr "" -" Kann Quelldaei \"%s\" nicht untersuchen \n" +" Kann Quelldatei \"%s\" nicht untersuchen \n" " %s " #: src/file.c:517 src/file.c:1058 @@ -2576,7 +2576,7 @@ #: src/learn.c:115 #, c-format msgid " You have entered \"%s\"" -msgstr " Sie haben \"%s\" einggeben" +msgstr " Sie haben \"%s\" eingegeben" #. TRANSLATORS: This label appears near learned keys. Keep it short. #: src/learn.c:164 @@ -2668,7 +2668,7 @@ #: src/main.c:811 src/main.c:835 msgid "S&hell link..." -msgstr "Shell-Verbindung..." +msgstr "S&hell-Verbindung..." #: src/main.c:813 src/main.c:837 msgid "SM&B link..." @@ -4200,7 +4200,7 @@ #: vfs/ftpfs.c:684 #, c-format msgid "ftpfs: connection to server failed: %s" -msgstr "ftpfs: Verbindung zum Server fehlgeschlgen: %s" +msgstr "ftpfs: Verbindung zum Server fehlgeschlagen: %s" #: vfs/ftpfs.c:725 #, c-format diff -urN mc-4.6.1.orig/po/it.po mc-4.6.1/po/it.po --- mc-4.6.1.orig/po/it.po 2005-07-23 22:53:28.000000000 +0600 +++ mc-4.6.1/po/it.po 2007-01-19 18:33:58.000000000 +0500 @@ -2098,7 +2098,7 @@ #: src/filegui.c:524 msgid "A&ppend" -msgstr "Atta&cca" +msgstr "atta&Cca" #: src/filegui.c:527 msgid "Overwrite this target?" diff -urN mc-4.6.1.orig/po/ru.po mc-4.6.1/po/ru.po --- mc-4.6.1.orig/po/ru.po 2005-07-23 22:53:30.000000000 +0600 +++ mc-4.6.1/po/ru.po 2007-01-19 18:33:59.000000000 +0500 @@ -4503,3 +4503,32 @@ #: vfs/vfs.c:894 msgid "Changes to file lost" msgstr "éÚÍÅÎÅÎÉÑ ÄÌÑ ÆÁÊÌÁ ÐÏÔÅÒÑÎÙ" + +#: messages for recode patch +msgid "Panel &codepage" +msgstr "ëÏÄÉÒÏ×ËÁ ÐÁÎÅÌÉ" + +msgid " Choose codepage " +msgstr " ÷ÙÂÅÒÉÔÅ ËÏÄÉÒÏ×ËÕ" + +msgid " Choose panel codepage " +msgstr " ÷ÙÂÅÒÉÔÅ ËÏÄÉÒÏ×ËÕ ÐÁÎÅÌÉ " + +msgid " Choose default FTP codepage " +msgstr " ÷ÙÂÅÒÉÔÅ ËÏÄÉÒÏ×ËÕ FTP ÐÏ ÕÍÏÌÞÁÎÉÀ " + +msgid "FTP default codepage:" +msgstr "ëÏÄÉÒÏ×ËÁ FTP ÐÏ ÕÍÏÌÞÁÎÉÀ:" + +msgid "Recode file names:" +msgstr "ðÅÒÅËÏÄÉÒÏ×ÁÔØ ÉÍÅÎÁ:" + +msgid "Recoding works only with COPY/MOVE operation" +msgstr "ðÅÒÅËÏÄÉÒÏ×ËÁ ÒÁÂÏÔÁÅÔ ÔÏÌØËÏ ÄÌÑ ÏÐÅÒÁÃÉÊ ËÏÐÉÒÏ×ÁÎÉÑ/ÐÅÒÅÍÅÝÅÎÉÑ" + +msgid " Choose \"FROM\" codepage for COPY/MOVE operaion " +msgstr" ÷ÙÂÅÒÉÔÅ ÎÁÞÁÌØÎÕÀ ËÏÄÉÒÏ×ËÕ ÄÌÑ ÏÐÅÒÁÃÉÉ ËÏÐÉÒÏ×ÁÎÉÑ/ÐÅÒÅÍÅÝÅÎÉÑ " + +msgid " Choose \"TO\" codepage for COPY/MOVE operaion " +msgstr" ÷ÙÂÅÒÉÔÅ ËÏÎÅÞÎÕÀ ËÏÄÉÒÏ×ËÕ ÄÌÑ ÏÐÅÒÁÃÉÉ ËÏÐÉÒÏ×ÁÎÉÑ/ÐÅÒÅÍÅÝÅÎÉÑ " + diff -urN mc-4.6.1.orig/po/vi.po mc-4.6.1/po/vi.po --- mc-4.6.1.orig/po/vi.po 1970-01-01 05:00:00.000000000 +0500 +++ mc-4.6.1/po/vi.po 2007-01-19 18:33:58.000000000 +0500 @@ -0,0 +1,4456 @@ +# Vietnamese translation of Midnight Commander +# Copyright (C) 1998-2003, 2005 Free Software Foundation, Inc. +# First translator(s): Phan Vinh Thinh , 2005. +# +# +msgid "" +msgstr "" +"Project-Id-Version: mc 4.6.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2003-12-24 12:16-0500\n" +"PO-Revision-Date: 2005-03-29 01:20+0300\n" +"Last-Translator: Phan Vinh Thinh \n" +"Language-Team: Vietnamese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.9.1\n" + +#: edit/edit.c:146 edit/edit.c:277 edit/edit.c:285 edit/edit.c:333 +#: edit/edit.c:348 edit/edit.c:359 edit/edit.c:375 edit/edit.c:2665 +#: edit/editcmd.c:282 edit/editcmd.c:290 edit/editcmd.c:1719 src/wtools.c:120 +#: src/wtools.c:275 +msgid "Error" +msgstr "Lá»—i" + +#: edit/edit.c:149 edit/edit.c:336 +msgid " Cannot open file for reading: " +msgstr " Không thể mở tập tin để Ä‘á»c: " + +#: edit/edit.c:279 +msgid " Error reading from pipe: " +msgstr " Lá»—i Ä‘á»c từ đưá»ng ống (pipe): " + +#: edit/edit.c:288 +msgid " Cannot open pipe for reading: " +msgstr " Không thể mở đưá»ng ống để Ä‘á»c: " + +#: edit/edit.c:351 +msgid " Cannot get size/permissions info for file: " +msgstr " Không lấy được thông tin kích thước/quyá»n hạn cá»§a tập tin: " + +#: edit/edit.c:360 +msgid " Not an ordinary file: " +msgstr " Tập tin không thông thưá»ng: " + +#: edit/edit.c:376 +msgid " File is too large: " +msgstr " Tập tin quá lá»›n: " + +#: edit/edit.c:2665 +msgid "Macro recursion is too deep" +msgstr "Äệ qui cá»§a macro quá sâu" + +#: edit/edit.h:262 +msgid "&Dismiss" +msgstr "Äó&ng" + +#: edit/edit.h:264 edit/editcmd.c:382 edit/editcmd.c:1228 edit/editcmd.c:1310 +#: edit/editcmd.c:2569 edit/editmenu.c:37 edit/editoptions.c:71 +#: src/boxes.c:139 src/boxes.c:276 src/boxes.c:372 src/boxes.c:464 +#: src/boxes.c:590 src/boxes.c:713 src/boxes.c:835 src/boxes.c:945 +#: src/boxes.c:1013 src/filegui.c:763 src/find.c:184 src/layout.c:348 +#: src/option.c:113 src/subshell.c:323 src/view.c:2107 src/wtools.c:441 +msgid "&OK" +msgstr "Äồng ý &=" + +#: edit/editcmd.c:45 edit/editcmd.c:46 +msgid " Enter file name: " +msgstr " Hãy nhập tên tập tin: " + +#: edit/editcmd.c:283 +msgid " Error writing to pipe: " +msgstr " Lá»—i ghi vào đưá»ng ống: " + +#: edit/editcmd.c:293 +msgid " Cannot open pipe for writing: " +msgstr " Không thể mở đưá»ng ống để ghi: " + +#: edit/editcmd.c:375 +msgid "Quick save " +msgstr "&Lưu nhanh" + +#: edit/editcmd.c:376 +msgid "Safe save " +msgstr "Lưu &an toàn" + +#: edit/editcmd.c:377 +msgid "Do backups -->" +msgstr "&Sao lưu -->" + +#: edit/editcmd.c:380 edit/editcmd.c:1169 edit/editcmd.c:1226 +#: edit/editcmd.c:1308 edit/editcmd.c:2567 edit/editoptions.c:68 +#: src/achown.c:68 src/boxes.c:140 src/boxes.c:277 src/boxes.c:370 +#: src/boxes.c:462 src/boxes.c:588 src/boxes.c:711 src/boxes.c:833 +#: src/boxes.c:1013 src/chmod.c:96 src/chown.c:72 src/cmd.c:856 +#: src/filegui.c:745 src/find.c:184 src/hotlist.c:121 src/hotlist.c:523 +#: src/hotlist.c:830 src/hotlist.c:926 src/layout.c:349 src/learn.c:58 +#: src/option.c:114 src/panelize.c:66 src/view.c:441 src/view.c:2104 +#: src/wtools.c:46 src/wtools.c:439 +msgid "&Cancel" +msgstr "Äóng há»™p thoại &-" + +#: edit/editcmd.c:386 +msgid "Extension:" +msgstr "&Mở rá»™ng:" + +#: edit/editcmd.c:392 +msgid " Edit Save Mode " +msgstr " Chế độ ghi nhá»› " + +#: edit/editcmd.c:465 edit/editcmd.c:524 +msgid " Save As " +msgstr " Ghi như " + +#: edit/editcmd.c:482 edit/editcmd.c:804 edit/editcmd.c:841 +#: edit/editcmd.c:1000 edit/editcmd.c:1113 src/file.c:599 src/help.c:318 +#: src/main.c:424 src/screen.c:1415 src/selcodepage.c:105 src/subshell.c:319 +#: src/subshell.c:653 src/utilunix.c:401 src/utilunix.c:405 src/utilunix.c:427 +#: vfs/mcfs.c:138 +msgid "Warning" +msgstr "Cảnh báo" + +#: edit/editcmd.c:483 +msgid " A file already exists with this name. " +msgstr " Tập tin có tên như vậy đã tồn tại. " + +#: edit/editcmd.c:484 +msgid "Overwrite" +msgstr "Ghi chèn" + +#: edit/editcmd.c:484 edit/editcmd.c:569 edit/editcmd.c:768 edit/editcmd.c:804 +#: edit/editcmd.c:844 edit/editcmd.c:1003 edit/editcmd.c:1116 +msgid "Cancel" +msgstr "Há»§y bá»" + +#: edit/editcmd.c:526 edit/editcmd.c:2293 src/view.c:440 +msgid " Cannot save file. " +msgstr " Không thể ghi nhá»› tập tin. " + +#: edit/editcmd.c:626 edit/editcmd.c:634 edit/editcmd.c:659 edit/editcmd.c:706 +msgid " Delete macro " +msgstr " Xóa macro " + +#: edit/editcmd.c:628 +msgid " Cannot open temp file " +msgstr " Không thể mở tập tin tạm thá»i " + +#: edit/editcmd.c:636 edit/editcmd.c:697 edit/editcmd.c:754 +msgid " Cannot open macro file " +msgstr " Không thể mở tập tin chứa các macro " + +#: edit/editcmd.c:660 +msgid " Cannot overwrite macro file " +msgstr " Không thể ghi chèn lên tập tin chứa các macro " + +#: edit/editcmd.c:676 edit/editcmd.c:697 +msgid " Save macro " +msgstr " Ghi nhá»› macro " + +#: edit/editcmd.c:678 +msgid " Press the macro's new hotkey: " +msgstr " Hãy nhấn phím tắt má»›i cá»§a macro: " + +#: edit/editcmd.c:707 edit/editkeys.c:195 edit/editkeys.c:225 +msgid " Press macro hotkey: " +msgstr " Hãy nhấn phím tắt cá»§a macro: " + +#: edit/editcmd.c:753 +msgid " Load macro " +msgstr " Nạp macro " + +#: edit/editcmd.c:766 +msgid " Confirm save file? : " +msgstr " Phê chuẩn việc ghi nhá»› tập tin?: " + +#: edit/editcmd.c:768 src/view.c:439 +msgid " Save file " +msgstr " Ghi nhá»› tập tin " + +#: edit/editcmd.c:768 edit/editwidget.c:288 src/view.c:2220 +msgid "Save" +msgstr "Ghinhá»›" + +#: edit/editcmd.c:804 edit/editcmd.c:842 +msgid "" +" Current text was modified without a file save. \n" +" Continue discards these changes. " +msgstr "" +" Văn bản hiện thá»i đã thay đổi và chưa được ghi nhá»›. \n" +" Tiếp tục thao tác sẽ làm mất những thay đổi này. " + +#: edit/editcmd.c:804 edit/editcmd.c:843 edit/editcmd.c:1003 +#: edit/editcmd.c:1116 +msgid "Continue" +msgstr "Tiếp tục" + +#: edit/editcmd.c:850 +msgid " Load " +msgstr " Nạp " + +#: edit/editcmd.c:1002 edit/editcmd.c:1115 +msgid " Block is large, you may not be able to undo this action. " +msgstr " Khối quá lá»›n, có thể bạn sẽ không há»§y bỠđược bước này. " + +#: edit/editcmd.c:1171 +msgid "O&ne" +msgstr "&Má»™t" + +#: edit/editcmd.c:1173 src/file.c:2210 src/filegui.c:521 +msgid "A&ll" +msgstr "&Tất cả" + +#: edit/editcmd.c:1175 src/file.c:2147 src/filegui.c:210 +msgid "&Skip" +msgstr "&Bá» qua" + +#: edit/editcmd.c:1177 +msgid "&Replace" +msgstr "&Thay thế" + +#: edit/editcmd.c:1184 edit/editcmd.c:1191 +msgid " Replace with: " +msgstr " Thay thế bằng: " + +#: edit/editcmd.c:1196 +msgid " Confirm replace " +msgstr " Phê chuẩn thay thế " + +#: edit/editcmd.c:1230 edit/editcmd.c:1312 +msgid "scanf &Expression" +msgstr "biểu thức &Scanf" + +#: edit/editcmd.c:1232 +msgid "replace &All" +msgstr "&Thay thế tất cả" + +#: edit/editcmd.c:1234 +msgid "pr&Ompt on replace" +msgstr "&Há»i trước khi thay" + +#: edit/editcmd.c:1236 edit/editcmd.c:1314 src/view.c:2110 +msgid "&Backwards" +msgstr "&Tìm ngược lại" + +#: edit/editcmd.c:1238 edit/editcmd.c:1316 +msgid "&Regular expression" +msgstr "&Biểu thức chính quy" + +#: edit/editcmd.c:1240 edit/editcmd.c:1318 +msgid "&Whole words only" +msgstr "&Chỉ những từ đầy đủ" + +#: edit/editcmd.c:1242 edit/editcmd.c:1320 src/find.c:176 +msgid "case &Sensitive" +msgstr "có tính &Kiểu chữ" + +#: edit/editcmd.c:1246 +msgid " Enter replacement argument order eg. 3,2,1,4 " +msgstr " Hãy nhập thứ tá»± cá»§a tham số thay thế, ví dụ 3,2,1,4 " + +#: edit/editcmd.c:1250 +msgid " Enter replacement string:" +msgstr " Nhập chuá»—i thay thế:" + +#: edit/editcmd.c:1254 edit/editcmd.c:1324 src/view.c:2115 +msgid " Enter search string:" +msgstr " Nhập chuá»—i tìm kiếm:" + +#: edit/editcmd.c:1273 edit/editcmd.c:1925 edit/editcmd.c:1949 +msgid " Replace " +msgstr " Thay thế " + +#: edit/editcmd.c:1338 edit/editcmd.c:2036 edit/editcmd.c:2038 +#: edit/editcmd.c:2066 edit/editwidget.c:293 src/view.c:1594 src/view.c:1673 +#: src/view.c:1826 src/view.c:1838 src/view.c:2060 src/view.c:2113 +#: src/view.c:2120 src/view.c:2236 +msgid "Search" +msgstr "Tìm" + +#: edit/editcmd.c:1719 +msgid " Invalid regular expression, or scanf expression with to many conversions " +msgstr " Biểu thức chính quy không đúng, hoặc biểu thức scanf có quá nhiá»u biến đổi " + +#: edit/editcmd.c:1927 +msgid " Error in replacement format string. " +msgstr " Lá»—i trong định dạng chuá»—i thay thế. " + +#: edit/editcmd.c:1957 +#, c-format +msgid " %ld replacements made. " +msgstr " %ld thay thế được thá»±c hiện. " + +#: edit/editcmd.c:1960 edit/editcmd.c:2038 edit/editcmd.c:2066 src/view.c:1673 +#: src/view.c:1838 +msgid " Search string not found " +msgstr " Không tìm thấy chuá»—i tìm kiếm " + +#: edit/editcmd.c:2036 +#, c-format +msgid " %d finds made, %d bookmarks added " +msgstr " tìm thấy %d , thêm %d thẻ đánh dấu (bookmark) " + +#: edit/editcmd.c:2088 edit/editwidget.c:296 src/help.c:826 src/main.c:1208 +#: src/view.c:456 src/view.c:2215 src/view.c:2246 +msgid "Quit" +msgstr "Thoát" + +#: edit/editcmd.c:2088 src/view.c:457 +msgid " File was modified, Save with exit? " +msgstr "Tập tin đã thay đổi, ghi nhá»› khi thoát? " + +#: edit/editcmd.c:2089 src/view.c:458 +msgid "Cancel quit" +msgstr "Không thoát" + +#: edit/editcmd.c:2089 src/cmd.c:195 src/file.c:1837 src/file.c:2209 +#: src/filegui.c:526 src/hotlist.c:1049 src/main.c:471 src/screen.c:1952 +#: src/subshell.c:654 src/tree.c:708 src/view.c:458 vfs/mcfs.c:143 +msgid "&Yes" +msgstr "&Có" + +#: edit/editcmd.c:2089 src/cmd.c:195 src/file.c:1837 src/file.c:2209 +#: src/filegui.c:525 src/hotlist.c:1049 src/main.c:471 src/screen.c:1953 +#: src/subshell.c:654 src/tree.c:708 src/view.c:458 vfs/mcfs.c:143 +msgid "&No" +msgstr "&Không" + +#: edit/editcmd.c:2202 +msgid " Copy to clipboard " +msgstr "Sao chép vào bá»™ đệm " + +#: edit/editcmd.c:2202 edit/editcmd.c:2215 +msgid " Unable to save to file. " +msgstr "Không ghi nhá»› được tập tin. " + +#: edit/editcmd.c:2215 +msgid " Cut to clipboard " +msgstr "Cắt vào bá»™ đệm " + +#: edit/editcmd.c:2243 src/view.c:2005 +msgid " Goto line " +msgstr "Chuyển tá»›i dòng " + +#: edit/editcmd.c:2243 +msgid " Enter line: " +msgstr "Hãy nhập số thứ tá»± dòng: " + +#: edit/editcmd.c:2278 edit/editcmd.c:2291 +msgid " Save Block " +msgstr "Ghi nhá»› khối " + +#: edit/editcmd.c:2307 edit/editcmd.c:2320 +msgid " Insert File " +msgstr "Chèn tập tin " + +#: edit/editcmd.c:2322 +msgid " Cannot insert file. " +msgstr "Không chèn được tập tin. " + +#: edit/editcmd.c:2339 +msgid " Sort block " +msgstr "Sắp xếp khối " + +#: edit/editcmd.c:2339 edit/editcmd.c:2465 +msgid " You must first highlight a block of text. " +msgstr "Äầu tiên bạn phải chá»n má»™t khối văn bản. " + +#: edit/editcmd.c:2346 +msgid " Run Sort " +msgstr "Thá»±c hiện sắp xếp " + +#: edit/editcmd.c:2347 +msgid " Enter sort options (see manpage) separated by whitespace: " +msgstr "Nhập tùy chá»n sắp xếp (xem trang man), phân cách nhau bởi khoảng trắng: " + +#: edit/editcmd.c:2358 edit/editcmd.c:2363 +msgid " Sort " +msgstr "Sắp xếp " + +#: edit/editcmd.c:2359 +msgid " Cannot execute sort command " +msgstr "Không thể thá»±c hiện câu lệnh sort " + +#: edit/editcmd.c:2364 +msgid " Sort returned non-zero: " +msgstr "Sắp xếp trả lại giá trị khác không: " + +#: edit/editcmd.c:2388 +msgid "Paste output of external command" +msgstr "Dán kết quả cá»§a lệnh ngoại trú" + +#: edit/editcmd.c:2389 +msgid "Enter shell command(s):" +msgstr "Nhập (các) câu lệnh shell:" + +#: edit/editcmd.c:2398 +msgid "External command" +msgstr "Lệnh ngoại trú" + +#: edit/editcmd.c:2399 +msgid "Cannot execute command" +msgstr "Không thá»±c hiện được câu lệnh" + +#: edit/editcmd.c:2433 +msgid "Error creating script:" +msgstr "Lá»—i tạo script:" + +#: edit/editcmd.c:2441 +msgid "Error reading script:" +msgstr "Lá»—i Ä‘á»c script:" + +#: edit/editcmd.c:2450 +msgid "Error closing script:" +msgstr "Lá»—i đóng script:" + +#: edit/editcmd.c:2456 +msgid "Script created:" +msgstr "Äã tạo script:" + +#: edit/editcmd.c:2463 +msgid "Process block" +msgstr "Xá»­ lý khối" + +#: edit/editcmd.c:2562 +msgid " Mail " +msgstr " Thư " + +#: edit/editcmd.c:2573 +msgid " Copies to" +msgstr " Sao chép tá»›i" + +#: edit/editcmd.c:2577 +msgid " Subject" +msgstr " Tên thư" + +#: edit/editcmd.c:2581 +msgid " To" +msgstr " Ngưá»i nhận" + +#: edit/editcmd.c:2583 +msgid " mail -s -c " +msgstr " mail -s -c " + +#: edit/editkeys.c:180 +msgid " Emacs key: " +msgstr "Phím Emacs: " + +#: edit/editkeys.c:194 edit/editkeys.c:225 +msgid " Execute Macro " +msgstr "Thá»±c hiện Macro " + +#: edit/editkeys.c:217 +msgid " Insert Literal " +msgstr " Chèn văn bản thuần túy " + +#: edit/editkeys.c:218 +msgid " Press any key: " +msgstr " Nhấn phím bất kỳ: " + +#: edit/editlock.c:148 +#, c-format +msgid "" +"File \"%s\" is already being edited\n" +"User: %s\n" +"Process ID: %d" +msgstr "" +"Tập tin \"%s\" Ä‘ang được soạn thảo\n" +"Ngưòi dùng: %s\n" +"ID tiến trình: %d" + +#: edit/editlock.c:153 +msgid "File locked" +msgstr "Tập tin bị khóa" + +#: edit/editlock.c:153 +msgid "&Grab lock" +msgstr "&Chiếm Ä‘oạt khóa" + +#: edit/editlock.c:154 +msgid "&Ignore lock" +msgstr "&Lá»i Ä‘i khóa" + +#: edit/editmenu.c:55 +msgid " About " +msgstr " Vá» chương trình " + +#: edit/editmenu.c:56 +msgid "" +"\n" +" Cooledit v3.11.5\n" +"\n" +" Copyright (C) 1996 the Free Software Foundation\n" +"\n" +" A user friendly text editor written\n" +" for the Midnight Commander.\n" +msgstr "" +"\n" +" Cooledit v3.11.5\n" +"\n" +" Copyright (C) 1996 the Free Software Foundation\n" +"\n" +" Trình soạn thảo vá»›i giao diện ngưá»i dùng thân thiện.\n" +" ÄÆ°á»£c viết cho Midnight Commander.\n" + +#: edit/editmenu.c:283 edit/editmenu.c:301 +msgid "&Open file..." +msgstr "&Mở tập tin..." + +#: edit/editmenu.c:284 +msgid "&New C-n" +msgstr "&Tập tin má»›i C-n" + +#: edit/editmenu.c:286 edit/editmenu.c:304 +msgid "&Save F2" +msgstr "&Ghi nhá»› F2" + +#: edit/editmenu.c:287 edit/editmenu.c:305 +msgid "Save &as... F12" +msgstr "Ghi &như... F12" + +#: edit/editmenu.c:289 edit/editmenu.c:307 +msgid "&Insert file... F15" +msgstr "&Chèn tập tin... F15" + +#: edit/editmenu.c:290 +msgid "Copy to &file... C-f" +msgstr "Ché&p vào tập tin... C-f" + +#: edit/editmenu.c:292 edit/editmenu.c:310 +msgid "&User menu... F11" +msgstr "Trình đơn ngưá»i &dùng... F11" + +#: edit/editmenu.c:294 edit/editmenu.c:312 +msgid "A&bout... " +msgstr "&Vá» chương trình... " + +#: edit/editmenu.c:296 edit/editmenu.c:314 +msgid "&Quit F10" +msgstr "T&hoát F10" + +#: edit/editmenu.c:302 +msgid "&New C-x k" +msgstr "&Tập tin má»›i C-x k" + +#: edit/editmenu.c:308 +msgid "Copy to &file... " +msgstr "S&ao chép vào tập tin... " + +#: edit/editmenu.c:319 +msgid "&Toggle Mark F3" +msgstr "&Bật/tắt bôi Ä‘en F3" + +#: edit/editmenu.c:320 +msgid "&Mark Columns S-F3" +msgstr "Bôi Ä‘en &cá»™t S-F3" + +#: edit/editmenu.c:322 +msgid "Toggle &ins/overw Ins" +msgstr "Chế độ chèn/&thay thế Ins" + +#: edit/editmenu.c:324 +msgid "&Copy F5" +msgstr "&Sao chép F5" + +#: edit/editmenu.c:325 +msgid "&Move F6" +msgstr "&Di chuyển F6" + +#: edit/editmenu.c:326 +msgid "&Delete F8" +msgstr "&Xóa F8" + +#: edit/editmenu.c:328 +msgid "&Undo C-u" +msgstr "&Há»§y bước C-u" + +#: edit/editmenu.c:330 +msgid "&Beginning C-PgUp" +msgstr "Äầ&u tập tin C-PgUp" + +#: edit/editmenu.c:331 +msgid "&End C-PgDn" +msgstr "Cuố&i tập tin C-PgDn" + +#: edit/editmenu.c:338 +msgid "&Search... F7" +msgstr "Tìm &kiếm... F7" + +#: edit/editmenu.c:339 +msgid "Search &again F17" +msgstr "&Tìm kiếm lại lần nữa F17" + +#: edit/editmenu.c:340 +msgid "&Replace... F4" +msgstr "Th&ay thế... F4" + +#: edit/editmenu.c:347 edit/editmenu.c:371 +msgid "&Go to line... M-l" +msgstr "&Chuyển tá»›i dòng... M-l" + +#: edit/editmenu.c:348 edit/editmenu.c:372 +msgid "Go to matching &bracket M-b" +msgstr "Chuyển &tá»›i dấu ngoặc tạo cặp M-b" + +#: edit/editmenu.c:350 edit/editmenu.c:374 +msgid "Insert &literal... C-q" +msgstr "Chèn &văn bản thuần túy... C-q" + +#: edit/editmenu.c:352 edit/editmenu.c:376 +msgid "&Refresh screen C-l" +msgstr "&Làm má»›i màn hình C-l" + +#: edit/editmenu.c:354 edit/editmenu.c:378 +msgid "&Start record macro C-r" +msgstr "&Bắt đầu ghi macro C-r" + +#: edit/editmenu.c:355 edit/editmenu.c:379 +msgid "&Finish record macro... C-r" +msgstr "&Kết thúc ghi macro... C-r" + +#: edit/editmenu.c:356 +msgid "&Execute macro... C-a, KEY" +msgstr "Chạy ¯o... C-a, KEY" + +#: edit/editmenu.c:357 edit/editmenu.c:381 +msgid "Delete macr&o... " +msgstr "&Xóa macro... " + +#: edit/editmenu.c:359 edit/editmenu.c:383 +msgid "Insert &date/time " +msgstr "Chèn &ngày/giá» " + +#: edit/editmenu.c:361 edit/editmenu.c:385 +msgid "Format p&aragraph M-p" +msgstr "Äịnh &dạng Ä‘oạn văn M-p" + +#: edit/editmenu.c:362 +msgid "'ispell' s&pell check C-p" +msgstr "Kiểm tra chính tả '&ispell' C-p" + +#: edit/editmenu.c:363 edit/editmenu.c:387 +msgid "Sor&t... M-t" +msgstr "&Sắp xếp... M-t" + +#: edit/editmenu.c:364 edit/editmenu.c:388 +msgid "Paste o&utput of... M-u" +msgstr "Dán &kết quả cá»§a lệnh... M-u" + +#: edit/editmenu.c:365 edit/editmenu.c:389 +msgid "E&xternal Formatter F19" +msgstr "T&rình định dạng ngoài F19" + +#: edit/editmenu.c:366 edit/editmenu.c:390 +msgid "&Mail... " +msgstr "T&hư Ä‘iện tá»­... " + +#: edit/editmenu.c:380 +msgid "&Execute macro... C-x e, KEY" +msgstr "Thá»±c hiện ¯o... C-x e, KEY" + +#: edit/editmenu.c:386 +msgid "'ispell' s&pell check M-$" +msgstr "Kiểm tra chính tả '&ispell' M-$" + +#: edit/editmenu.c:395 +msgid "&General... " +msgstr "Ch&ung... " + +#: edit/editmenu.c:396 +msgid "&Save mode..." +msgstr "&Chế độ ghi nhá»›..." + +#: edit/editmenu.c:397 src/main.c:909 +msgid "learn &Keys..." +msgstr "&Tạo phím tắt... " + +#: edit/editmenu.c:408 edit/editmenu.c:422 src/chmod.c:146 src/chown.c:119 +msgid " File " +msgstr " Tập tin " + +#: edit/editmenu.c:410 edit/editmenu.c:424 +msgid " Edit " +msgstr " Soạn thảo " + +#: edit/editmenu.c:412 edit/editmenu.c:426 +msgid " Sear/Repl " +msgstr " Tìm kiếm/Thay thế " + +#: edit/editmenu.c:414 edit/editmenu.c:428 +msgid " Command " +msgstr " Câu lệnh " + +#: edit/editmenu.c:416 edit/editmenu.c:430 +msgid " Options " +msgstr " Tùy chá»n " + +#: edit/editoptions.c:36 +msgid "Intuitive" +msgstr "T&rá»±c giác" + +#: edit/editoptions.c:36 +msgid "Emacs" +msgstr "&Emacs" + +#: edit/editoptions.c:39 +msgid "None" +msgstr "&Không" + +#: edit/editoptions.c:39 +msgid "Dynamic paragraphing" +msgstr "Äịnh &dạng Ä‘oạn văn động" + +#: edit/editoptions.c:39 +msgid "Type writer wrap" +msgstr "Tá»± độ&ng chuyển dòng" + +#: edit/editoptions.c:75 +msgid "Word wrap line length: " +msgstr "Vị trí chuyển dòng: " + +#: edit/editoptions.c:81 +msgid "Tab spacing: " +msgstr "Äá»™ rá»™ng tab: " + +#: edit/editoptions.c:88 +msgid "Synta&x highlighting" +msgstr "&Chiếu sáng cú pháp" + +#: edit/editoptions.c:91 +msgid "Save file &position" +msgstr "&Ghi nhá»› vị trí trong tập tin" + +#: edit/editoptions.c:94 +msgid "Confir&m before saving" +msgstr "&Há»i lại trước khi ghi nhá»›" + +#: edit/editoptions.c:97 +msgid "Fill tabs with &spaces" +msgstr "&Làm đầy tab bằng khoảng trắng" + +#: edit/editoptions.c:100 +msgid "&Return does autoindent" +msgstr "&Enter tá»± động thụt dòng" + +#: edit/editoptions.c:103 +msgid "&Backspace through tabs" +msgstr "&Backpace xóa hết tab" + +#: edit/editoptions.c:106 +msgid "&Fake half tabs" +msgstr "&Tạo má»™t ná»­a tab" + +#: edit/editoptions.c:112 +msgid "Wrap mode" +msgstr "Chế độ chuyển dòng" + +#: edit/editoptions.c:119 +msgid "Key emulation" +msgstr "Giả tạo phím" + +#: edit/editoptions.c:124 +msgid " Editor options " +msgstr " Cấu hình trình soạn thảo " + +#: edit/editwidget.c:287 src/help.c:793 src/help.c:814 src/main.c:1205 +#: src/screen.c:2184 src/tree.c:970 src/view.c:2213 +msgid "Help" +msgstr "Giúpđỡ" + +#: edit/editwidget.c:289 +msgid "Mark" +msgstr "BôiÄ‘en" + +#: edit/editwidget.c:290 +msgid "Replac" +msgstr "Thayth" + +#: edit/editwidget.c:291 src/file.c:803 src/screen.c:2188 src/tree.c:975 +msgid "Copy" +msgstr "Cópi " + +#: edit/editwidget.c:292 +msgid "Move" +msgstr "Chuyển" + +#: edit/editwidget.c:294 src/screen.c:2191 +msgid "Delete" +msgstr "Xóa " + +#: edit/editwidget.c:295 src/main.c:1207 +msgid "PullDn" +msgstr "Gá»iTÄ " + +#: edit/syntax.c:1100 edit/syntax.c:1107 +msgid " Load syntax file " +msgstr " Nạp tập tin cú pháp " + +#: edit/syntax.c:1101 src/help.c:764 src/user.c:711 +#, c-format +msgid "" +" Cannot open file %s \n" +" %s " +msgstr "" +" Không mở được tập tin %s \n" +" %s " + +#: edit/syntax.c:1108 +#, c-format +msgid " Error in file %s on line %d " +msgstr " Lá»—i trong tập tin %s trên dòng %d " + +#: src/achown.c:69 src/chmod.c:97 src/chown.c:73 +msgid "&Set" +msgstr "Äồ&ng ý" + +#: src/achown.c:70 +msgid "S&kip" +msgstr "&Bá» qua" + +#: src/achown.c:71 src/chmod.c:101 src/chown.c:76 +msgid "Set &all" +msgstr "Äặt &tất cả" + +#: src/achown.c:250 src/achown.c:338 src/achown.c:345 +msgid "owner" +msgstr "sở hữu" + +#: src/achown.c:250 src/achown.c:340 src/achown.c:347 +msgid "group" +msgstr "nhóm" + +#: src/achown.c:342 +msgid "other" +msgstr "khác" + +#: src/achown.c:350 +msgid "On" +msgstr "Trên" + +#: src/achown.c:352 +msgid "Flag" +msgstr "Cá»" + +#: src/achown.c:354 +msgid "Mode" +msgstr "Chếđộ" + +#: src/achown.c:358 +#, c-format +msgid "%6d of %d" +msgstr "%6d cá»§a %d" + +#: src/achown.c:549 +msgid " Chown advanced command " +msgstr " Câu lệnh chown mở rá»™ng" + +#: src/achown.c:607 src/achown.c:623 src/achown.c:669 src/chmod.c:241 +#: src/chmod.c:311 +#, c-format +msgid "" +" Cannot chmod \"%s\" \n" +" %s " +msgstr "" +" Không chmod được \"%s\" \n" +" %s " + +#: src/achown.c:612 src/achown.c:627 src/achown.c:673 src/chown.c:214 +#: src/chown.c:322 +#, c-format +msgid "" +" Cannot chown \"%s\" \n" +" %s " +msgstr "" +" Không thay thế được chá»§ sở hữu \"%s\" \n" +" %s " + +#: src/background.c:205 src/file.c:2145 +msgid " Background process error " +msgstr " Lá»—i cá»§a tiến trình ná»n sau " + +#: src/background.c:211 +msgid " Unknown error in child " +msgstr " Lá»—i không rõ trong tiến trình con " + +#: src/background.c:219 +msgid " Child died unexpectedly " +msgstr " Tiến trình con bất đắc kỳ tá»­ " + +#: src/background.c:226 +msgid " Background protocol error " +msgstr " Lá»—i giao thức ná»n sau " + +#: src/background.c:227 +msgid "" +" Background process sent us a request for more arguments \n" +" than we can handle. \n" +msgstr "" +" Tiến trình ná»n sau yêu cầu nhiá»u tham số hÆ¡n, \n" +" số chúng ta có thể Ä‘iá»u khiển. \n" + +#: src/boxes.c:75 +msgid "&Full file list" +msgstr "&Danh sách đầy đủ" + +#: src/boxes.c:76 +msgid "&Brief file list" +msgstr "&Thu gá»n" + +#: src/boxes.c:77 +msgid "&Long file list" +msgstr "&Mở rá»™ng" + +#: src/boxes.c:78 +msgid "&User defined:" +msgstr "&Ngưá»i dùng tá»± xác định:" + +#: src/boxes.c:136 +msgid "Listing mode" +msgstr "Dạng danh sách" + +#: src/boxes.c:138 +msgid "user &Mini status" +msgstr "t&Rạng thái mini" + +#: src/boxes.c:278 +msgid "&Reverse" +msgstr "&Ngược lại" + +#: src/boxes.c:279 +msgid "case sensi&tive" +msgstr "tính đến kiể&U chữ" + +#: src/boxes.c:280 +msgid "Sort order" +msgstr "Thứ tá»± sắp xếp" + +#: src/boxes.c:375 +msgid " confirm &Exit " +msgstr " trước khi th&Oát " + +#: src/boxes.c:377 +msgid " confirm e&Xecute " +msgstr " trước &Khi thá»±c hiện " + +#: src/boxes.c:379 +msgid " confirm o&Verwrite " +msgstr " &Trước khi ghi chèn " + +#: src/boxes.c:381 +msgid " confirm &Delete " +msgstr " há»i lại trước khi &Xóa " + +#: src/boxes.c:387 src/cmd.c:194 +msgid " Confirmation " +msgstr " Há»i xác nhận " + +#: src/boxes.c:459 +msgid "Full 8 bits output" +msgstr "Äầu ra 8 bit đầy đủ" + +#: src/boxes.c:459 +msgid "ISO 8859-1" +msgstr "ISO.8859-1" + +#: src/boxes.c:459 +msgid "7 bits" +msgstr "7 bit" + +#: src/boxes.c:466 src/boxes.c:594 +msgid "F&ull 8 bits input" +msgstr "Äầ&u vào 8 bit đầy đủ" + +#: src/boxes.c:474 src/boxes.c:575 +msgid " Display bits " +msgstr " Ký tá»± hiển thị " + +#: src/boxes.c:556 src/boxes.c:581 src/selcodepage.c:70 +msgid "Other 8 bit" +msgstr "8 bit khác" + +#: src/boxes.c:578 +msgid "Input / display codepage:" +msgstr "Bảng mã đầu vào / hiển thị:" + +#: src/boxes.c:597 +msgid "&Select" +msgstr "&Lá»±a chá»n" + +#: src/boxes.c:716 +msgid "Use &passive mode" +msgstr "Sá»­ &dụng chế độ thụ động" + +#: src/boxes.c:718 +msgid "&Use ~/.netrc" +msgstr "&Sá»­ dụng ~/.netrc" + +#: src/boxes.c:722 +msgid "&Always use ftp proxy" +msgstr "&Luôn luôn sá»­ dụng ftp proxy" + +#: src/boxes.c:724 +msgid "sec" +msgstr "giây" + +#: src/boxes.c:728 +msgid "ftpfs directory cache timeout:" +msgstr "Thá»i gian chá» cá»§a cache thư mục ftp:" + +#: src/boxes.c:732 +msgid "ftp anonymous password:" +msgstr "Mật khẩu ftp nặc danh:" + +#: src/boxes.c:739 +msgid "Timeout for freeing VFSs:" +msgstr "Thá»i gian chá» giải phóng VFS:" + +#: src/boxes.c:745 +msgid " Virtual File System Setting " +msgstr " Thiết lập hệ thống tập tin ảo " + +#: src/boxes.c:799 +msgid "Quick cd" +msgstr "cd nhanh" + +#: src/boxes.c:802 +msgid "cd" +msgstr "cd" + +#: src/boxes.c:837 +msgid "Symbolic link filename:" +msgstr "Tên cá»§a liên kết má»m:" + +#: src/boxes.c:841 +msgid "Existing filename (filename symlink will point to):" +msgstr "Tên tập tin đã có (liên kết má»m sẽ chỉ đến):" + +#: src/boxes.c:848 +msgid "Symbolic link" +msgstr "Liên kết má»m" + +#: src/boxes.c:881 +msgid "Running " +msgstr "Äang chạy " + +#: src/boxes.c:882 src/find.c:721 +msgid "Stopped" +msgstr "Äã dừng" + +#: src/boxes.c:942 +msgid "&Stop" +msgstr "&Dừng" + +#: src/boxes.c:943 +msgid "&Resume" +msgstr "&Phục hồi" + +#: src/boxes.c:944 +msgid "&Kill" +msgstr "&Diệt" + +#: src/boxes.c:981 +msgid "Background Jobs" +msgstr " Công việc ná»n sau" + +#: src/boxes.c:1012 +msgid "Domain:" +msgstr "Miá»n (domain):" + +#: src/boxes.c:1012 +msgid "Username:" +msgstr "Tên ngưá»i dùng:" + +#: src/boxes.c:1012 +msgid "Password:" +msgstr "Mật khẩu:" + +#: src/boxes.c:1063 +#, c-format +msgid "Password for \\\\%s\\%s" +msgstr "Mật khẩu cho \\\\%s\\%s" + +#: src/charsets.c:51 vfs/extfs.c:1260 vfs/sfs.c:318 +#, c-format +msgid "Warning: file %s not found\n" +msgstr "Cảnh báo: không tìm thấy tập tin %s\n" + +#: src/charsets.c:198 src/charsets.c:212 +#, c-format +msgid "Cannot translate from %s to %s" +msgstr "Không chuyển được bảng mã từ %s thành %s" + +#: src/chmod.c:77 +msgid "execute/search by others" +msgstr "ngưá»i khác có quyá»n chạy/tìm" + +#: src/chmod.c:78 +msgid "write by others" +msgstr "ngưá»i khác có quyá»n ghi nhá»›" + +#: src/chmod.c:79 +msgid "read by others" +msgstr "ngưá»i khác có quyá»n Ä‘á»c" + +#: src/chmod.c:80 +msgid "execute/search by group" +msgstr "nhóm có quyá»n chạy/tìm kiếm" + +#: src/chmod.c:81 +msgid "write by group" +msgstr "nhóm có quyá»n ghi nhá»›" + +#: src/chmod.c:82 +msgid "read by group" +msgstr "nhóm có quyá»n Ä‘á»c" + +#: src/chmod.c:83 +msgid "execute/search by owner" +msgstr "chá»§ sở hữu có quyá»n chạy/tìm" + +#: src/chmod.c:84 +msgid "write by owner" +msgstr "chá»§ sở hữu có quyá»n ghi nhá»›" + +#: src/chmod.c:85 +msgid "read by owner" +msgstr "chá»§ sở hữu có quyá»n Ä‘á»c" + +#: src/chmod.c:86 +msgid "sticky bit" +msgstr "bit dính (sticky)" + +#: src/chmod.c:87 +msgid "set group ID on execution" +msgstr "đặt ID nhóm khi chạy" + +#: src/chmod.c:88 +msgid "set user ID on execution" +msgstr "đặt ID ngưá»i dùng khi chạy" + +#: src/chmod.c:98 +msgid "C&lear marked" +msgstr "&Xóa đánh dấu" + +#: src/chmod.c:99 +msgid "S&et marked" +msgstr "Äá&nh dấu" + +#: src/chmod.c:100 +msgid "&Marked all" +msgstr "Äánh &dấu tất cả" + +#: src/chmod.c:124 src/screen.c:405 +msgid "Name" +msgstr "Tên" + +#: src/chmod.c:126 +msgid "Permissions (Octal)" +msgstr "Quyá»n hạn (Hệ tám)" + +#: src/chmod.c:128 +msgid "Owner name" +msgstr "Tên chá»§ sở hữu" + +#: src/chmod.c:130 +msgid "Group name" +msgstr "Tên nhóm" + +#: src/chmod.c:133 +msgid "Use SPACE to change" +msgstr "Dùng PHÃM TRẮNG để thay đổi" + +#: src/chmod.c:135 +msgid "an option, ARROW KEYS" +msgstr "tùy chá»n, PHÃM MŨI TÊN" + +#: src/chmod.c:137 +msgid "to move between options" +msgstr "để di chuyển giữa các tùy chá»n" + +#: src/chmod.c:139 +msgid "and T or INS to mark" +msgstr "và T hoặc INS để đánh dấu" + +#: src/chmod.c:144 src/chown.c:111 +msgid " Permission " +msgstr " Quyá»n truy cập " + +#: src/chmod.c:196 +msgid "Chmod command" +msgstr " Câu lệnh chmod " + +#: src/chown.c:74 +msgid "Set &users" +msgstr "Äặt &ngưá»i dùng" + +#: src/chown.c:75 +msgid "Set &groups" +msgstr "Äặt &nhóm" + +#: src/chown.c:103 +msgid " Name " +msgstr " Tên " + +#: src/chown.c:105 +msgid " Owner name " +msgstr " Tên chá»§ sở hữu " + +#: src/chown.c:107 src/chown.c:117 +msgid " Group name " +msgstr " Tên nhóm " + +#: src/chown.c:109 +msgid " Size " +msgstr " Kích thước " + +#: src/chown.c:115 +msgid " User name " +msgstr " Tên ngưá»i dùng " + +#: src/chown.c:158 +msgid " Chown command " +msgstr " Câu lệnh chown " + +#: src/chown.c:178 +msgid "" +msgstr "" + +#: src/chown.c:179 +msgid "" +msgstr "" + +#: src/cmd.c:194 +msgid "Files tagged, want to cd?" +msgstr "Äã đánh dấu các tập tin, chuyển thư mục?" + +#: src/cmd.c:200 src/cmd.c:670 src/cmd.c:727 src/main.c:681 src/screen.c:1933 +msgid "Cannot change directory" +msgstr "Không thay đổi được thư mục" + +#: src/cmd.c:233 +msgid " View file " +msgstr " Xem tập tin " + +#: src/cmd.c:233 +msgid " Filename:" +msgstr " Tên tập tin:" + +#: src/cmd.c:255 +msgid " Filtered view " +msgstr " Lá»c rồi xem " + +#: src/cmd.c:256 +msgid " Filter command and arguments:" +msgstr " Lệnh lá»c và tham số:" + +#: src/cmd.c:355 +msgid "Create a new Directory" +msgstr "Tạo thư mục má»›i" + +#: src/cmd.c:356 +msgid " Enter directory name:" +msgstr " Hãy nhập tên thư mục:" + +#: src/cmd.c:428 +msgid " Filter " +msgstr " Äầu lá»c " + +#: src/cmd.c:429 +msgid " Set expression for filtering filenames" +msgstr " Äặt biểu thức để lá»c tên tập tin (nhấn F1 để xem trợ giúp)" + +#: src/cmd.c:482 +msgid " Select " +msgstr " Chá»n " + +#: src/cmd.c:510 src/cmd.c:555 src/find.c:147 +msgid " Malformed regular expression " +msgstr " Biểu thức chính quy không đúng " + +#: src/cmd.c:528 +msgid " Unselect " +msgstr " Bá» chá»n " + +#: src/cmd.c:596 +msgid "Extension file edit" +msgstr "Soạn thảo phần mở rá»™ng tập tin" + +#: src/cmd.c:597 +msgid " Which extension file you want to edit? " +msgstr " Soạn thảo phần mở rá»™ng tập tin nào? " + +#: src/cmd.c:598 src/cmd.c:701 +msgid "&User" +msgstr "&Ngưá»i dùng" + +#: src/cmd.c:598 src/cmd.c:627 src/cmd.c:701 +msgid "&System Wide" +msgstr "&Hệ thống" + +#: src/cmd.c:624 +msgid " Menu edit " +msgstr " Soạn thảo tập tin trình đơn " + +#: src/cmd.c:625 +msgid " Which menu file do you want to edit? " +msgstr " Soạn thảo tập tin trình đơn nào? " + +#: src/cmd.c:627 +msgid "&Local" +msgstr "&Ná»™i bá»™ máy" + +#: src/cmd.c:627 +msgid "&Home" +msgstr "&Cá nhân" + +#: src/cmd.c:699 +msgid "Syntax file edit" +msgstr "Soạn thảo tập tin cú pháp" + +#: src/cmd.c:700 +msgid " Which syntax file you want to edit? " +msgstr " Soạn thảo tập tin cú pháp nào? " + +#: src/cmd.c:854 +msgid " Compare directories " +msgstr " So sánh thư mục " + +#: src/cmd.c:855 +msgid " Select compare method: " +msgstr " Chá»n phương pháp so sánh: " + +#: src/cmd.c:855 +msgid "&Quick" +msgstr "&Nhanh" + +#: src/cmd.c:856 +msgid "&Size only" +msgstr "&Chỉ theo kích thước" + +#: src/cmd.c:856 +msgid "&Thorough" +msgstr "&Theo từng byte" + +#: src/cmd.c:869 +msgid " Both panels should be in the listing mode to use this command " +msgstr "Äể thá»±c hiện câu lệnh này cả hai bảng phải ở trong chế độ danh sách " + +#: src/cmd.c:885 +msgid " The command history is empty " +msgstr " Lịch sá»­ dòng lệnh rá»—ng " + +#: src/cmd.c:889 +msgid " Command history " +msgstr " Lịch sá»­ dòng lệnh " + +#: src/cmd.c:925 +msgid "" +" Not an xterm or Linux console; \n" +" the panels cannot be toggled. " +msgstr "" +" Äây không phải là xterm hay kênh giao tác Linux; \n" +" bảng sẽ không thể bị tắt. " + +#: src/cmd.c:939 +#, c-format +msgid "Link %s to:" +msgstr "Tạo liên kết tá»›i %s:" + +#: src/cmd.c:940 +msgid " Link " +msgstr " Liên kết " + +#: src/cmd.c:950 +#, c-format +msgid " link: %s " +msgstr " liên kết: %s " + +#: src/cmd.c:978 +#, c-format +msgid " symlink: %s " +msgstr " liên kết má»m: %s " + +#: src/cmd.c:1012 +#, c-format +msgid " Symlink `%s' points to: " +msgstr " Liên kết má»m %s chỉ tá»›i: " + +#: src/cmd.c:1017 +msgid " Edit symlink " +msgstr " Sá»­a liên kết má»m " + +#: src/cmd.c:1022 +#, c-format +msgid " edit symlink, unable to remove %s: %s " +msgstr " sá»­a liên kết má»m, không thể xóa %s: %s " + +#: src/cmd.c:1026 +#, c-format +msgid " edit symlink: %s " +msgstr " sá»­a liên kết má»m: %s " + +#: src/cmd.c:1037 +#, c-format +msgid "`%s' is not a symbolic link" +msgstr "`%s' không phải là má»™t liên kết má»m" + +#: src/cmd.c:1155 +#, c-format +msgid " Cannot chdir to %s " +msgstr " Không thể chdir vào %s " + +#: src/cmd.c:1164 +msgid " Enter machine name (F1 for details): " +msgstr " Hãy nhập tên máy (nhấn F1 để biết chi tiết): " + +#: src/cmd.c:1169 src/widget.c:1051 +msgid " Link to a remote machine " +msgstr " Kiết nối tá»›i máy ở xa " + +#: src/cmd.c:1176 src/widget.c:1052 +msgid " FTP to machine " +msgstr " FTP tá»›i máy ở xa " + +#: src/cmd.c:1182 +msgid " Shell link to machine " +msgstr " Kết nối shell tá»›i máy ở xa" + +#: src/cmd.c:1189 src/widget.c:1053 +msgid " SMB link to machine " +msgstr " Kết nối SMB tá»›i máy ở xa" + +#: src/cmd.c:1198 +msgid " Undelete files on an ext2 file system " +msgstr " Phục hồi tập tin trên hệ thống tập tin ext2 sau khi xóa " + +#: src/cmd.c:1199 +msgid "" +" Enter device (without /dev/) to undelete\n" +" files on: (F1 for details)" +msgstr "" +" Nhập tên thiết bị (không có /dev/), để\n" +" phục hồi tập tin cá»§a nó: (nhấn F1 để biết chi tiết)" + +#: src/cmd.c:1249 +msgid " Setup saved to ~/" +msgstr " Tham số ghi nhá»› trong ~/" + +#: src/cmd.c:1251 +msgid " Setup " +msgstr " Cấu hình " + +#: src/command.c:177 src/screen.c:2174 src/tree.c:823 +#, c-format +msgid "" +" Cannot chdir to \"%s\" \n" +" %s " +msgstr "" +" Không chdir được tá»›i \"%s\" \n" +" %s " + +#: src/command.c:210 src/user.c:694 +msgid " Cannot execute commands on non-local filesystems" +msgstr " Chỉ có thể thá»±c hiện câu lệnh trên hệ thống tập tin ná»™i bá»™" + +#: src/command.c:219 src/execute.c:183 +msgid " The shell is already running a command " +msgstr " shell Ä‘ang chạy má»™t câu lệnh" + +#: src/dir.c:49 +msgid "&Unsorted" +msgstr "không &Sắp xếp" + +#: src/dir.c:50 +msgid "&Name" +msgstr "th&Eo tên" + +#: src/dir.c:51 +msgid "&Extension" +msgstr "&Phần mở rá»™ng" + +#: src/dir.c:52 +msgid "&Modify time" +msgstr "&Thá»i gian sá»­a đổi" + +#: src/dir.c:53 +msgid "&Access time" +msgstr "thá»i &Gian truy cập" + +#: src/dir.c:54 +msgid "&Change time" +msgstr "thá»i gi&An thay đổi" + +#: src/dir.c:55 +msgid "&Size" +msgstr "&Kích thước" + +#: src/dir.c:56 +msgid "&Inode" +msgstr "&Chỉ mục inode" + +#: src/dir.c:59 +msgid "&Type" +msgstr "&Loại" + +#: src/dir.c:60 +msgid "&Links" +msgstr "&Liên kết" + +#: src/dir.c:61 +msgid "N&GID" +msgstr "N&GID" + +#: src/dir.c:62 +msgid "N&UID" +msgstr "N&UID" + +#: src/dir.c:63 +msgid "&Owner" +msgstr "&Chá»§ sở hữu" + +#: src/dir.c:64 +msgid "&Group" +msgstr "&Nhóm" + +#: src/dir.c:475 src/dir.c:577 +msgid "Cannot read directory contents" +msgstr "Không Ä‘á»c được ná»™i dung thư mục" + +#: src/execute.c:133 src/utilunix.c:380 +msgid "Press any key to continue..." +msgstr "Äể tiếp tục nhấn phím bất kỳ..." + +#: src/execute.c:235 +msgid "Type `exit' to return to the Midnight Commander" +msgstr "Hãy gõ \"exit\" để quay trở lại Midnight Commander" + +#: src/execute.c:343 +#, c-format +msgid " Cannot fetch a local copy of %s " +msgstr " Không thể lấy được bản sao ná»™i bá»™ cá»§a %s " + +#: src/ext.c:106 src/user.c:566 +#, c-format +msgid "" +" Cannot create temporary command file \n" +" %s " +msgstr "" +" Không tạo được tập tin câu lệnh tạm thá»i\n" +" %s " + +#: src/ext.c:119 src/user.c:589 +msgid " Parameter " +msgstr " Tham số " + +#: src/ext.c:462 src/ext.c:481 +msgid " file error " +msgstr " lá»—i tập tin " + +#: src/ext.c:464 src/ext.c:483 +msgid "Format of the " +msgstr "Äịnh dạng cá»§a " + +#: src/ext.c:465 +msgid "" +"mc.ext file has changed\n" +"with version 3.0. It seems that installation\n" +"failed. Please fetch a fresh new copy from the\n" +"Midnight Commander package." +msgstr "" +"Tập tin mc.ext đã thay đổi\n" +"từ phiên bản 3.0. Rất có thể có sá»± cố khi cài đặt.\n" +"Xin hãy lấy bản sao má»›i nhất từ gói \n" +"Midnight Commander." + +#: src/ext.c:484 +msgid "" +" file has changed\n" +"with version 3.0. You may want either to\n" +"copy it from " +msgstr "" +" tập tin đã thay đổi\n" +"trong phiên bản 3.0. Có thể nên sao\n" +"chép nó từ " + +#: src/ext.c:487 +msgid "" +"mc.ext or use that\n" +"file as an example of how to write it.\n" +msgstr "" +"mc.ext, hoặc sá»­ dụng tập tin này làm\n" +"ví dụ để biết cách viết.\n" + +#: src/ext.c:490 +msgid "mc.ext will be used for this moment." +msgstr "mc.ext sẽ được sá»­ dụng trong thá»i Ä‘iểm này." + +#: src/file.c:122 src/tree.c:593 +msgid " Copy " +msgstr " Sao chép " + +#: src/file.c:123 src/tree.c:634 +msgid " Move " +msgstr " Di chuyển " + +#: src/file.c:124 src/tree.c:708 +msgid " Delete " +msgstr " Xóa " + +#: src/file.c:217 +msgid " Invalid target mask " +msgstr " Dấu hiệu đích đến không đúng " + +#: src/file.c:316 +msgid " Cannot make the hardlink " +msgstr " Không thể tạo liên kết cứng " + +#: src/file.c:359 +#, c-format +msgid "" +" Cannot read source link \"%s\" \n" +" %s " +msgstr "" +" Không thể Ä‘á»c liên kết nguồn \"%s\" \n" +" %s " + +#: src/file.c:370 +msgid "" +" Cannot make stable symlinks across non-local filesystems: \n" +"\n" +" Option Stable Symlinks will be disabled " +msgstr "" +" Không tạo được liên kết má»m bá»n vững giữa các hệ thống tập tin không phải ná»™i bá»™:\n" +"\n" +" Tùy chá»n \"Liên kết má»m Bá»n vững\" sẽ bị tắt " + +#: src/file.c:419 +#, c-format +msgid "" +" Cannot create target symlink \"%s\" \n" +" %s " +msgstr "" +" Khônt tạo được liên kết má»m đích \"%s\" \n" +" %s " + +#: src/file.c:493 +#, c-format +msgid "" +" Cannot overwrite directory \"%s\" \n" +" %s " +msgstr "" +" Không thể ghi chèn lên thư mục \"%s\" \n" +" %s " + +#: src/file.c:504 +#, c-format +msgid "" +" Cannot stat source file \"%s\" \n" +" %s " +msgstr "" +" Không lấy được tính chất (stat) cá»§a tập tin nguồn \"%s\" \n" +" %s " + +#: src/file.c:514 src/file.c:1115 +#, c-format +msgid " `%s' and `%s' are the same file " +msgstr " `%s' và `%s' là má»™t tập tin " + +#: src/file.c:552 +#, c-format +msgid "" +" Cannot create special file \"%s\" \n" +" %s " +msgstr "" +" Không tạo được tập tin đặc biệt \"%s\" \n" +" %s " + +#: src/file.c:564 src/file.c:813 +#, c-format +msgid "" +" Cannot chown target file \"%s\" \n" +" %s " +msgstr "" +" Không thay đổi được chá»§ sở hữu cá»§a tập tin đích đến \"%s\" \n" +" %s " + +#: src/file.c:575 src/file.c:830 +#, c-format +msgid "" +" Cannot chmod target file \"%s\" \n" +" %s " +msgstr "" +" Không thay đổi được quyá»n hạn (chmod) cá»§a tập tin đích đến \"%s\" \n" +" %s " + +#: src/file.c:589 +#, c-format +msgid "" +" Cannot open source file \"%s\" \n" +" %s " +msgstr "" +" Không mở được tập tin nguồn \"%s\" \n" +" %s " + +#: src/file.c:600 +msgid " Reget failed, about to overwrite file " +msgstr " Lấy phần còn lại cá»§a tập tin không thành công, tập tin sẽ bị ghi đè " + +#: src/file.c:607 +#, c-format +msgid "" +" Cannot fstat source file \"%s\" \n" +" %s " +msgstr "" +" Không lấy được tính chất (fstat) tập tin nguồn \"%s\" \n" +" %s " + +#: src/file.c:631 +#, c-format +msgid "" +" Cannot create target file \"%s\" \n" +" %s " +msgstr "" +" Không tạo được tập tin đích \"%s\" \n" +" %s " + +#: src/file.c:646 +#, c-format +msgid "" +" Cannot fstat target file \"%s\" \n" +" %s " +msgstr "" +" Không lấy được tính chất (fstat) tập tin đích \"%s\" \n" +" %s " + +#: src/file.c:680 +#, c-format +msgid "" +" Cannot read source file \"%s\" \n" +" %s " +msgstr "" +" Không Ä‘á»c được tập tin nguồn \"%s\" \n" +" %s " + +#: src/file.c:715 +#, c-format +msgid "" +" Cannot write target file \"%s\" \n" +" %s " +msgstr "" +" Không ghi nhá»› được tập tin nguồn \"%s\" \n" +" %s " + +#: src/file.c:733 +msgid "(stalled)" +msgstr "(bị nhốt)" + +#: src/file.c:780 +#, c-format +msgid "" +" Cannot close source file \"%s\" \n" +" %s " +msgstr "" +" Không đóng được tập tin nguồn \"%s\" \n" +" %s " + +#: src/file.c:791 +#, c-format +msgid "" +" Cannot close target file \"%s\" \n" +" %s " +msgstr "" +" Không đóng được tập tin đính \"%s\" \n" +" %s " + +#: src/file.c:804 +msgid "Incomplete file was retrieved. Keep it?" +msgstr "Nhận được tập tin không đầy đủ. Giữ tập tin?" + +#: src/file.c:805 +msgid "&Delete" +msgstr "&Xóa" + +#: src/file.c:805 +msgid "&Keep" +msgstr "&Giữ" + +#: src/file.c:873 +#, c-format +msgid "" +" Cannot stat source directory \"%s\" \n" +" %s " +msgstr "" +" Không lấy được thông tin (stat) thư mục nguồn \"%s\" \n" +" %s " + +#: src/file.c:900 +#, c-format +msgid "" +" Source directory \"%s\" is not a directory \n" +" %s " +msgstr "" +" Thư mục nguồn \"%s\" không phải là má»™t thư mục \n" +" %s " + +#: src/file.c:910 +#, c-format +msgid "" +" Cannot copy cyclic symbolic link \n" +" `%s' " +msgstr "" +" Không sao chép được liên kết má»m vòng lặp \n" +" `%s' " + +#: src/file.c:945 src/file.c:1985 src/tree.c:648 +#, c-format +msgid "" +" Destination \"%s\" must be a directory \n" +" %s " +msgstr "" +" NÆ¡i đến \"%s\" phải là má»™t thư mục \n" +" %s " + +#: src/file.c:975 +#, c-format +msgid "" +" Cannot create target directory \"%s\" \n" +" %s " +msgstr "" +" Không tạo được thư mục đích đến \"%s\" \n" +" %s " + +#: src/file.c:994 +#, c-format +msgid "" +" Cannot chown target directory \"%s\" \n" +" %s " +msgstr "" +" Không thay đổi được chá»§ sở hữu (chown) cá»§a thư mục đích đến \"%s\" \n" +" %s " + +#: src/file.c:1096 +#, c-format +msgid "" +" Cannot stat file \"%s\" \n" +" %s " +msgstr "" +" Không nhận được tính chất (stat) cá»§a tập tin \"%s\" \n" +" %s " + +#: src/file.c:1122 +#, c-format +msgid " Cannot overwrite directory `%s' " +msgstr " Không thể ghi đè lên thư mục `%s' " + +#: src/file.c:1157 +#, c-format +msgid "" +" Cannot move file \"%s\" to \"%s\" \n" +" %s " +msgstr "" +" Không thể di chuyển tập tin \"%s\" vào \"%s\" \n" +" %s " + +#: src/file.c:1181 +#, c-format +msgid "" +" Cannot remove file \"%s\" \n" +" %s " +msgstr "" +" Không thể xóa tập tin \"%s\" \n" +" %s " + +#: src/file.c:1233 +#, c-format +msgid " `%s' and `%s' are the same directory " +msgstr " %s và %s - là má»™t thư mục " + +#: src/file.c:1252 +#, c-format +msgid " Cannot overwrite directory \"%s\" %s " +msgstr " Không thể ghi đè lên thư mục \"%s\" %s " + +#: src/file.c:1256 +#, c-format +msgid " Cannot overwrite file \"%s\" %s " +msgstr " Không thể ghi đè tập tin \"%s\" %s " + +#: src/file.c:1282 +#, c-format +msgid "" +" Cannot move directory \"%s\" to \"%s\" \n" +" %s " +msgstr "" +" Không thể di chuyển thư mục \"%s\" vào \"%s\" \n" +" %s " + +#: src/file.c:1352 +#, c-format +msgid "" +" Cannot delete file \"%s\" \n" +" %s " +msgstr "" +" Không thể xóa tập tin \"%s\" \n" +" %s " + +#: src/file.c:1412 src/file.c:1481 src/file.c:1509 +#, c-format +msgid "" +" Cannot remove directory \"%s\" \n" +" %s " +msgstr "" +" Không thể xóa thư mục \"%s\" \n" +" %s " + +#: src/file.c:1657 +msgid "1Copy" +msgstr "1Sao chép" + +#: src/file.c:1657 +msgid "1Move" +msgstr "1Di chuyển" + +#: src/file.c:1657 +msgid "1Delete" +msgstr "1Xóa" + +#: src/file.c:1672 +#, no-c-format +msgid "%o %f \"%s\"%m" +msgstr "%o %f \"%s\"%m" + +# msgfmt warnings/errors must be ignored. mc parse this pattern itself. +#: src/file.c:1674 +#, no-c-format +msgid "%o %d %f%m" +msgstr "%o (%d cái) %f%m" + +#: src/file.c:1676 vfs/fish.c:561 +msgid "file" +msgstr "tập tin" + +#: src/file.c:1676 +msgid "files" +msgstr "các tập tin" + +#: src/file.c:1676 +msgid "directory" +msgstr "thư mục" + +#: src/file.c:1676 +msgid "directories" +msgstr "Các thư mục" + +#: src/file.c:1677 +msgid "files/directories" +msgstr "tập tin/thư mục" + +#: src/file.c:1677 +msgid " with source mask:" +msgstr " vá»›i nhãn ban đầu:" + +#: src/file.c:1677 +msgid " to:" +msgstr " vào:" + +#: src/file.c:1821 +msgid " Cannot operate on \"..\"! " +msgstr " Không thể thao tác trên \"..\"! " + +#: src/file.c:1877 +msgid " Sorry, I could not put the job in background " +msgstr " Xin lá»—i, không thể đặt công việc nào vào chế độ ná»n sau " + +#: src/file.c:2147 src/view.c:441 +msgid "&Retry" +msgstr "&Thá»­ lại" + +#: src/file.c:2148 src/file.c:2211 src/filegui.c:207 src/filegui.c:517 +msgid "&Abort" +msgstr "&Dừng" + +#: src/file.c:2200 +msgid "" +"\n" +" Directory not empty. \n" +" Delete it recursively? " +msgstr "" +"\n" +" Thư mục không rá»—ng. \n" +" Xóa toàn bá»™ (đệ quy)? " + +#: src/file.c:2202 +msgid "" +"\n" +" Background process: Directory not empty \n" +" Delete it recursively? " +msgstr "" +"\n" +" Tiến trình ná»n sau: Thư mục không rá»—ng \n" +" Xóa toàn bá»™ (đệ quy)? " + +#: src/file.c:2204 +msgid " Delete: " +msgstr " Xóa: " + +#: src/file.c:2210 src/filegui.c:519 +msgid "Non&e" +msgstr "&Không" + +#: src/filegui.c:324 +#, c-format +msgid "ETA %d:%02d.%02d" +msgstr "Còn lại %d:%02d.%02d" + +#: src/filegui.c:347 +#, c-format +msgid "%.2f MB/s" +msgstr "%.2f МB/giây" + +#: src/filegui.c:350 +#, c-format +msgid "%.2f KB/s" +msgstr "%.2f KB/giây" + +#: src/filegui.c:353 +#, c-format +msgid "%ld B/s" +msgstr "%ld B/giây" + +#: src/filegui.c:376 +msgid "File" +msgstr "Tập tin" + +#: src/filegui.c:399 +msgid "Count" +msgstr "Äếm" + +#: src/filegui.c:420 +msgid "Bytes" +msgstr "Byte" + +#: src/filegui.c:453 +msgid "Source" +msgstr "Nguồn" + +#: src/filegui.c:476 +msgid "Target" +msgstr "Äích" + +#: src/filegui.c:498 +msgid "Deleting" +msgstr "Äang xóa" + +#: src/filegui.c:516 +#, c-format +msgid "Target file \"%s\" already exists!" +msgstr "Tập tin đích \"%s\" đã tồn tại!" + +#: src/filegui.c:518 +msgid "If &size differs" +msgstr "&Nếu kích thước khác nhau" + +#: src/filegui.c:520 +msgid "&Update" +msgstr "&Cập nhật" + +#: src/filegui.c:522 +msgid "Overwrite all targets?" +msgstr "Khi đè lên má»i tập tin đích?" + +#: src/filegui.c:523 +msgid "&Reget" +msgstr "&Lấy lại" + +#: src/filegui.c:524 +msgid "A&ppend" +msgstr "&Thêm vào cuối" + +#: src/filegui.c:527 +msgid "Overwrite this target?" +msgstr "Khi đè lên tập tin này?" + +#: src/filegui.c:528 +#, c-format +msgid "Target date: %s, size %d" +msgstr "Thá»i gian sá»­a đổi cá»§a tập tin đích: %s, kích thước %d" + +#: src/filegui.c:529 +#, c-format +msgid "Source date: %s, size %d" +msgstr "Thá»i gian sá»­a đổi cá»§a tập tin nguồn: %s, kích thước %d" + +#: src/filegui.c:604 +msgid " File exists " +msgstr " Tập tin tồn tại " + +#: src/filegui.c:606 +msgid " Background process: File exists " +msgstr " Tiến trình ná»n sau: tập tin tồn tại " + +#: src/filegui.c:728 +msgid "preserve &Attributes" +msgstr "&Ghi nhá»› thuá»™c tính" + +#: src/filegui.c:730 +msgid "follow &Links" +msgstr "Ä‘i theo &Liên kết" + +#: src/filegui.c:732 +msgid "to:" +msgstr "vào:" + +#: src/filegui.c:733 +msgid "&Using shell patterns" +msgstr "&Sá»­ dụng mẫu (pattern) cá»§a shell" + +#: src/filegui.c:754 +msgid "&Background" +msgstr "&Trong ná»n sau" + +#: src/filegui.c:764 +msgid "&Stable Symlinks" +msgstr "liên kết &Bá»n vững" + +#: src/filegui.c:766 +msgid "&Dive into subdir if exists" +msgstr "&Vào thư mục con, nếu có" + +#: src/filegui.c:938 +#, c-format +msgid "" +"Invalid source pattern `%s' \n" +" %s " +msgstr "" +"Mẫu không đúng `%s' \n" +" %s " + +#: src/find.c:99 +msgid "&Suspend" +msgstr "&Hoãn" + +#: src/find.c:100 +msgid "Con&tinue" +msgstr "&Tiếp tục" + +#: src/find.c:101 +msgid "&Chdir" +msgstr "&Chuyển thư mục" + +#: src/find.c:102 +msgid "&Again" +msgstr "&Lặp lại" + +#: src/find.c:103 src/subshell.c:323 +msgid "&Quit" +msgstr "&Thoát" + +#: src/find.c:104 src/panelize.c:69 +msgid "Pane&lize" +msgstr "&Bảng" + +#: src/find.c:105 +msgid "&View - F3" +msgstr "X&em - F3" + +#: src/find.c:106 +msgid "&Edit - F4" +msgstr "&Soạn thảo - F4" + +#: src/find.c:183 +msgid "Start at:" +msgstr "Bắt đầu từ:" + +#: src/find.c:183 +msgid "Filename:" +msgstr "Tên tập tin:" + +#: src/find.c:183 +msgid "Content: " +msgstr "Ná»™i dung: " + +#: src/find.c:184 src/main.c:795 src/main.c:819 +msgid "&Tree" +msgstr "&Cây thư mục" + +#: src/find.c:232 src/find.c:792 +msgid "Find File" +msgstr "Tìm tập tin" + +#: src/find.c:464 +#, c-format +msgid "Grepping in %s" +msgstr "Tìm trong %s" + +#: src/find.c:538 +msgid "Finished" +msgstr "Kết thúc" + +#: src/find.c:565 src/view.c:1594 +#, c-format +msgid "Searching %s" +msgstr "Tìm %s" + +#: src/find.c:721 src/find.c:818 +msgid "Searching" +msgstr "Tìm" + +#: src/help.c:279 +msgid " Help file format error\n" +msgstr " Lá»—i định dạng tập tin trợ giúp\n" + +#: src/help.c:318 +msgid " Internal bug: Double start of link area " +msgstr " Lá»—i (bug) ná»™i bá»™: vùng liên kết có hai đầu " + +#: src/help.c:554 src/help.c:778 +#, c-format +msgid " Cannot find node %s in help file " +msgstr " Không tìm thấy nút %s trong tập tin trợ giúp " + +#: src/help.c:816 +msgid "Index" +msgstr "Chỉ mục" + +#: src/help.c:818 +msgid "Prev" +msgstr "Quay lại" + +#: src/hotlist.c:115 +msgid "&Move" +msgstr "&Di chuyển" + +#: src/hotlist.c:116 src/panelize.c:68 +msgid "&Remove" +msgstr "&Xóa" + +#: src/hotlist.c:117 src/hotlist.c:834 src/hotlist.c:930 +msgid "&Append" +msgstr "&Thêm vào" + +#: src/hotlist.c:118 src/hotlist.c:832 src/hotlist.c:928 +msgid "&Insert" +msgstr "c&Hèn" + +#: src/hotlist.c:119 +msgid "New &Entry" +msgstr "tạo &Mục má»›i" + +#: src/hotlist.c:120 +msgid "New &Group" +msgstr "&Nhóm má»›i" + +#: src/hotlist.c:122 +msgid "&Up" +msgstr "&Lên" + +#: src/hotlist.c:123 +msgid "&Add current" +msgstr "&Thêm hiện thá»i" + +#: src/hotlist.c:125 +msgid "&Refresh" +msgstr "&Làm má»›i" + +#: src/hotlist.c:126 +msgid "Fr&ee VFSs now" +msgstr "&Giải phóng" + +#: src/hotlist.c:128 +msgid "Change &To" +msgstr "&Chuyển tá»›i" + +#: src/hotlist.c:177 +msgid "Subgroup - press ENTER to see list" +msgstr "Nhóm con - nhấn ENTER để xem danh sách" + +#: src/hotlist.c:609 +msgid "Active VFS directories" +msgstr "Thư mục VFS hoạt động" + +#: src/hotlist.c:612 +msgid "Directory hotlist" +msgstr "Danh sách thư mục thưá»ng dùng" + +#: src/hotlist.c:640 +msgid " Directory path " +msgstr " ÄÆ°á»ng dẫn tá»›i thư mục " + +#: src/hotlist.c:643 src/hotlist.c:692 +msgid " Directory label " +msgstr " Nhãn thư mục" + +#: src/hotlist.c:668 +#, c-format +msgid "Moving %s" +msgstr "Di chuyển %s" + +#: src/hotlist.c:907 +msgid "New hotlist entry" +msgstr " Thêm bản ghi vào tra cứu" + +#: src/hotlist.c:907 +msgid "Directory label" +msgstr " Tên nhãn thư mục" + +#: src/hotlist.c:907 +msgid "Directory path" +msgstr " ÄÆ°á»ng dẫn tá»›i thư mục" + +#: src/hotlist.c:987 +msgid " New hotlist group " +msgstr " Thêm nhóm vào tra cứu " + +#: src/hotlist.c:987 +msgid "Name of new group" +msgstr " Tên nhóm má»›i" + +#: src/hotlist.c:1002 +#, c-format +msgid "Label for \"%s\":" +msgstr " Tên nhãn cho \"%s\":" + +#: src/hotlist.c:1006 +msgid " Add to hotlist " +msgstr " Thêm vào tra cứu " + +#: src/hotlist.c:1043 +msgid " Remove: " +msgstr " Xóa: " + +#: src/hotlist.c:1047 +msgid "" +"\n" +" Group not empty.\n" +" Remove it?" +msgstr "" +"\n" +" Nhóm không rá»—ng.\n" +" Xóa nó?" + +#: src/hotlist.c:1391 +msgid " Top level group " +msgstr "Nhóm cấp độ cao nhất " + +#: src/hotlist.c:1414 +msgid "MC was unable to write ~/" +msgstr "MC không thể ghi nhá»› ~/" + +#: src/hotlist.c:1415 +msgid " file, your old hotlist entries were not deleted" +msgstr " tập tin, tra cứu thư mục cÅ© chưa bị xóa" + +#: src/hotlist.c:1417 +msgid " Hotlist Load " +msgstr " Nạp tra cứu " + +#: src/info.c:74 +#, c-format +msgid "Midnight Commander %s" +msgstr "Midnight Commander %s" + +#: src/info.c:91 +#, c-format +msgid "File: %s" +msgstr "Tập tin: %s" + +#: src/info.c:103 +#, c-format +msgid "Free nodes: %d (%d%%) of %d" +msgstr "Nút tá»± do: %d (%d%%) trong tổng số %d" + +#: src/info.c:109 +msgid "No node informati