OBS User unknown 2007-11-05 23:30:50 +00:00 committed by Git OBS Bridge
parent 17e45c7b44
commit aec7edd7ae
39 changed files with 5573 additions and 5861 deletions

View File

@ -1,9 +1,9 @@
Some common stuff used by other UTF-8 patches.
================================================================================
--- mc-4.6.1-pre2b/src/util.c
+++ mc-4.6.1-pre2b/src/util.c
@@ -144,6 +144,30 @@
--- mc-4.6.2-pre1/src/util.c
+++ mc-4.6.2-pre1/src/util.c
@@ -140,6 +140,30 @@
return strlen (str);
}
@ -34,12 +34,12 @@ Some common stuff used by other UTF-8 patches.
#ifdef UTF8
void
--- mc-4.6.1-pre2b/src/util.h
+++ mc-4.6.1-pre2b/src/util.h
@@ -95,6 +95,7 @@
--- mc-4.6.2-pre1/src/util.h
+++ mc-4.6.2-pre1/src/util.h
@@ -105,6 +105,7 @@
void fix_utf8(char *str);
int mbstrlen (const char *);
size_t mbstrlen (const char *);
+int columns_to_bytes (const char *, int);
wchar_t *mbstr_to_wchar (const char *);
char *wchar_to_mbstr (const wchar_t *);

View File

@ -1,14 +0,0 @@
Center the title of dialog boxes.
================================================================================
--- mc-4.6.1-pre2b/src/dialog.c
+++ mc-4.6.1-pre2b/src/dialog.c
@@ -162,7 +162,7 @@
if (h->title) {
attrset (HOT_NORMALC);
- dlg_move (h, space, (h->cols - strlen (h->title)) / 2);
+ dlg_move (h, space, (h->cols - mbstrlen (h->title)) / 2);
addstr (h->title);
}
}

View File

@ -1,21 +1,21 @@
Use six character width cyan rectangles for bottom row's buttons.
================================================================================
--- mc-4.6.1-pre2b/src/widget.c
+++ mc-4.6.1-pre2b/src/widget.c
@@ -2481,11 +2481,14 @@
--- mc-4.6.2-pre1/src/widget.c
+++ mc-4.6.2-pre1/src/widget.c
@@ -2549,11 +2549,14 @@
attrset (DEFAULT_COLOR);
printw ("%-*s", bb->widget.cols, "");
tty_printf ("%-*s", bb->widget.cols, "");
for (i = 0; i < COLS / 8 && i < 10; i++) {
+ int j;
widget_move (&bb->widget, 0, i * 8);
attrset (DEFAULT_COLOR);
printw ("%d", i + 1);
tty_printf ("%d", i + 1);
attrset (SELECTED_COLOR);
- printw ("%-*s", ((i + 1) * 8 == COLS ? 5 : 6),
- tty_printf ("%-*s", ((i + 1) * 8 == COLS ? 5 : 6),
+ j = columns_to_bytes(bb->labels [i].text ? bb->labels [i].text : "",
+ ((i + 1) * 8 == COLS ? 5 : 6));
+ printw ("%-*s", j,
+ tty_printf ("%-*s", j,
bb->labels[i].text ? bb->labels[i].text : "");
attrset (DEFAULT_COLOR);
}

View File

@ -1,22 +0,0 @@
Fix detection whether filename needs to be truncated (tilde in the middle)
in dialog boxes, such as copy file.
================================================================================
--- mc-4.6.1-pre2b/src/file.c
+++ mc-4.6.1-pre2b/src/file.c
@@ -1704,13 +1704,13 @@
*dp = '\0';
if (single_source) {
- i = fmd_xlen - strlen (format_string) - 4;
+ i = fmd_xlen - mbstrlen (format_string) - 4;
g_snprintf (cmd_buf, sizeof (cmd_buf), format_string,
name_trunc (single_source, i));
} else {
g_snprintf (cmd_buf, sizeof (cmd_buf), format_string,
panel->marked);
- i = strlen (cmd_buf) + 6 - fmd_xlen;
+ i = mbstrlen (cmd_buf) + 6 - fmd_xlen;
if (i > 0) {
fmd_xlen += i;
fmd_init_i18n (TRUE); /* to recalculate positions of child widgets */

View File

@ -1,9 +1,9 @@
Fix formatting the output of "mc --help".
================================================================================
--- mc-4.6.1-pre2b/src/main.c
+++ mc-4.6.1-pre2b/src/main.c
@@ -1857,7 +1857,7 @@
--- mc-4.6.2-pre1/src/main.c
+++ mc-4.6.2-pre1/src/main.c
@@ -1859,7 +1859,7 @@
/* print help for options */
leftColWidth = poptPrintHelp (ctx, stream, 0);
@ -12,9 +12,9 @@ Fix formatting the output of "mc --help".
_("Set initial line number for the internal editor"));
fputs (_
("\n"
--- mc-4.6.1-pre2b/src/popthelp.c
+++ mc-4.6.1-pre2b/src/popthelp.c
@@ -93,7 +93,7 @@
--- mc-4.6.2-pre1/src/popthelp.c
+++ mc-4.6.2-pre1/src/popthelp.c
@@ -101,7 +101,7 @@
goto out;
}
@ -22,17 +22,17 @@ Fix formatting the output of "mc --help".
+ helpLength = mbstrlen(help);
while (helpLength > lineLength) {
ch = help + lineLength - 1;
while (ch > help && !isspace(*ch)) ch--;
@@ -104,7 +104,7 @@
while (ch > help && !isspace((unsigned char) *ch)) ch--;
@@ -112,7 +112,7 @@
fprintf(f, "%.*s\n%*s", (int) (ch - help), help, indentLength, " ");
help = ch;
while (isspace(*help) && *help) help++;
while (isspace((unsigned char) *help) && *help) help++;
- helpLength = strlen(help);
+ helpLength = mbstrlen(help);
}
if (helpLength) fprintf(f, "%s\n", help);
@@ -223,7 +223,7 @@
@@ -233,7 +233,7 @@
if (len == 3) return cursor;
if (argDescrip)
@ -41,7 +41,7 @@ Fix formatting the output of "mc --help".
if ((cursor + len) > 79) {
fprintf(f, "\n ");
@@ -292,7 +292,7 @@
@@ -304,7 +304,7 @@
singleTableUsage(f, cursor, con->options, NULL);
if (con->otherHelp) {
@ -50,14 +50,14 @@ Fix formatting the output of "mc --help".
if (cursor > 79) fprintf(f, "\n ");
fprintf(f, " %s", con->otherHelp);
}
--- mc-4.6.1-pre2b/src/util.c
+++ mc-4.6.1-pre2b/src/util.c
@@ -127,7 +127,7 @@
mbstrlen (const char *str)
{
--- mc-4.6.2-pre1/src/util.c
+++ mc-4.6.2-pre1/src/util.c
@@ -147,7 +147,7 @@
int columns = 0;
int i;
#ifdef UTF8
- if (SLsmg_Is_Unicode) {
+ if (1) {
static mbstate_t s;
int len;
const char *str0 = str;
while (columns < col) {
memset (&s, 0, sizeof (s));

View File

@ -1,23 +1,23 @@
Highlight the lines of hotlist in full width.
================================================================================
--- mc-4.6.1-pre2b/src/widget.c
+++ mc-4.6.1-pre2b/src/widget.c
@@ -1935,6 +1935,7 @@
--- mc-4.6.2-pre1/src/widget.c
+++ mc-4.6.2-pre1/src/widget.c
@@ -1995,6 +1995,7 @@
{
WLEntry *e;
int i;
+ int j;
int sel_line;
Dlg_head *h = l->widget.parent;
int normalc = NORMALC;
@@ -1965,7 +1966,8 @@
int normalc = DLG_NORMALC (h);
@@ -2025,7 +2026,8 @@
text = e->text;
e = e->next;
}
- printw (" %-*s ", l->width-2, name_trunc (text, l->width-2));
- tty_printf (" %-*s ", l->width-2, name_trunc (text, l->width-2));
+ j = columns_to_bytes (name_trunc (text, l->width-2), l->width-2);
+ printw (" %-*s ", j, name_trunc (text, l->width-2));
+ tty_printf (" %-*s ", j, name_trunc (text, l->width-2));
}
l->cursor_y = sel_line;
if (!l->scrollbar)

View File

@ -1,17 +1,17 @@
Quick filename search (^S) highlights correct width.
================================================================================
--- mc-4.6.1-pre2b/src/screen.c
+++ mc-4.6.1-pre2b/src/screen.c
@@ -746,8 +746,10 @@
--- mc-4.6.2-pre1/src/screen.c
+++ mc-4.6.2-pre1/src/screen.c
@@ -769,8 +769,10 @@
widget_move (&panel->widget, llines (panel)+3, 1);
if (panel->searching){
+ int j;
attrset (INPUT_COLOR);
- printw ("/%-*s", panel->widget.cols-3, panel->search_buffer);
- tty_printf ("/%-*s", panel->widget.cols-3, panel->search_buffer);
+ j = columns_to_bytes (panel->search_buffer, panel->widget.cols-3);
+ printw ("/%-*s", j, panel->search_buffer);
+ tty_printf ("/%-*s", j, panel->search_buffer);
attrset (NORMAL_COLOR);
return;
}

View File

@ -1,72 +0,0 @@
Fix quick filename search (^S):
- Avoid matching partial multibyte character.
E.g. a quick search for fooá when the only file beginning with foo is fooé
don't match the first byte of é.
- Backspace remove a whole multibyte character, not just one byte.
================================================================================
--- mc-4.6.1-pre2b/src/screen.c
+++ mc-4.6.1-pre2b/src/screen.c
@@ -2001,11 +2001,24 @@
int i;
int wrapped = 0;
int found;
+ int prevpos, pos;
+ int j;
+ mbstate_t mbs;
l = strlen (panel->search_buffer);
if (c_code == KEY_BACKSPACE) {
- if (l)
- panel->search_buffer[--l] = '\0';
+ if (l) {
+ prevpos = pos = 0;
+ memset (&mbs, 0, sizeof (mbs));
+ while (pos < l) {
+ prevpos = pos;
+ j = mbrlen (panel->search_buffer + pos, l - pos, &mbs);
+ if (j <= 0) break;
+ pos += j;
+ }
+ --l;
+ panel->search_buffer[prevpos] = 0;
+ }
} else {
if (c_code && l < sizeof (panel->search_buffer)) {
panel->search_buffer[l] = c_code;
@@ -2014,6 +2027,14 @@
}
}
+ prevpos = pos = 0;
+ memset (&mbs, 0, sizeof (mbs));
+ while (pos < l) {
+ prevpos = pos;
+ j = mbrlen (panel->search_buffer + pos, l - pos, &mbs);
+ if (j <= 0) break;
+ pos += j;
+ }
found = 0;
for (i = panel->selected; !wrapped || i != panel->selected; i++) {
if (i >= panel->count) {
@@ -2024,9 +2045,9 @@
}
if (panel->
case_sensitive
- ? (strncmp (panel->dir.list[i].fname, panel->search_buffer, l)
+ ? (strncmp (panel->dir.list[i].fname, panel->search_buffer, pos)
== 0) : (g_strncasecmp (panel->dir.list[i].fname,
- panel->search_buffer, l) == 0)) {
+ panel->search_buffer, pos) == 0)) {
unselect_item (panel);
panel->selected = i;
select_item (panel);
@@ -2035,7 +2056,7 @@
}
}
if (!found)
- panel->search_buffer[--l] = 0;
+ panel->search_buffer[prevpos] = 0;
paint_panel (panel);
}

View File

@ -1,14 +0,0 @@
Fix the "Midnight" art on help (F1) page.
================================================================================
--- mc-4.6.1-pre2b/src/help.c
+++ mc-4.6.1-pre2b/src/help.c
@@ -445,7 +445,7 @@
#ifndef HAVE_SLANG
addch (acs_map [c]);
#else
- SLsmg_draw_object (h->y + line + 2, h->x + col + 2, c);
+ SLsmg_draw_object (h->y + line + 2, h->x + col + 2, acs_map[c]);
#endif
} else {
#ifdef UTF8

View File

@ -1,33 +0,0 @@
--- src/subshell.c.000 2006-05-08 23:11:48.000000000 +0200
+++ src/subshell.c 2006-10-28 15:40:46.000000000 +0200
@@ -745,29 +745,13 @@ subshell_name_quote (const char *s)
memcpy (d, cmd_start, len);
d += len;
- /*
- * Print every character in octal format with the leading backslash.
- * tcsh and zsh may require 4-digit octals, bash < 2.05b doesn't like them.
- */
- if (subshell_type == BASH) {
for (; *s; s++) {
- /* Must quote numbers, so that they are not glued to octals */
if (isalpha ((unsigned char) *s)) {
*d++ = (unsigned char) *s;
} else {
- sprintf (d, "\\%03o", (unsigned char) *s);
- d += 4;
- }
- }
- } else {
- for (; *s; s++) {
- if (isalnum ((unsigned char) *s)) {
- *d++ = (unsigned char) *s;
- } else {
sprintf (d, "\\0%03o", (unsigned char) *s);
d += 5;
}
- }
}
memcpy (d, common_end, sizeof (common_end));

View File

@ -1,14 +0,0 @@
--- edit/editlock.c
+++ edit/editlock.c
@@ -54,9 +54,10 @@
{
char host[BUF_SIZE];
const char *user;
+ struct passwd *pw;
if (!
- ((user = getpwuid (getuid ())->pw_name) || (user = getenv ("USER"))
+ (((pw = getpwuid (getuid ())) && (user = pw->pw_name)) || (user = getenv ("USER"))
|| (user = getenv ("USERNAME")) || (user = getenv ("LOGNAME"))))
user = "";

View File

@ -1,12 +0,0 @@
Index: src/screen.c
================================================================================
--- src/screen.c
+++ src/screen.c
@@ -2358,6 +2358,7 @@
select_item (panel);
show_dir (panel);
paint_dir (panel);
+ panel->dirty = 0;
define_label (h, 1, _("Help"), help_cmd);
define_label (h, 2, _("Menu"), user_file_menu_cmd);

View File

@ -1,20 +0,0 @@
--- vfs/extfs/urar.in
+++ vfs/extfs/urar.in
@@ -24,7 +24,7 @@
mcrarfs_list ()
{
- $UNRAR v -c- "$1" | @AWK@ -v uid=${UID-0} '
+ $UNRAR v -p- -c- "$1" | @AWK@ -v uid=${UID-0} '
BEGIN { flag=0; date="JanFebMarAprMayJunJulAugSepOctNovDec" }
/^-------/ { flag++; if (flag > 1) exit 0; next }
{
@@ -69,7 +69,7 @@
mcrarfs_copyout ()
{
- $UNRAR p -c- -inul "$1" "$2" > "$3"
+ $UNRAR p -p- -c- -inul "$1" "$2" > "$3"
}
mcrarfs_mkdir ()

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5b2e29062be975a0acd7e12a154e712a47e905df066cd092358a1b4ed9acc1d1
size 2725120

3
mc-4.6.2-pre1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c9767d297e99f30adf8dd0fb662eb4fe14c6c19e400e5f29b8f9b54fc2d31fd
size 2967846

View File

@ -1,32 +0,0 @@
--- mc-4.6.1a-20041209/src/util.c.msglen 2004-12-15 11:41:12.477680704 +0100
+++ mc-4.6.1a-20041209/src/util.c 2004-12-15 12:50:23.006704384 +0100
@@ -198,16 +198,25 @@ is_printable (int c)
/* Returns the message dimensions (lines and columns) */
int msglen (const char *text, int *lines)
{
- int max = 0;
- int line_len = 0;
+ size_t max = 0, line_len = 0;
for (*lines = 1;*text; text++){
if (*text == '\n'){
line_len = 0;
(*lines)++;
} else {
- line_len++;
- if (line_len > max)
+#ifdef UTF8
+ size_t len;
+ wchar_t c;
+
+ len = mbrtowc (&c, text, MB_CUR_MAX, NULL);
+ if (len > 0) {
+ int wcsize = wcwidth(c);
+ line_len += wcsize > 0 ? wcsize-1 : -1;
+ text += len-1;
+ }
+#endif
+ if (++line_len > max)
max = line_len;
}
}

View File

@ -1,368 +0,0 @@
--- mc-4.6.1/src/file.c
+++ mc-4.6.1/src/file.c
@@ -165,15 +165,20 @@
do_transform_source (FileOpContext *ctx, const unsigned char *source)
{
size_t j, k, l, len;
- unsigned const char *fnsource = x_basename (source);
+ unsigned char *fnsource = g_strdup(x_basename (source));
int next_reg;
enum CaseConvs case_conv = NO_CONV;
static unsigned char fntarget[MC_MAXPATHLEN];
+#ifdef UTF8
+ fix_utf8(fnsource);
+#endif
+
len = strlen (fnsource);
j = re_match (&ctx->rx, fnsource, len, 0, &ctx->regs);
if (j != len) {
transform_error = FILE_SKIP;
+ g_free(fnsource);
return NULL;
}
for (next_reg = 1, j = 0, k = 0; j < strlen (ctx->dest_mask); j++) {
@@ -217,6 +222,7 @@
|| ctx->regs.start[next_reg] < 0) {
message (1, MSG_ERROR, _(" Invalid target mask "));
transform_error = FILE_ABORT;
+ g_free(fnsource);
return NULL;
}
for (l = (size_t) ctx->regs.start[next_reg];
@@ -231,6 +237,7 @@
}
}
fntarget[k] = 0;
+ g_free(fnsource);
return fntarget;
}
@@ -2107,8 +2114,8 @@
static int
files_error (const char *format, const char *file1, const char *file2)
{
- char nfile1[16];
- char nfile2[16];
+ char nfile1[16 * MB_LEN_MAX];
+ char nfile2[16 * MB_LEN_MAX];
strcpy (nfile1, path_trunc (file1, 15));
strcpy (nfile2, path_trunc (file2, 15));
--- mc-4.6.1/src/filegui.c
+++ mc-4.6.1/src/filegui.c
@@ -69,6 +69,7 @@
#include "filegui.h"
#include "key.h" /* get_event */
#include "util.h" /* strip_password() */
+#include "tty.h"
/* }}} */
@@ -856,7 +857,7 @@
char *
file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text,
- const char *def_text, int only_one, int *do_background)
+ const char *def_text_orig, int only_one, int *do_background)
{
int source_easy_patterns = easy_patterns;
char *source_mask, *orig_mask, *dest_dir, *tmpdest;
@@ -865,12 +866,20 @@
struct stat buf;
int val;
QuickDialog Quick_input;
-
+ char *def_text;
g_return_val_if_fail (ctx != NULL, NULL);
+
+ def_text = g_strdup(def_text_orig);
+
#if 0
message (1, __FUNCTION__, "text = `%s' \n def_text = `%s'", text,
def_text);
#endif
+
+#ifdef UTF8
+ fix_utf8(def_text);
+#endif
+
fmd_init_i18n (FALSE);
/* Set up the result pointers */
@@ -929,6 +938,7 @@
orig_mask = source_mask;
if (!dest_dir || !*dest_dir) {
g_free (source_mask);
+ g_free(def_text);
return dest_dir;
}
if (source_easy_patterns) {
@@ -982,5 +992,6 @@
}
if (val == B_USER)
*do_background = 1;
+ g_free(def_text);
return dest_dir;
}
--- mc-4.6.1/src/main.c
+++ mc-4.6.1/src/main.c
@@ -699,7 +699,7 @@
int prompt_len;
prompt = strip_ctrl_codes (subshell_prompt);
- prompt_len = strlen (prompt);
+ prompt_len = mbstrlen (prompt);
/* Check for prompts too big */
if (COLS > 8 && prompt_len > COLS - 8) {
@@ -1609,7 +1609,7 @@
if (xterm_flag && xterm_title) {
p = s = g_strdup (strip_home_and_password (current_panel->cwd));
do {
- if (!is_printable (*s))
+ if (*s < ' ')
*s = '?';
} while (*++s);
fprintf (stdout, "\33]0;mc - %s\7", p);
--- mc-4.6.1/src/menu.c
+++ mc-4.6.1/src/menu.c
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <sys/types.h>
#include <ctype.h>
+#include <wchar.h>
#include "global.h"
#include "tty.h"
#include "menu.h"
--- mc-4.6.1/src/screen.c
+++ mc-4.6.1/src/screen.c
@@ -526,6 +526,7 @@
#else
char buffer[BUF_MEDIUM];
#endif
+ int txtwidth;
length = 0;
empty_line = (file_index >= panel->count);
@@ -578,13 +579,18 @@
if (txtlen < 0) {
txt = " ";
txtlen = 1;
- } else
+ } else {
wide = 1;
+ txtwidth = wcswidth((wchar_t*)buffer, txtlen);
+ }
} else
#endif
+ {
txtlen = strlen (txt);
+ txtwidth = txtlen;
+ }
- over = txtlen > len;
+ over = txtwidth > len;
still = over ? txtlen - len : len - txtlen;
switch (HIDE_FIT(format->just_mode)) {
@@ -605,19 +611,46 @@
#ifdef UTF8
if (over) {
if (IS_FIT (format->just_mode)) {
- int len2 = len / 2 - 1 + (len % 2);
+ int n1 = 0;
+ int width1 = 0;
+ int n2 = 0;
+ int width2 = 0;
+ int len1 = len / 2;
+ int len2;
+
+ while (1) {
+ int w = wcwidth(((wchar_t *) buffer)[n1]);
+ if (width1 + w <= len1) {
+ width1 += w;
+ n1++;
+ }
+ else
+ break;
+ }
+ len2 = len - width1 - 1;
+
+ while (1) {
+ int w = wcwidth(((wchar_t *) buffer)[txtlen - n2 - 1]);
+ if (width2 + w <= len2) {
+ width2 += w;
+ n2++;
+ }
+ else
+ break;
+ }
+
- SLsmg_write_nwchars ((wchar_t *) buffer,
- len / 2);
+ SLsmg_write_nwchars ((wchar_t *) buffer, n1);
SLsmg_write_nwchars (L"~", 1);
+ printw ("%*s", len - width1 - width2 - 1, "");
SLsmg_write_nwchars (((wchar_t *) buffer)
- + txtlen - len2, len2);
+ + txtlen - n2, n2);
} else
SLsmg_write_nwchars ((wchar_t *) buffer, len);
} else {
printw ("%*s", still, "");
SLsmg_write_nwchars ((wchar_t *) buffer, txtlen);
- printw ("%*s", len - txtlen - still, "");
+ printw ("%*s", len - txtwidth - still, "");
}
#endif
} else {
--- mc-4.6.1/src/util.c
+++ mc-4.6.1/src/util.c
@@ -89,11 +89,13 @@
if (SLsmg_Is_Unicode) {
static mbstate_t s;
int len;
+ const char *str0 = str;
len = mbsrtowcs (NULL, &str, -1, &s);
if (len < 0) {
- memset (&s, 0, sizeof (s));
- return -1;
+ memset (&s, 0, sizeof (s));
+ /* invalid multibyte character, probably not UTF-8 string */
+ return strlen (str0);
}
return len;
} else
@@ -101,6 +103,33 @@
return strlen (str);
}
+#ifdef UTF8
+
+void
+fix_utf8(char *str)
+{
+ mbstate_t mbs;
+
+ char *p = str;
+
+ while (*p) {
+ int len;
+ memset (&mbs, 0, sizeof (mbs));
+ len = mbrlen(p, MB_CUR_MAX, &mbs);
+ if (len == -1) {
+ *p = '?';
+ p++;
+ } else if (len > 0) {
+ p += len;
+ } else {
+ p++;
+ }
+ }
+}
+#endif
+
+
+
int
is_printable (int c)
{
@@ -229,7 +258,24 @@
*d++ = '\\';
break;
}
+#ifndef UTF8
*d = *s;
+#else /* UTF8 */
+ {
+ mbstate_t mbs;
+ int len;
+ memset (&mbs, 0, sizeof (mbs));
+ len = mbrlen(s, MB_CUR_MAX, &mbs);
+ if (len > 0) {
+ while (len-- > 1)
+ *d++ = *s++;
+ *d = *s;
+ } else {
+ *d = '?';
+ }
+
+ }
+#endif /* UTF8 */
}
*d = '\0';
return ret;
@@ -955,10 +1001,27 @@
r++;
continue;
}
-
+#ifndef UTF8
if (is_printable(*r))
*w++ = *r;
++r;
+#else /* UTF8 */
+ {
+ mbstate_t mbs;
+ int len;
+ memset (&mbs, 0, sizeof (mbs));
+ len = mbrlen(r, MB_CUR_MAX, &mbs);
+
+ if (len > 0 && (unsigned char)*r >= ' ')
+ while (len--)
+ *w++ = *r++;
+ else {
+ if (len == -1)
+ *w++ = '?';
+ r++;
+ }
+ }
+#endif /* UTF8 */
}
*w = 0;
return s;
--- mc-4.6.1/src/util.h
+++ mc-4.6.1/src/util.h
@@ -93,6 +93,7 @@
char *get_group (int);
char *get_owner (int);
+void fix_utf8(char *str);
int mbstrlen (const char *);
#define MAX_I18NTIMELENGTH 14
--- mc-4.6.1/src/widget.c
+++ mc-4.6.1/src/widget.c
@@ -149,10 +149,11 @@
attrset ((b->selected) ? HOT_FOCUSC : HOT_NORMALC);
widget_move (&b->widget, 0, b->hotpos + off);
#ifdef UTF8
- SLsmg_write_nwchars (&b->hotwc, 1);
-#else
- addch ((unsigned char) b->text[b->hotpos]);
+ if (SLsmg_Is_Unicode)
+ SLsmg_write_nwchars (&b->hotwc, 1);
+ else
#endif
+ addch ((unsigned char) b->text[b->hotpos]);
}
return MSG_HANDLED;
@@ -475,10 +476,11 @@
attrset ((msg == WIDGET_FOCUS) ? HOT_FOCUSC : HOT_NORMALC);
widget_move (&c->widget, 0, +c->hotpos + 4);
#ifdef UTF8
- SLsmg_write_nwchars (&c->hotwc, 1);
-#else
- addch ((unsigned char) c->text[c->hotpos]);
+ if (SLsmg_Is_Unicode)
+ SLsmg_write_nwchars (&c->hotwc, 1);
+ else
#endif
+ addch ((unsigned char) c->text[c->hotpos]);
}
return MSG_HANDLED;

View File

@ -1,49 +0,0 @@
--- mc-4.6.1-pre2b/src/help.c
+++ mc-4.6.1-pre2b/src/help.c
@@ -447,8 +447,22 @@
#else
SLsmg_draw_object (h->y + line + 2, h->x + col + 2, c);
#endif
+ } else {
+#ifdef UTF8
+ if (SLsmg_Is_Unicode) {
+ int len;
+ mbstate_t mbs;
+ wchar_t wc;
+ memset (&mbs, 0, sizeof (mbs));
+ len = mbrtowc(&wc, p, MB_CUR_MAX, &mbs);
+ if (len <= 0) len = 1; /* skip broken multibyte chars */
+
+ SLsmg_write_nwchars(&wc, 1);
+ p += len - 1;
} else
+#endif
addch (c);
+ }
col++;
break;
}
@@ -771,6 +785,12 @@
message (1, MSG_ERROR, _(" Cannot open file %s \n %s "), filename ? filename : hlpfile,
unix_error_string (errno));
}
+ else
+ {
+ char *conv = utf8_to_local(data);
+ g_free(data);
+ data = conv;
+ }
if (!filename)
g_free (hlpfile);
--- mc-4.6.1-pre2b/src/util.h
+++ mc-4.6.1-pre2b/src/util.h
@@ -97,6 +97,8 @@
int mbstrlen (const char *);
wchar_t *mbstr_to_wchar (const char *);
char *wchar_to_mbstr (const wchar_t *);
+char *utf8_to_local(char *str);
+
#define MAX_I18NTIMELENGTH 14
#define MIN_I18NTIMELENGTH 10

View File

@ -1,86 +0,0 @@
--- mc-4.6.1-pre2b/src/util.c
+++ mc-4.6.1-pre2b/src/util.c
@@ -32,6 +32,9 @@
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
+#include <iconv.h>
+#include <langinfo.h>
+#include <errno.h>
#include "tty.h"
#include "global.h"
@@ -827,11 +830,61 @@
}
char *
+utf8_to_local(char *str)
+{
+ iconv_t cd;
+ size_t buflen = strlen(str);
+ char *output;
+ int retry = 1;
+
+ cd = iconv_open (nl_langinfo(CODESET), "UTF-8");
+ if (cd == (iconv_t) -1) {
+ return g_strdup(str);
+ }
+
+ output = g_malloc(buflen + 1);
+
+ while (retry)
+ {
+ char *wrptr = output;
+ char *inptr = str;
+ size_t insize = buflen;
+ size_t avail = buflen;
+ size_t nconv;
+
+ nconv = iconv (cd, &inptr, &insize, &wrptr, &avail);
+ if (nconv == (size_t) -1)
+ {
+ if (errno == E2BIG)
+ {
+ buflen *= 2;
+ g_free(output);
+ output = g_malloc(buflen + 1);
+ }
+ else
+ {
+ g_free(output);
+ return g_strdup(str);
+ }
+ }
+ else {
+ retry = 0;
+ *wrptr = 0;
+ }
+ }
+
+ iconv_close (cd);
+
+ return output;
+}
+
+char *
load_mc_home_file (const char *filename, char **allocated_filename)
{
char *hintfile_base, *hintfile;
char *lang;
char *data;
+ char *conv_data;
hintfile_base = concat_dir_and_file (mc_home, filename);
lang = guess_message_value ();
@@ -864,7 +917,10 @@
else
g_free (hintfile);
- return data;
+ conv_data = utf8_to_local(data);
+ g_free(data);
+
+ return conv_data;
}
/* Check strftime() results. Some systems (i.e. Solaris) have different

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
--- mc-4.6.1/src/cmd.c
+++ mc-4.6.1/src/cmd.c
@@ -1209,7 +1209,7 @@
--- mc-4.6.2-pre1/src/cmd.c
+++ mc-4.6.2-pre1/src/cmd.c
@@ -1229,7 +1229,7 @@
sync_profiles ();
str = g_strconcat ( _(" Setup saved to ~/"), PROFILE_NAME, (char *) NULL);
@ -9,9 +9,9 @@
g_free (str);
}
--- mc-4.6.1/src/hotlist.c
+++ mc-4.6.1/src/hotlist.c
@@ -1427,7 +1427,7 @@
--- mc-4.6.2-pre1/src/hotlist.c
+++ mc-4.6.2-pre1/src/hotlist.c
@@ -1475,7 +1475,7 @@
msg = g_strconcat (_("MC was unable to write ~/"), HOTLIST_FILENAME,
_(" file, your old hotlist entries were not deleted"), (char *) NULL);
@ -20,20 +20,9 @@
g_free (msg);
}
} else {
--- mc-4.6.1/vfs/ftpfs.c
+++ mc-4.6.1/vfs/ftpfs.c
@@ -829,7 +829,7 @@
/* If the remote server is an Amiga a leading slash
might be missing. MC needs it because it is used
as separator between hostname and path internally. */
- return g_strconcat( "/", bufp, 0);
+ return g_strconcat( "/", bufp, (char *) NULL);
}
} else {
ftpfs_errno = EIO;
--- mc-4.6.1/vfs/smbfs.c
+++ mc-4.6.1/vfs/smbfs.c
@@ -546,7 +546,7 @@
--- mc-4.6.2-pre1/vfs/smbfs.c
+++ mc-4.6.2-pre1/vfs/smbfs.c
@@ -566,7 +566,7 @@
if (p)
my_remote = p; /* strip off share/service name */
/* create remote filename as understood by smb clientgen */

View File

@ -9,7 +9,7 @@
Open=%cd %p#utar
View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
@@ -168,7 +168,7 @@
@@ -173,7 +173,7 @@
View=%view{ascii} cpio -itv <'%f' 2>/dev/null
# ls-lR
@ -18,7 +18,7 @@
Open=%cd %p#lslR
# patch
@@ -324,7 +324,7 @@
@@ -339,7 +339,7 @@
View=sxpm %f
include/image
@ -27,30 +27,21 @@
View=%view{ascii} identify %f
#View=%view{ascii} asciiview %f
@@ -342,11 +342,11 @@
@@ -357,11 +357,11 @@
Open=vplay -s 22 %f
regex/\.([mM][pP]3)$
- Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else (xmms %f &); fi
- Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else (xmms %f >/dev/null 2>&1 &); fi
+ Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else if [ -z "`which realplay`" ]; then (xmms -e %f 1>/dev/null 2>&1 &); else (realplay %f >/dev/null 2>&1 &); fi; fi
View=%view{ascii} mpg123 -vtn1 %f 2>&1 | sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
regex/\.([oO][gG][gG])$
- Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f &); fi
- Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f >/dev/null 2>&1 &); fi
+ Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms -e %f >/dev/null 2>&1 &); fi
View=%view{ascii} ogginfo %s
regex/\.([mM][iI][dD][iI]?|[rR][mM][iI][dD]?)$
@@ -360,7 +360,7 @@
### Play lists ###
regex/\.([mM]3[uU]|[pP][lL][sS])$
- Open=if [ -z "$DISPLAY" ]; then mplayer -vo null -playlist %f; else (xmms -p %f &); fi
+ Open=if [ -z "$DISPLAY" ]; then mplayer -vo null -playlist %f; else (xmms -p %f >/dev/null 2>&1 &); fi
### Video ###
@@ -402,12 +402,12 @@
@@ -417,12 +417,12 @@
# Postscript
type/^PostScript
@ -65,7 +56,7 @@
#Open=(acroread %f &)
#Open=(ghostview %f &)
View=%view{ascii} pdftotext %f -
@@ -422,54 +422,53 @@
@@ -437,54 +437,53 @@
# StarOffice 5.2
shell/.sdw

View File

@ -1,10 +1,10 @@
--- src/util.c
+++ src/util.c
@@ -1145,6 +1145,8 @@
@@ -1193,6 +1193,8 @@
/* strchr() matches trailing binary 0 */
while (*(++r) && strchr ("0123456789;?", *r));
}
+ else if (*(r) == '(')
+ else if (*r == '(')
+ r++;
/*

16
mc-getpwuid.patch Normal file
View File

@ -0,0 +1,16 @@
--- edit/editlock.c
+++ edit/editlock.c
@@ -69,9 +69,11 @@
lock_build_name (void)
{
char host[BUF_SIZE];
- const char *user;
+ const char *user = NULL;
+ struct passwd *pw;
- user = getpwuid (getuid ())->pw_name;
+ pw = getpwuid (getuid ());
+ if (pw) user = pw->pw_name;
if (!user) user = getenv ("USER");
if (!user) user = getenv ("USERNAME");
if (!user) user = getenv ("LOGNAME");

View File

@ -4,4 +4,4 @@
# List of available translations.
-az be bg ca cs da de el es eu fi fr hu it ja ko lt lv mn nl no pl
+az be bg ca cs da de el es eu fi fr hu it ja ko lt lv mn nl nb pl
pt pt_BR ro ru sk sl sr sv uk ta tr wa zh_CN zh_TW
pt pt_BR ro ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW

View File

@ -1,5 +1,5 @@
--- mc-4.5.55/lib/mc.menu
+++ mc-4.5.55/lib/mc.menu
--- mc-4.6.2-pre1/lib/mc.menu
+++ mc-4.6.2-pre1/lib/mc.menu
@@ -186,6 +186,33 @@
fi
echo "Please test the output file before deleting anything"

71
mc-rpm.patch Normal file
View File

@ -0,0 +1,71 @@
--- syntax/spec.syntax
+++ syntax/spec.syntax
@@ -11,6 +11,7 @@
keyword whole Description: green
keyword whole Distribution: green
keyword whole Doc\{Dd\}ir: green
+ keyword whole Enhances: green
keyword whole Epoch: green
keyword whole Exclude\{Aa\}rch: green
keyword whole Exclusive\{Aa\}rch: green
@@ -27,16 +28,19 @@
keyword whole Prefix: green
keyword whole Pre\{Rr\}eq: green
keyword whole Provides: green
+ keyword whole Recommends: green
keyword whole Release: green
keyword whole Requires: green
keyword whole Requires(\[abcdefghijklmnopqrstuvwxyz\]): green
keyword whole Root: green
keyword whole Serial: white
keyword whole Source\[0123456789\]: green
+ keyword whole Suggests: green
keyword whole Summary: green
keyword whole Summary(\[abcdefghijklmnopqrstuvwxyz\]): green
keyword whole Summary(\[abcdefghijklmnopqrstuvwxyz\]_\[ABCDEFGHIJKLMNOPQRSTUVWXYZ\]): green
keyword whole Summary(\[abcdefghijklmnopqrstuvwxyz\]_\[ABCDEFGHIJKLMNOPQRSTUVWXYZ\].\[ABCDEFGHIJKLMNOPQRSTUVWXYZ-1234567890\]): green
+ keyword whole Supplements: green
keyword whole Vendor: green
keyword whole Version: green
keyword whole U\{Rr\}\{Ll\}: green
--- vfs/extfs/rpm
+++ vfs/extfs/rpm
@@ -118,6 +118,14 @@
if test "$MCFASTRPM" != 0 ; then
$RPM -qp --qf "[%{REQUIRENAME}\n]" "$f" | grep "(none)" > /dev/null ||
echo "$FILEPREF 0 $DATE INFO/REQUIRENAME"
+ $RPM -qp --qf "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" "$f" | grep "(none)" > /dev/null ||
+ echo "$FILEPREF 0 $DATE INFO/ENHANCES"
+ $RPM -qp --qf "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" "$f" | grep "(none)" > /dev/null ||
+ echo "$FILEPREF 0 $DATE INFO/SUGGESTS"
+ $RPM -qp --qf "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" "$f" | grep "(none)" > /dev/null ||
+ echo "$FILEPREF 0 $DATE INFO/ENHANCES"
+ $RPM -qp --qf "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" "$f" | grep "(none)" > /dev/null ||
+ echo "$FILEPREF 0 $DATE INFO/SUGGESTS"
$RPM -qp --qf "[%{OBSOLETES}\n]" "$f" | grep "(none)" > /dev/null ||
echo "$FILEPREF 0 $DATE INFO/OBSOLETES"
$RPM -qp --qf "[%{PROVIDES}\n]" "$f" | grep "(none)" > /dev/null ||
@@ -128,8 +136,10 @@
echo "$FILEPREF 0 $DATE INFO/CHANGELOG"
else
echo "$FILEPREF 0 $DATE INFO/REQUIRENAME"
- echo "$FILEPREF 0 $DATE INFO/OBSOLETES"
- echo "$FILEPREF 0 $DATE INFO/PROVIDES"
+ echo "$FILEPREF 0 $DATE INFO/ENHANCES"
+ echo "$FILEPREF 0 $DATE INFO/SUGGESTS"
+ echo "$FILEPREF 0 $DATE INFO/RECOMMENDS"
+ echo "$FILEPREF 0 $DATE INFO/SUPPLEMENTS"
echo "$FILEPREF 0 $DATE INFO/CONFLICTS"
echo "$FILEPREF 0 $DATE INFO/CHANGELOG"
fi
@@ -162,6 +172,10 @@
INFO/LICENSE) $RPM -qp --qf "%{LICENSE}\n" "$f" >"$3"; exit 0;;
INFO/RPMVERSION) $RPM -qp --qf "%{RPMVERSION}\n" "$f" >"$3"; exit 0;;
INFO/REQUIRENAME) $RPM -qp --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" "$f" >"$3"; exit 0;;
+ INFO/ENHANCES) $RPM -qp --qf "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" "$f" >"$3"; exit 0;;
+ INFO/SUGGESTS) $RPM -qp --qf "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" "$f" >"$3"; exit 0;;
+ INFO/RECOMMENDS) $RPM -qp --qf "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" "$f" >"$3"; exit 0;;
+ INFO/SUPPLEMENTS) $RPM -qp --qf "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" "$f" >"$3"; exit 0;;
INFO/PROVIDES) $RPM -qp --qf "[%{PROVIDES}\n]" "$f" >"$3"; exit 0;;
INFO/SCRIPTS/PREIN) $RPM -qp --qf "%{RPMTAG_PREIN}\n" "$f" >"$3"; exit 0;;
INFO/SCRIPTS/POSTIN) $RPM -qp --qf "%{RPMTAG_POSTIN}\n" "$f" >"$3"; exit 0;;

View File

@ -1,6 +1,6 @@
--- syntax/Syntax
+++ syntax/Syntax
@@ -72,7 +72,7 @@
@@ -76,7 +76,7 @@
file ..\*\.(texi|texinfo|TEXI|TEXINFO)$ Texinfo\sDocument
include texinfo.syntax
@ -8,4 +8,4 @@
+file ..\*\\.([chC]|CC|cxx|cc|cpp|CPP|CXX|hxx|hpp|HPP|h\.in)$ C/C\+\+\sProgram
include c.syntax
file ..\*\\.[fF]$ Fortran\sProgram
file ..\*\\.d$ D\sProgram

View File

@ -1,6 +1,6 @@
--- src/screen.c
+++ src/screen.c
@@ -646,7 +646,7 @@
@@ -669,7 +669,7 @@
SLsmg_write_nwchars (((wchar_t *) buffer)
+ txtlen - n2, n2);
} else

View File

@ -1,78 +0,0 @@
--- src/help.c
+++ src/help.c
@@ -445,7 +445,11 @@
#ifndef HAVE_SLANG
addch (acs_map [c]);
#else
- SLsmg_draw_object (h->y + line + 2, h->x + col + 2, acs_map[c]);
+#if defined(UTF8) && SLANG_VERSION < 20000
+ SLsmg_draw_object (h->y + line + 2, h->x + col + 2, acs_map [c]);
+#else
+ SLsmg_draw_object (h->y + line + 2, h->x + col + 2, c);
+#endif /* UTF8 */
#endif
} else {
#ifdef UTF8
--- src/myslang.h
+++ src/myslang.h
@@ -11,6 +11,12 @@
#endif /* HAVE_SLANG_SLANG_H */
#endif
+#if SLANG_VERSION >= 20000
+#define UTF8 1
+#define SLsmg_Is_Unicode SLsmg_is_utf8_mode()
+void SLsmg_write_nwchars(wchar_t *s, size_t n);
+#endif
+
#ifdef UTF8
# include <wchar.h>
#endif
--- src/slint.c
+++ src/slint.c
@@ -181,6 +181,10 @@
SLtt_get_terminfo ();
+#if SLANG_VERSION >= 20000
+ SLutf8_enable (-1);
+#endif
+
/*
* If the terminal in not in terminfo but begins with a well-known
* string such as "linux" or "xterm" S-Lang will go on, but the
--- src/util.c
+++ src/util.c
@@ -55,6 +55,32 @@
static const char app_text [] = "Midnight-Commander";
int easy_patterns = 1;
+#if SLANG_VERSION >= 20000
+void SLsmg_write_nwchars(wchar_t *s, size_t n)
+{
+ if (SLsmg_is_utf8_mode()) { /* slang can handle it directly */
+ while(n-- && *s)
+ SLsmg_write_char(*s++);
+ }
+ else { /* convert wchars back to 8bit encoding */
+ mbstate_t mbs;
+ memset (&mbs, 0, sizeof (mbs));
+ while (n-- && *s) {
+ char buf[MB_LEN_MAX + 1]; /* should use 1 char, but to be sure */
+ if (*s < 0x80) {
+ SLsmg_write_char(*s++); /* ASCII */
+ }
+ else {
+ if (wcrtomb(buf, *s++, &mbs) == 1)
+ SLsmg_write_char((wchar_t)(buf[0]));
+ else
+ SLsmg_write_char('?'); /* should not happen */
+ }
+ }
+ }
+}
+#endif
+
extern void str_replace(char *s, char from, char to)
{
for (; *s != '\0'; s++) {

5360
mc-utf8.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
--- lib/mc.ext.in
+++ lib/mc.ext.in
@@ -329,12 +329,17 @@
@@ -449,12 +449,17 @@
Open=if which abiword ; then (abiword %f >/dev/null 2>&1 &); else (ooffice %f >/dev/null 2>&1 &); fi >/dev/null
# Microsoft Word Document

View File

@ -1,6 +1,6 @@
--- lib/mc.ext.in
+++ lib/mc.ext.in
@@ -444,8 +444,8 @@
@@ -432,8 +432,8 @@
# html
regex/\.([hH][tT][mM][lL]?)$

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Nov 5 13:31:25 CET 2007 - nadvornik@suse.cz
- updated to 4.6.2-pre1
* improved subshell handling
* improved fish filesystem
* a lot of other fixes and enhancements
- updated UTF-8 patches using Fedora package
- added support for weak rpm dependencies in VFS
-------------------------------------------------------------------
Tue Aug 28 16:38:08 CEST 2007 - nadvornik@suse.cz

110
mc.spec
View File

@ -1,5 +1,5 @@
#
# spec file for package mc (Version 4.6.1)
# spec file for package mc (Version 4.6.2.pre1)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -16,46 +16,32 @@ BuildRequires: audiofile-devel docbook-toys e2fsprogs-devel fdupes glib2-devel
License: GPL v2 or later
Group: Productivity/File utilities
PreReq: permissions
Autoreqprov: on
Version: 4.6.1
Release: 127
AutoReqProv: on
Version: 4.6.2.pre1
Release: 1
Summary: Midnight Commander
Source: mc-4.6.1.tar.bz2
Source: mc-4.6.2-pre1.tar.bz2
Source1: x11_browser
Patch1: mc-CVS-utf8.patch
Patch2: mc-CVS-utf8-fix.patch
Patch3: mc-CVS-utf8-input.patch
Patch4: mc-CVS-utf8-hint.patch
Patch5: mc-CVS-utf8-help.patch
Patch6: mc-CVS-msglen.patch
Patch7: 00-70-utf8-common.patch
Patch8: 00-72-utf8-dialog-title.patch
Patch9: 00-73-utf8-bottom-buttons-width.patch
Patch10: 00-74-utf8-dialog-filename-truncate.patch
Patch11: 00-75-utf8-cmdline-help.patch
Patch12: 00-76-utf8-hotlist-highlight.patch
Patch13: 00-77-utf8-filename-search-highlight.patch
Patch14: 00-78-utf8-filename-search-input.patch
Patch15: 00-80-utf8-help-line-drawing-art.patch
Patch16: mc-4.6.1-apps.patch
Patch18: mc-4.6.1-palmsupport.patch
Patch19: mc-4.6.1-word_docs.patch
Patch20: mc-4.6.1-x11browser.diff
Patch21: mc-4.6.1-no-nb.diff
Patch22: mc-4.6.1-unrar-passwd.patch
Patch23: mc-4.6.1-NULL.patch
Patch24: mc-utf8-slang2.patch
Patch25: mc-4.6.1-wrapper.patch
Patch26: mc-4.6.1-long-panel.patch
Patch27: mc-4.6.1-getpwuid.patch
Patch28: mc-4.6.1-syntax-hpp.patch
Patch29: mc-utf8-nlink.patch
Patch30: mc-4.6.1-bash-all.patch
Patch31: mc-4.6.1-esc-seq.patch
Patch32: mc.umode_t.patch
Patch33: mc.vfs_dirent-offsetof.patch
Patch0: mc-utf8.patch
Patch1: 00-70-utf8-common.patch
Patch2: 00-73-utf8-bottom-buttons-width.patch
Patch3: 00-75-utf8-cmdline-help.patch
Patch4: 00-76-utf8-hotlist-highlight.patch
Patch5: 00-77-utf8-filename-search-highlight.patch
Patch6: mc-apps.patch
Patch7: mc-palmsupport.patch
Patch8: mc-word_docs.patch
Patch9: mc-x11browser.diff
Patch10: mc-no-nb.diff
Patch11: mc-NULL.patch
Patch12: mc-wrapper.patch
Patch13: mc-getpwuid.patch
Patch14: mc-syntax-hpp.patch
Patch15: mc-utf8-nlink.patch
Patch16: mc-esc-seq.patch
Patch17: mc-rpm.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
URL: http://www.ibiblio.org/mc/
Url: http://www.ibiblio.org/mc/
Requires: %{name}-lang = %{version}
%description
@ -116,39 +102,25 @@ Authors:
%define INSTALL_DATA install -m644
%lang_package
%prep
%setup -q
%setup -q -n mc-4.6.2-pre1
%patch0 -p 1
%patch1 -p 1
%patch2 -p 1
%patch3 -p 1
%patch4 -p 1
%patch5 -p 1
%patch6 -p 1
%patch6
%patch7 -p 1
%patch8 -p 1
%patch9 -p 1
%patch10 -p 1
%patch8
%patch9
%patch10
%patch11 -p 1
%patch12 -p 1
%patch13 -p 1
%patch14 -p 1
%patch15 -p 1
%patch12
%patch13
%patch14
%patch15
%patch16
%patch18 -p 1
%patch19
%patch20
%patch21
%patch22
%patch23 -p 1
%patch24
%patch25
%patch26
%patch27
%patch28
%patch29
%patch30
%patch31
%patch32 -p1
%patch33 -p1
%patch17
%build
pushd po
@ -166,7 +138,6 @@ iconv -f koi8-r -t utf8 -o mc.hint.ru.tmp mc.hint.ru && mv mc.hint.ru.tmp mc.hin
iconv -f koi8-u -t utf8 -o mc.hint.uk.tmp mc.hint.uk && mv mc.hint.uk.tmp mc.hint.uk
iconv -f big5 -t utf8 -o mc.hint.zh.tmp mc.hint.zh && mv mc.hint.zh.tmp mc.hint.zh
popd
# convert docs to utf-8
pushd doc
pushd es
@ -203,6 +174,7 @@ export CFLAGS #LIBS _libdir
--mandir=%{_mandir} \
--prefix=%{_prefix} \
--localstatedir=/var/lib \
--libexecdir=%{_libdir} \
--libdir=%{_libdir} \
--enable-charset \
--with-samba
@ -220,7 +192,6 @@ install -m 0644 lib/mc.sh lib/mc.csh %{buildroot}/etc/profile.d
#support script for calling available GUI webbrosers
install -m 755 %{SOURCE1} %{buildroot}/usr/share/mc/bin
%{find_lang} %{name}
%fdupes -s $RPM_BUILD_ROOT/usr
%clean
@ -228,7 +199,6 @@ rm -rf %{buildroot}
%post
%run_permissions
%verifyscript
%verify_permissions -e /usr/lib/mc/cons.saver
@ -250,8 +220,14 @@ rm -rf %{buildroot}
%{_datadir}/mc
%files lang -f %{name}.lang
%changelog
* Mon Nov 05 2007 - nadvornik@suse.cz
- updated to 4.6.2-pre1
* improved subshell handling
* improved fish filesystem
* a lot of other fixes and enhancements
- updated UTF-8 patches using Fedora package
- added support for weak rpm dependencies in VFS
* Tue Aug 28 2007 - nadvornik@suse.cz
- link duplicate files only inside /usr [#304167]
* Sat Aug 11 2007 - olh@suse.de

View File

@ -1,229 +0,0 @@
---
acinclude.m4 | 10 ------
config.h.in | 2 -
configure | 85 ----------------------------------------------------------
configure.ac | 1
src/achown.c | 1
src/chmod.c | 1
src/file.c | 1
vfs/undelfs.c | 6 ----
8 files changed, 3 insertions(+), 104 deletions(-)
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -12,12 +12,7 @@ AC_DEFUN([MC_UNDELFS_CHECKS], [
AC_CHECK_HEADERS([ext2fs/ext2fs.h], [ext2fs_ext2fs_h=yes], ,
[
#include <stdio.h>
-#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
-#else
-#undef umode_t
-#include <linux/ext2_fs.h>
-#endif
])
if test x$ext2fs_ext2fs_h = xyes; then
AC_DEFINE(USE_EXT2FSLIB, 1,
@@ -32,12 +27,7 @@ AC_DEFUN([MC_UNDELFS_CHECKS], [
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
-#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
-#else
-#undef umode_t
-#include <linux/ext2_fs.h>
-#endif
#include <ext2fs/ext2fs.h>
])
fi
--- a/config.h.in
+++ b/config.h.in
@@ -689,5 +689,3 @@
<stdint.h> don't define. */
#undef uintmax_t
-/* Define to `int' if <sys/types.h> does not define. */
-#undef umode_t
--- a/configure
+++ b/configure
@@ -13667,71 +13667,6 @@ _ACEOF
fi
-echo "$as_me:$LINENO: checking for umode_t" >&5
-echo $ECHO_N "checking for umode_t... $ECHO_C" >&6
-if test "${ac_cv_type_umode_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-if ((umode_t *) 0)
- return 0;
-if (sizeof (umode_t))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_umode_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_umode_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_umode_t" >&5
-echo "${ECHO_T}$ac_cv_type_umode_t" >&6
-if test $ac_cv_type_umode_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define umode_t int
-_ACEOF
-
-fi
echo "$as_me:$LINENO: checking for off_t" >&5
echo $ECHO_N "checking for off_t... $ECHO_C" >&6
@@ -18590,12 +18525,7 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdio.h>
-#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
-#else
-#undef umode_t
-#include <linux/ext2_fs.h>
-#endif
#include <$ac_header>
@@ -18666,12 +18596,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
-#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
-#else
-#undef umode_t
-#include <linux/ext2_fs.h>
-#endif
#include <ext2fs/ext2fs.h>
@@ -18984,12 +18909,7 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdio.h>
-#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
-#else
-#undef umode_t
-#include <linux/ext2_fs.h>
-#endif
#include <$ac_header>
@@ -19060,12 +18980,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
-#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
-#else
-#undef umode_t
-#include <linux/ext2_fs.h>
-#endif
#include <ext2fs/ext2fs.h>
--- a/configure.ac
+++ b/configure.ac
@@ -210,7 +210,6 @@ dnl Missing typedefs and replacements
dnl
AC_TYPE_MODE_T
-AC_CHECK_TYPE(umode_t, int)
AC_CHECK_TYPE(off_t, long)
AC_TYPE_PID_T
AC_TYPE_UID_T
--- a/src/achown.c
+++ b/src/achown.c
@@ -19,6 +19,7 @@
#include <config.h>
/* Needed for the extern declarations of integer parameters */
#include <sys/types.h>
+#include <linux/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
--- a/src/chmod.c
+++ b/src/chmod.c
@@ -22,6 +22,7 @@
#include <errno.h> /* For errno on SunOS systems */
/* Needed for the extern declarations of integer parameters */
#include <sys/types.h>
+#include <linux/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
--- a/src/file.c
+++ b/src/file.c
@@ -43,6 +43,7 @@
#define WITH_FULL_PATHS 1
#include <sys/types.h>
+#include <linux/types.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
--- a/vfs/undelfs.c
+++ b/vfs/undelfs.c
@@ -39,13 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
-#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
-#else
-/* asm/types.h defines its own umode_t */
-#undef umode_t
-#include <linux/ext2_fs.h>
-#endif
#include <ext2fs/ext2fs.h>
#include <ctype.h>

View File

@ -1,23 +0,0 @@
---
vfs/vfs-impl.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/vfs/vfs-impl.h
+++ b/vfs/vfs-impl.h
@@ -2,6 +2,7 @@
#define MC_VFS_IMPL_H
#ifdef USE_VFS
+#include <stddef.h>
typedef void *vfsid;
struct vfs_stamping;
@@ -85,7 +86,7 @@ struct vfs_class {
*/
union vfs_dirent {
struct dirent dent;
- char _extra_buffer[((int) &((struct dirent *) 0)->d_name) +
+ char _extra_buffer[offsetof(struct dirent, d_name) +
MC_MAXPATHLEN + 1];
};