diff options
48 files changed, 3439 insertions, 82 deletions
diff --git a/misc/mc/Makefile b/misc/mc/Makefile index 83a55efe1f9f..79cd86dab578 100644 --- a/misc/mc/Makefile +++ b/misc/mc/Makefile @@ -7,7 +7,7 @@ PORTNAME= mc PORTVERSION= 4.6.0 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= misc shells MASTER_SITES= ${MASTER_SITE_SUNSITE} MASTER_SITE_SUBDIR= utils/file/managers/mc/ diff --git a/misc/mc/files/patch-CAN-2003-1023 b/misc/mc/files/patch-CAN-2003-1023 deleted file mode 100644 index cf033e9adc70..000000000000 --- a/misc/mc/files/patch-CAN-2003-1023 +++ /dev/null @@ -1,39 +0,0 @@ ---- vfs/direntry.c.orig 2002-12-25 21:21:43.000000000 -0500 -+++ vfs/direntry.c 2004-01-21 09:38:53.000000000 -0500 -@@ -375,21 +375,31 @@ vfs_s_resolve_symlink (vfs *me, vfs_s_en - - /* Convert absolute paths to relative ones */ - if (*linkname == PATH_SEP) { -- char *p, *q; -+ char *p, *q, *r, *end; - - for (p = path, q = entry->ino->linkname; *p == *q; p++, q++); - while (*(--q) != PATH_SEP); - q++; -+ r = buf; -+ end = buf + MC_MAXPATHLEN; - for (;; p++) { - p = strchr (p, PATH_SEP); - if (!p) { -- strcat (buf, q); -+ size_t len = strlen (q); -+ -+ if (r + len >= end) -+ break; -+ -+ memcpy (r, q, len + 1); -+ linkname = buf; - break; - } -- strcat (buf, ".."); -- strcat (buf, PATH_SEP_STR); -+ -+ if (r + sizeof (".." PATH_SEP_STR) > end) -+ break; -+ memcpy (r, ".." PATH_SEP_STR, sizeof (".." PATH_SEP_STR) - 1); -+ r += sizeof (".." PATH_SEP_STR) - 1; - } -- linkname = buf; - } - - return (MEDATA->find_entry) (me, entry->dir, linkname, follow - 1, 0); diff --git a/misc/mc/files/patch-doc::ru::Makefile.in b/misc/mc/files/patch-doc-ru-Makefile.in index f0330a3a6a7d..cd07f512120f 100644 --- a/misc/mc/files/patch-doc::ru::Makefile.in +++ b/misc/mc/files/patch-doc-ru-Makefile.in @@ -1,5 +1,5 @@ ---- doc/ru/Makefile.in.orig Tue Aug 12 01:13:27 2003 -+++ doc/ru/Makefile.in Tue Aug 12 01:12:53 2003 +--- doc/ru/Makefile.in.orig Thu Feb 6 00:09:08 2003 ++++ doc/ru/Makefile.in Tue Jun 15 03:14:17 2004 @@ -174,7 +174,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ diff --git a/misc/mc/files/patch-edit-editcmd.c b/misc/mc/files/patch-edit-editcmd.c new file mode 100644 index 000000000000..e2205fc617e9 --- /dev/null +++ b/misc/mc/files/patch-edit-editcmd.c @@ -0,0 +1,232 @@ +--- edit/editcmd.c.orig Thu Dec 19 19:01:34 2002 ++++ edit/editcmd.c Tue Jun 15 03:16:08 2004 +@@ -1546,51 +1546,56 @@ + + #define is_digit(x) ((x) >= '0' && (x) <= '9') + +-#define snprintf(v) { \ ++#define snprint(v) { \ + *p1++ = *p++; \ +- *p1++ = '%'; \ +- *p1++ = 'n'; \ + *p1 = '\0'; \ +- sprintf(s,q1,v,&n); \ ++ n = snprintf(s,e-s,q1,v); \ ++ if (n >= e - s) goto nospc; \ + s += n; \ + } + + /* this function uses the sprintf command to do a vprintf */ + /* it takes pointers to arguments instead of the arguments themselves */ +-static int sprintf_p (char *str, const char *fmt,...) +- __attribute__ ((format (printf, 2, 3))); ++/* 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 sprintf_p (char *str, const char *fmt,...) ++static int snprintf_p (char *str, size_t size, const char *fmt,...) + { + va_list ap; +- int n; +- char *q, *p, *s = str; +- char q1[32]; ++ size_t n; ++ char *q, *p, *s = str, *e = str + size; ++ char q1[40]; + char *p1; ++ int nargs = 0; + + va_start (ap, fmt); + p = q = (char *) fmt; + + while ((p = strchr (p, '%'))) { + n = p - q; +- strncpy (s, q, n); /* copy stuff between format specifiers */ ++ if (n >= e - s) ++ goto nospc; ++ memcpy (s, q, n); /* copy stuff between format specifiers */ + s += n; +- *s = 0; + q = p; + p1 = q1; + *p1++ = *p++; + if (*p == '%') { + p++; + *s++ = '%'; ++ if (s == e) ++ goto nospc; + q = p; + continue; + } +- if (*p == 'n') { +- p++; +-/* do nothing */ +- q = p; +- continue; +- } ++ if (*p == 'n') ++ goto err; ++ /* We were passed only 16 arguments. */ ++ if (++nargs == 16) ++ goto err; + if (*p == '#') + *p1++ = *p++; + if (*p == '0') +@@ -1604,8 +1609,10 @@ + strcpy (p1, MY_itoa (*va_arg (ap, int *))); /* replace field width with a number */ + p1 += strlen (p1); + } else { +- while (is_digit (*p)) ++ while (is_digit (*p) && p1 < q1 + 20) + *p1++ = *p++; ++ if (is_digit (*p)) ++ goto err; + } + if (*p == '.') + *p1++ = *p++; +@@ -1614,37 +1621,49 @@ + strcpy (p1, MY_itoa (*va_arg (ap, int *))); /* replace precision with a number */ + p1 += strlen (p1); + } else { +- while (is_digit (*p)) ++ while (is_digit (*p) && p1 < q1 + 32) + *p1++ = *p++; ++ if (is_digit (*p)) ++ goto err; + } + /* flags done, now get argument */ + if (*p == 's') { +- snprintf (va_arg (ap, char *)); ++ snprint (va_arg (ap, char *)); + } else if (*p == 'h') { + if (strchr ("diouxX", *p)) +- snprintf (*va_arg (ap, short *)); ++ snprint (*va_arg (ap, short *)); + } else if (*p == 'l') { + *p1++ = *p++; + if (strchr ("diouxX", *p)) +- snprintf (*va_arg (ap, long *)); ++ snprint (*va_arg (ap, long *)); + } else if (strchr ("cdiouxX", *p)) { +- snprintf (*va_arg (ap, int *)); ++ snprint (*va_arg (ap, int *)); + } else if (*p == 'L') { + *p1++ = *p++; + if (strchr ("EefgG", *p)) +- snprintf (*va_arg (ap, double *)); /* should be long double */ ++ snprint (*va_arg (ap, double *)); /* should be long double */ + } else if (strchr ("EefgG", *p)) { +- snprintf (*va_arg (ap, double *)); ++ snprint (*va_arg (ap, double *)); + } else if (strchr ("DOU", *p)) { +- snprintf (*va_arg (ap, long *)); ++ snprint (*va_arg (ap, long *)); + } else if (*p == 'p') { +- snprintf (*va_arg (ap, void **)); +- } ++ snprint (*va_arg (ap, void **)); ++ } else ++ goto err; + q = p; + } + va_end (ap); +- sprintf (s, q); /* print trailing leftover */ +- return s - str + strlen (s); ++ n = strlen (q); ++ if (n >= e - s) ++ return -1; ++ memcpy (s, q, n + 1); ++ return s + n - str; ++nospc: ++ va_end (ap); ++ return -1; ++err: ++ va_end (ap); ++ return -2; + } + + static void regexp_error (WEdit *edit) +@@ -1737,7 +1756,7 @@ + for (i = 0; i < NUM_REPL_ARGS; i++) { + if (s != (char *) 1 && *s) { + ord = atoi (s); +- if ((ord > 0) && (ord < NUM_REPL_ARGS)) ++ if ((ord > 0) && (ord <= NUM_REPL_ARGS)) + argord[i] = ord - 1; + else + argord[i] = i; +@@ -1821,6 +1840,7 @@ + if (replace_yes) { /* delete then insert new */ + if (replace_scanf || replace_regexp) { + char repl_str[MAX_REPL_LEN + 2]; ++ int ret = 0; + + /* we need to fill in sargs just like with scanf */ + if (replace_regexp) { +@@ -1829,6 +1849,11 @@ + k < NUM_REPL_ARGS && pmatch[k].rm_eo >= 0; + k++) { + unsigned char *t; ++ ++ if (pmatch[k].rm_eo - pmatch[k].rm_so > 255) { ++ ret = -1; ++ break; ++ } + t = (unsigned char *) &sargs[k - 1][0]; + for (j = 0; + j < pmatch[k].rm_eo - pmatch[k].rm_so +@@ -1849,7 +1874,9 @@ + for (; k <= NUM_REPL_ARGS; k++) + sargs[k - 1][0] = 0; + } +- if (sprintf_p (repl_str, exp2, PRINTF_ARGS) >= 0) { ++ if (!ret) ++ ret = snprintf_p (repl_str, MAX_REPL_LEN + 2, exp2, PRINTF_ARGS); ++ if (ret >= 0) { + times_replaced++; + while (i--) + edit_delete (edit); +@@ -1857,8 +1884,9 @@ + edit_insert (edit, repl_str[i]); + } else { + edit_error_dialog (_(" Replace "), +- _ +- (" Error in replacement format string. ")); ++ ret == -2 ++ ? _(" Error in replacement format string. ") ++ : _(" Replacement too long. ")); + replace_continue = 0; + } + } else { +@@ -2711,7 +2739,7 @@ + int word_len = 0, i, num_compl = 0, max_len; + long word_start = 0; + char *bufpos; +- char match_expr[MAX_REPL_LEN]; ++ char *match_expr; + struct selection compl[MAX_WORD_COMPLETIONS]; /* completions */ + + /* don't want to disturb another search */ +@@ -2728,9 +2756,7 @@ + /* prepare match expression */ + bufpos = &edit->buffers1[word_start >> S_EDIT_BUF_SIZE] + [word_start & M_EDIT_BUF_SIZE]; +- strncpy (match_expr, bufpos, word_len); +- match_expr[word_len] = '\0'; +- strcat (match_expr, "[a-zA-Z_0-9]+"); ++ match_expr = g_strdup_printf ("%.*s[a-zA-Z_0-9]+", word_len, bufpos); + + /* init search: backward, regexp, whole word, case sensitive */ + edit_set_search_parameters (0, 1, 1, 1, 1); +@@ -2762,6 +2788,8 @@ + } + + /* release memory before return */ ++ g_free (match_expr); ++ + for (i = 0; i < num_compl; i++) + g_free (compl[i].text); + diff --git a/misc/mc/files/patch-edit-syntax.c b/misc/mc/files/patch-edit-syntax.c new file mode 100644 index 000000000000..72e067958343 --- /dev/null +++ b/misc/mc/files/patch-edit-syntax.c @@ -0,0 +1,218 @@ +--- edit/syntax.c.orig Mon Dec 16 00:55:53 2002 ++++ edit/syntax.c Tue Jun 15 03:15:09 2004 +@@ -99,7 +99,8 @@ + for (p = (unsigned char *) text, q = p + strlen ((char *) p); p < q; p++, i++) { + switch (*p) { + case '\001': +- p++; ++ if (++p > q) ++ return -1; + for (;;) { + c = edit_get_byte (edit, i); + if (!*p) +@@ -114,7 +115,8 @@ + } + break; + case '\002': +- p++; ++ if (++p > q) ++ return -1; + j = 0; + for (;;) { + c = edit_get_byte (edit, i); +@@ -150,12 +152,13 @@ + } + break; + case '\003': +- p++; ++ if (++p > q) ++ return -1; + c = -1; + for (;; i++) { + d = c; + c = edit_get_byte (edit, i); +- for (j = 0; p[j] != '\003'; j++) ++ for (j = 0; p[j] != '\003' && p[j]; j++) + if (c == p[j]) + goto found_char2; + break; +@@ -163,20 +166,23 @@ + j = c; /* dummy command */ + } + i--; +- while (*p != '\003') ++ while (*p != '\003' && p <= q) + p++; ++ if (p > q) ++ return -1; + if (p[1] == d) + i--; + break; + case '\004': +- p++; ++ if (++p > q) ++ return -1; + c = edit_get_byte (edit, i); +- for (; *p != '\004'; p++) ++ for (; *p != '\004' && *p; p++) + if (c == *p) + goto found_char3; + return -1; + found_char3: +- for (; *p != '\004'; p++); ++ for (; *p != '\004' && *p; p++); + break; + default: + if (*p != edit_get_byte (edit, i)) +@@ -534,14 +540,14 @@ + if (!*fg) + fg = 0; + if (fg) { +- strcpy (f, fg); ++ g_strlcpy (f, fg, sizeof (f)); + p = strchr (f, '/'); + if (p) + *p = '\0'; + fg = f; + } + if (bg) { +- strcpy (b, bg); ++ g_strlcpy (b, bg, sizeof (b)); + p = strchr (b, '/'); + if (p) + *p = '\0'; +@@ -588,13 +594,16 @@ + int num_words = -1, num_contexts = -1; + int argc, result = 0; + int i, j; ++ int alloc_contexts = MAX_CONTEXTS, ++ alloc_words_per_context = MAX_WORDS_PER_CONTEXT, ++ max_alloc_words_per_context = MAX_WORDS_PER_CONTEXT; + + args[0] = 0; + + strcpy (whole_left, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890"); + strcpy (whole_right, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890"); + +- r = edit->rules = g_malloc0 (MAX_CONTEXTS * sizeof (struct context_rule *)); ++ r = edit->rules = g_malloc (alloc_contexts * sizeof (struct context_rule *)); + + for (;;) { + char **a; +@@ -637,13 +646,13 @@ + check_a; + if (!strcmp (*a, "left")) { + a++; +- strcpy (whole_left, *a); ++ g_strlcpy (whole_left, *a, sizeof (whole_left)); + } else if (!strcmp (*a, "right")) { + a++; +- strcpy (whole_right, *a); ++ g_strlcpy (whole_right, *a, sizeof (whole_right)); + } else { +- strcpy (whole_left, *a); +- strcpy (whole_right, *a); ++ g_strlcpy (whole_left, *a, sizeof (whole_left)); ++ g_strlcpy (whole_right, *a, sizeof (whole_right)); + } + a++; + check_not_a; +@@ -659,6 +668,8 @@ + c->right = g_strdup (" "); + num_contexts = 0; + } else { ++ /* Terminate previous context. */ ++ r[num_contexts - 1]->keyword[num_words] = NULL; + c = r[num_contexts] = g_malloc0 (sizeof (struct context_rule)); + if (!strcmp (*a, "exclusive")) { + a++; +@@ -693,10 +704,7 @@ + c->first_left = *c->left; + c->first_right = *c->right; + } +- c->keyword = g_malloc0 (MAX_WORDS_PER_CONTEXT * sizeof (struct key_word *)); +-#if 0 +- c->max_words = MAX_WORDS_PER_CONTEXT; +-#endif ++ c->keyword = g_malloc (alloc_words_per_context * sizeof (struct key_word *)); + num_words = 1; + c->keyword[0] = g_malloc0 (sizeof (struct key_word)); + fg = *a; +@@ -705,12 +713,20 @@ + bg = *a; + if (*a) + a++; +- strcpy (last_fg, fg ? fg : ""); +- strcpy (last_bg, bg ? bg : ""); ++ g_strlcpy (last_fg, fg ? fg : "", sizeof (last_fg)); ++ g_strlcpy (last_bg, bg ? bg : "", sizeof (last_bg)); + c->keyword[0]->color = this_try_alloc_color_pair (fg, bg); + c->keyword[0]->keyword = g_strdup (" "); + check_not_a; +- num_contexts++; ++ ++ alloc_words_per_context = MAX_WORDS_PER_CONTEXT; ++ if (++num_contexts >= alloc_contexts) { ++ struct context_rule **tmp; ++ ++ alloc_contexts += 128; ++ tmp = g_realloc (r, alloc_contexts * sizeof (struct context_rule *)); ++ r = tmp; ++ } + } else if (!strcmp (args[0], "spellcheck")) { + if (!c) { + result = line; +@@ -757,7 +773,18 @@ + bg = last_bg; + k->color = this_try_alloc_color_pair (fg, bg); + check_not_a; +- num_words++; ++ ++ if (++num_words >= alloc_words_per_context) { ++ struct key_word **tmp; ++ ++ alloc_words_per_context += 1024; ++ ++ if (alloc_words_per_context > max_alloc_words_per_context) ++ max_alloc_words_per_context = alloc_words_per_context; ++ ++ tmp = g_realloc (c->keyword, alloc_words_per_context * sizeof (struct key_word *)); ++ c->keyword = tmp; ++ } + } else if (*(args[0]) == '#') { + /* do nothing for comment */ + } else if (!strcmp (args[0], "file")) { +@@ -771,6 +798,12 @@ + free_args (args); + syntax_g_free (l); + ++ /* Terminate context array. */ ++ if (num_contexts > 0) { ++ r[num_contexts - 1]->keyword[num_words] = NULL; ++ r[num_contexts] = NULL; ++ } ++ + if (!edit->rules[0]) + syntax_g_free (edit->rules); + +@@ -783,7 +816,10 @@ + } + + { +- char first_chars[MAX_WORDS_PER_CONTEXT + 2], *p; ++ char *first_chars, *p; ++ ++ first_chars = g_malloc (max_alloc_words_per_context + 2); ++ + for (i = 0; edit->rules[i]; i++) { + c = edit->rules[i]; + p = first_chars; +@@ -794,6 +830,8 @@ + c->keyword_first_chars = g_malloc0 (strlen (first_chars) + 2); + strcpy (c->keyword_first_chars, first_chars); + } ++ ++ g_free (first_chars); + } + + return result; diff --git a/misc/mc/files/patch-lib-cedit.menu b/misc/mc/files/patch-lib-cedit.menu new file mode 100644 index 000000000000..b4f221ea93d5 --- /dev/null +++ b/misc/mc/files/patch-lib-cedit.menu @@ -0,0 +1,11 @@ +--- lib/cedit.menu.orig Sun Aug 25 00:39:08 2002 ++++ lib/cedit.menu Tue Jun 15 03:15:09 2004 +@@ -449,7 +449,7 @@ + + m view `man' + MAN=%{Enter name of man:} +- TMPFILE=/tmp/mcview.$MAN.$$ ++ TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/mcview.$MAN.$$` || exit 1 + man -Pcat $MAN >$TMPFILE + mcview $TMPFILE + rm -f $TMPFILE diff --git a/misc/mc/files/patch-lib-mc.menu b/misc/mc/files/patch-lib-mc.menu new file mode 100644 index 000000000000..375b8117e5ce --- /dev/null +++ b/misc/mc/files/patch-lib-mc.menu @@ -0,0 +1,37 @@ +--- lib/mc.menu.orig Sun Dec 8 07:12:19 2002 ++++ lib/mc.menu Tue Jun 15 03:15:09 2004 +@@ -14,9 +14,10 @@ + + + 0 Edit a bug report and send it to root +- ${EDITOR-vi} /tmp/mail.$$ +- test -r /tmp/mail.$$ && mail root < /tmp/mail.$$ +- rm -f /tmp/mail.$$ ++ I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1 ++ ${EDITOR-vi} $I ++ test -r $I && mail root < $I ++ rm -f $I + + =+ f \.1$ | f \.3$ | f \.4$ | f \.5$ | f \.6$ | f \.7$ | f \.8$ | f \.man$ & t r + 1 Display the file with roff -man +@@ -112,8 +113,9 @@ + CHECK=`awk '{print $1 ; exit}' %f` 2>/dev/null + case $CHECK in + Newsgroups:|Path:) +- cp %f /tmp/%f.$$ && sed '/^'"$CHECK"' /,/^$/d' /tmp/%f.$$ > %f +- [ "$?" = "0" ] && rm /tmp/%f.$$ ++ I=`mktemp ${MC_TMPDIR:-/tmp}/news.XXXXXX` || exit 1 ++ cp %f $I && sed '/^'"$CHECK"' /,/^$/d' $I > %f ++ [ "$?" = "0" ] && rm $I + echo %f: header removed + ;; + *) +@@ -126,7 +128,7 @@ + set %t + while [ -n "$1" ]; do + CHECK=`awk '{print $1 ; exit}' $1` 2>/dev/null +- WFILE=/tmp/${1}.$$ ++ WFILE=`mktemp ${MC_TMPDIR:-/tmp}/news.XXXXXX` || exit 1 + case $CHECK in + Newsgroups:|Path:) + cp $1 $WFILE && sed '/^'"$CHECK"' /,/^$/d' $WFILE > $1 diff --git a/misc/mc/files/patch-mc-wrapper b/misc/mc/files/patch-mc-wrapper new file mode 100644 index 000000000000..8387ca01c7e5 --- /dev/null +++ b/misc/mc/files/patch-mc-wrapper @@ -0,0 +1,18 @@ +--- lib/mc-wrapper.csh.in.orig Wed Nov 6 00:46:12 2002 ++++ lib/mc-wrapper.csh.in Tue Jun 15 03:16:29 2004 +@@ -14,5 +14,5 @@ + unsetenv MC_PWD + endif + +-rm -f "$MC_PWD_FILE" ++/bin/rm -f "$MC_PWD_FILE" + unsetenv MC_PWD_FILE +--- lib/mc-wrapper.sh.in.orig Wed Nov 6 00:46:12 2002 ++++ lib/mc-wrapper.sh.in Tue Jun 15 03:16:29 2004 +@@ -9,5 +9,5 @@ + unset MC_PWD + fi + +-rm -f "$MC_PWD_FILE" ++/bin/rm -f "$MC_PWD_FILE" + unset MC_PWD_FILE diff --git a/misc/mc/files/patch-mc.1 b/misc/mc/files/patch-mc.1 new file mode 100644 index 000000000000..53d1715bc516 --- /dev/null +++ b/misc/mc/files/patch-mc.1 @@ -0,0 +1,75 @@ +--- doc/es/mc.1.in.orig Wed Feb 5 21:54:31 2003 ++++ doc/es/mc.1.in Tue Jun 15 03:15:09 2004 +@@ -1361,8 +1361,10 @@ + od -c %f + + B Edita un informe de errores y lo envía al superusuario +- vi /tmp/mail.$$ +- mail -s "Error Midnight Commander" root < /tmp/mail.$$ ++ I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1 ++ vi $I ++ mail -s "Error Midnight Commander" root < $I ++ rm -f $I + + M Lee al correo + emacs -f rmail +--- doc/hu/mc.1.in.orig Thu Jan 16 16:30:55 2003 ++++ doc/hu/mc.1.in Tue Jun 15 03:15:09 2004 +@@ -1381,8 +1381,10 @@ + od -c %f + + B A hiba leírás szerkesztése és elküldése a root-nak +- vi /tmp/mail.$$ +- mail -s "Midnight Commander bug" root < /tmp/mail.$$ ++ I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1 ++ vi $I ++ mail -s "Midnight Commander bug" root < $I ++ rm -f $I + + M Levél olvasás + emacs -f rmail +--- doc/it/mc.1.in.orig Sun Jan 19 23:11:06 2003 ++++ doc/it/mc.1.in Tue Jun 15 03:15:09 2004 +@@ -1379,8 +1379,10 @@ + od -c %f + + B Modifica un rapporto bachi e lo spedisce a root +- vi /tmp/mail.$$ +- mail -s "Midnight Commander bug" root < /tmp/mail.$$ ++ I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1 ++ vi $I ++ mail -s "Midnight Commander bug" root < $I ++ rm -f $I + + M Legge la posta + emacs -f rmail +--- doc/mc.1.in.orig Wed Feb 5 21:54:31 2003 ++++ doc/mc.1.in Tue Jun 15 03:15:09 2004 +@@ -1385,8 +1385,10 @@ + od -c %f + + B Edit a bug report and send it to root +- vi /tmp/mail.$$ +- mail -s "Midnight Commander bug" root < /tmp/mail.$$ ++ I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1 ++ vi $I ++ mail -s "Midnight Commander bug" root < $I ++ rm -f $I + + M Read mail + emacs -f rmail +--- doc/ru/mc.1.in.orig Tue Feb 4 03:59:14 2003 ++++ doc/ru/mc.1.in Tue Jun 15 03:15:09 2004 +@@ -1557,8 +1557,10 @@ + od -c %f + + B Edit a bug report and send it to root +- vi /tmp/mail.$$ +- mail -s "Midnight Commander bug" root < /tmp/mail.$$ ++ I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1 ++ vi $I ++ mail -s "Midnight Commander bug" root < $I ++ rm -f $I + + M Read mail + emacs -f rmail diff --git a/misc/mc/files/patch-po b/misc/mc/files/patch-po new file mode 100644 index 000000000000..dab6d924887f --- /dev/null +++ b/misc/mc/files/patch-po @@ -0,0 +1,1021 @@ +--- po/az.po.orig Thu Feb 6 00:09:44 2003 ++++ po/az.po Tue Jun 15 03:15:09 2004 +@@ -2411,13 +2411,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " ( %d blok )" ++msgid " (%ld block)" ++msgstr " ( %ld blok )" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " ( %d blok )" ++msgid " (%ld blocks)" ++msgstr " ( %ld blok )" + + #: src/info.c:179 + #, c-format +@@ -3656,8 +3656,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/be.po.orig Thu Feb 6 00:09:44 2003 ++++ po/be.po Tue Jun 15 03:15:09 2004 +@@ -2404,13 +2404,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d áë¸ęŕ˘)" ++msgid " (%ld block)" ++msgstr " (%ld áë¸ęŕ˘)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d áë¸ęŕ˘)" ++msgid " (%ld blocks)" ++msgstr " (%ld áë¸ęŕ˘)" + + #: src/info.c:179 + #, c-format +@@ -3630,8 +3630,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Çđóő 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Çđóő 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/bg.po.orig Thu Feb 6 00:09:45 2003 ++++ po/bg.po Tue Jun 15 03:15:09 2004 +@@ -2406,13 +2406,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d йНОк)" ++msgid " (%ld block)" ++msgstr " (%ld йНОк)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d йНОка)" ++msgid " (%ld blocks)" ++msgstr " (%ld йНОка)" + + #: src/info.c:179 + #, c-format +@@ -3649,8 +3649,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "ĐŃПоŃŃвано 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "ĐŃПоŃŃвано 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/ca.po.orig Thu Feb 6 00:09:45 2003 ++++ po/ca.po Tue Jun 15 03:15:09 2004 +@@ -2416,13 +2416,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d bloc)" ++msgid " (%ld block)" ++msgstr " (%ld bloc)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blocs)" ++msgid " (%ld blocks)" ++msgstr " (%ld blocs)" + + #: src/info.c:179 + #, c-format +@@ -3670,8 +3670,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Desplaçament 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Desplaçament 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/cs.po.orig Thu Feb 6 00:09:45 2003 ++++ po/cs.po Tue Jun 15 03:15:09 2004 +@@ -2407,13 +2407,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blok)" ++msgid " (%ld block)" ++msgstr " (%ld blok)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d bloků)" ++msgid " (%ld blocks)" ++msgstr " (%ld bloků)" + + #: src/info.c:179 + #, c-format +@@ -3643,8 +3643,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Posun 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Posun 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/da.po.orig Thu Feb 6 00:09:46 2003 ++++ po/da.po Tue Jun 15 03:15:09 2004 +@@ -1,8 +1,7 @@ +-# Danish translation of Midnight Commander +-# Copyright (C) 1998 Free Software Foundation, Inc. +-# Kenneth Christiansen <kenneth@ripen.dk>, 1999-2000 +-# Birger Langkjer <birger.langkjer@image.dk>, 1999. +-# Keld Simonsen <keld@dkuug.dk>, 2000. ++# Danish translation of Midnight Commander Copyright (C) 1998 Free Software ++# Foundation, Inc. Kenneth Christiansen <kenneth@ripen.dk>, 1999-2000 Birger ++# Langkjer <birger.langkjer@image.dk>, 1999. Keld Simonsen <keld@dkuug.dk>, ++# 2000. + # + # Note: MC bestĺr af konsol- (mc) og gtkdel (gmc) + # Genveje i konsolen er '&+stort bogstav', resten +@@ -2416,13 +2415,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blok)" ++msgid " (%ld block)" ++msgstr " (%ld blok)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blokke)" ++msgid " (%ld blocks)" ++msgstr " (%ld blokke)" + + #: src/info.c:179 + #, c-format +@@ -3661,8 +3660,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Afstand 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Afstand 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/de.po.orig Thu Feb 6 00:09:46 2003 ++++ po/de.po Tue Jun 15 03:15:09 2004 +@@ -2415,13 +2415,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d Block)" ++msgid " (%ld block)" ++msgstr " (%ld Block)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr "(%d Blöcke)" ++msgid " (%ld blocks)" ++msgstr "(%ld Blöcke)" + + #: src/info.c:179 + #, c-format +@@ -3664,8 +3664,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/el.po.orig Thu Feb 6 00:09:46 2003 ++++ po/el.po Tue Jun 15 03:15:09 2004 +@@ -2304,12 +2304,12 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" ++msgid " (%ld block)" + msgstr "" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" ++msgid " (%ld blocks)" + msgstr "" + + #: src/info.c:179 +@@ -3480,7 +3480,7 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" ++msgid "Offset 0x%08lx" + msgstr "" + + #: src/view.c:826 +--- po/es.po.orig Thu Feb 6 00:09:46 2003 ++++ po/es.po Tue Jun 15 03:15:09 2004 +@@ -2403,13 +2403,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d bloque)" ++msgid " (%ld block)" ++msgstr " (%ld bloque)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d bloques)" ++msgid " (%ld blocks)" ++msgstr " (%ld bloques)" + + #: src/info.c:179 + #, c-format +@@ -3638,8 +3638,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/eu.po.orig Thu Feb 6 00:09:46 2003 ++++ po/eu.po Tue Jun 15 03:15:09 2004 +@@ -2415,13 +2415,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d bloke)" ++msgid " (%ld block)" ++msgstr " (%ld bloke)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr "(%d bloke)" ++msgid " (%ld blocks)" ++msgstr "(%ld bloke)" + + #: src/info.c:179 + #, c-format +@@ -3665,8 +3665,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Desplazamendua 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Desplazamendua 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/fi.po.orig Thu Feb 6 00:09:47 2003 ++++ po/fi.po Tue Jun 15 03:15:09 2004 +@@ -2364,12 +2364,12 @@ + + #: src/info.c:173 + #, fuzzy, c-format +-msgid " (%d block)" ++msgid " (%ld block)" + msgstr " Järjestä valinta " + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" ++msgid " (%ld blocks)" + msgstr "" + + #: src/info.c:179 +@@ -3556,8 +3556,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Siirros 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Siirros 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/fr.po.orig Thu Feb 6 00:09:47 2003 ++++ po/fr.po Tue Jun 15 03:15:09 2004 +@@ -2411,13 +2411,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d bloc)" ++msgid " (%ld block)" ++msgstr " (%ld bloc)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blocs)" ++msgid " (%ld blocks)" ++msgstr " (%ld blocs)" + + #: src/info.c:179 + #, c-format +@@ -3663,8 +3663,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Décalage 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Décalage 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/hu.po.orig Thu Feb 6 00:09:47 2003 ++++ po/hu.po Tue Jun 15 03:15:09 2004 +@@ -2444,13 +2444,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blokk)" ++msgid " (%ld block)" ++msgstr " (%ld blokk)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blokk)" ++msgid " (%ld blocks)" ++msgstr " (%ld blokk)" + + #: src/info.c:179 + #, c-format +@@ -3685,8 +3685,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Pozíció: 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Pozíció: 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/it.po.orig Thu Feb 6 00:09:47 2003 ++++ po/it.po Tue Jun 15 03:15:09 2004 +@@ -2409,13 +2409,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blocchi)" ++msgid " (%ld block)" ++msgstr " (%ld blocchi)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blocchi)" ++msgid " (%ld blocks)" ++msgstr " (%ld blocchi)" + + #: src/info.c:179 + #, c-format +@@ -3644,8 +3644,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset: 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset: 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/ja.po.orig Thu Feb 6 00:09:48 2003 ++++ po/ja.po Tue Jun 15 03:15:09 2004 +@@ -2410,13 +2410,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%dĽÖĽíĽĂĽŻ)" ++msgid " (%ld block)" ++msgstr " (%ldĽÖĽíĽĂĽŻ)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%dĽÖĽíĽĂĽŻ)" ++msgid " (%ld blocks)" ++msgstr " (%ldĽÖĽíĽĂĽŻ)" + + #: src/info.c:179 + #, c-format +@@ -3654,8 +3654,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "ĽŞĽŐĽťĽĂĽČ 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "ĽŞĽŐĽťĽĂĽČ 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/ko.po.orig Thu Feb 6 00:09:48 2003 ++++ po/ko.po Tue Jun 15 03:15:09 2004 +@@ -2399,13 +2399,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d ą¸żŞ)" ++msgid " (%ld block)" ++msgstr " (%ld ą¸żŞ)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d ą¸żŞ)" ++msgid " (%ld blocks)" ++msgstr " (%ld ą¸żŞ)" + + #: src/info.c:179 + #, c-format +@@ -3631,8 +3631,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "żÉźÂ 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "żÉźÂ 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/lv.po.orig Thu Feb 6 00:09:48 2003 ++++ po/lv.po Tue Jun 15 03:15:09 2004 +@@ -2411,13 +2411,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d bloks)" ++msgid " (%ld block)" ++msgstr " (%ld bloks)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d bloki)" ++msgid " (%ld blocks)" ++msgstr " (%ld bloki)" + + #: src/info.c:179 + #, c-format +@@ -3661,8 +3661,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Nobîde 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Nobîde 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/nl.po.orig Thu Feb 6 00:09:48 2003 ++++ po/nl.po Tue Jun 15 03:15:09 2004 +@@ -2406,13 +2406,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blokken)" ++msgid " (%ld block)" ++msgstr " (%ld blokken)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr "(%d blokken)" ++msgid " (%ld blocks)" ++msgstr "(%ld blokken)" + + #: src/info.c:179 + #, c-format +@@ -3640,8 +3640,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/no.po.orig Thu Feb 6 00:09:49 2003 ++++ po/no.po Tue Jun 15 03:15:09 2004 +@@ -2405,13 +2405,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blokk)" ++msgid " (%ld block)" ++msgstr " (%ld blokk)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blokker)" ++msgid " (%ld blocks)" ++msgstr " (%ld blokker)" + + #: src/info.c:179 + #, c-format +@@ -3640,8 +3640,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/pl.po.orig Thu Feb 6 00:09:49 2003 ++++ po/pl.po Tue Jun 15 03:15:09 2004 +@@ -2410,13 +2410,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blok)" ++msgid " (%ld block)" ++msgstr " (%ld blok)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d bloków)" ++msgid " (%ld blocks)" ++msgstr " (%ld bloków)" + + #: src/info.c:179 + #, c-format +@@ -3642,8 +3642,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Przesunięcie 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Przesunięcie 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/pt.po.orig Thu Feb 6 00:09:49 2003 ++++ po/pt.po Tue Jun 15 03:15:09 2004 +@@ -2410,13 +2410,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d bloco)" ++msgid " (%ld block)" ++msgstr " (%ld bloco)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blocos)" ++msgid " (%ld blocks)" ++msgstr " (%ld blocos)" + + #: src/info.c:179 + #, c-format +@@ -3657,8 +3657,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/pt_BR.po.orig Thu Feb 6 00:09:49 2003 ++++ po/pt_BR.po Tue Jun 15 03:15:09 2004 +@@ -2429,13 +2429,13 @@ + + #: src/info.c:173 + #, fuzzy, c-format +-msgid " (%d block)" +-msgstr " (%d blocos)" ++msgid " (%ld block)" ++msgstr " (%ld blocos)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blocos)" ++msgid " (%ld blocks)" ++msgstr " (%ld blocos)" + + #: src/info.c:179 + #, c-format +@@ -3691,8 +3691,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Deslocamento 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Deslocamento 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/ro.po.orig Thu Feb 6 00:09:50 2003 ++++ po/ro.po Tue Jun 15 03:15:09 2004 +@@ -2403,13 +2403,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blocuri)" ++msgid " (%ld block)" ++msgstr " (%ld blocuri)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blocuri)" ++msgid " (%ld blocks)" ++msgstr " (%ld blocuri)" + + #: src/info.c:179 + #, c-format +@@ -3638,8 +3638,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/ru.po.orig Thu Feb 6 00:09:50 2003 ++++ po/ru.po Tue Jun 15 03:15:09 2004 +@@ -2411,13 +2411,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d ÂĚĎË)" ++msgid " (%ld block)" ++msgstr " (%ld ÂĚĎË)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d ÂĚĎËĎ×)" ++msgid " (%ld blocks)" ++msgstr " (%ld ÂĚĎËĎ×)" + + #: src/info.c:179 + #, c-format +@@ -3644,8 +3644,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "óÍĹÝĹÎÉĹ 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "óÍĹÝĹÎÉĹ 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/sk.po.orig Thu Feb 6 00:09:50 2003 ++++ po/sk.po Tue Jun 15 03:15:09 2004 +@@ -2402,13 +2402,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blok)" ++msgid " (%ld block)" ++msgstr " (%ld blok)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blokov)" ++msgid " (%ld blocks)" ++msgstr " (%ld blokov)" + + #: src/info.c:179 + #, c-format +@@ -3634,8 +3634,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/sl.po.orig Thu Feb 6 00:09:50 2003 ++++ po/sl.po Tue Jun 15 03:15:09 2004 +@@ -2405,13 +2405,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blokov)" ++msgid " (%ld block)" ++msgstr " (%ld blokov)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blokov)" ++msgid " (%ld blocks)" ++msgstr " (%ld blokov)" + + #: src/info.c:179 + #, c-format +@@ -3640,8 +3640,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/sv.po.orig Thu Feb 6 00:09:51 2003 ++++ po/sv.po Tue Jun 15 03:15:09 2004 +@@ -2434,13 +2434,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d block)" ++msgid " (%ld block)" ++msgstr " (%ld block)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d block)" ++msgid " (%ld blocks)" ++msgstr " (%ld block)" + + #: src/info.c:179 + #, c-format +@@ -3678,8 +3678,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + # svängelska? + #: src/view.c:826 +--- po/ta.po.orig Thu Feb 6 00:09:51 2003 ++++ po/ta.po Tue Jun 15 03:15:09 2004 +@@ -2307,12 +2307,12 @@ + + #: src/info.c:173 + #, fuzzy, c-format +-msgid " (%d block)" ++msgid " (%ld block)" + msgstr " ŚžĄĚž˘¨Â ĹĄ˘¨şÂĄěĚ " + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" ++msgid " (%ld blocks)" + msgstr "" + + #: src/info.c:179 +@@ -3483,7 +3483,7 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" ++msgid "Offset 0x%08lx" + msgstr "" + + #: src/view.c:826 +--- po/tr.po.orig Thu Feb 6 00:09:51 2003 ++++ po/tr.po Tue Jun 15 03:15:09 2004 +@@ -2409,13 +2409,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blok)" ++msgid " (%ld block)" ++msgstr " (%ld blok)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d blok)" ++msgid " (%ld blocks)" ++msgstr " (%ld blok)" + + #: src/info.c:179 + #, c-format +@@ -3655,8 +3655,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "Offset 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "Offset 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/uk.po.orig Thu Feb 6 00:09:51 2003 ++++ po/uk.po Tue Jun 15 03:15:09 2004 +@@ -2399,13 +2399,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d ÂĚĎË)" ++msgid " (%ld block)" ++msgstr " (%ld ÂĚĎË)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d ÂĚĎËŚ×)" ++msgid " (%ld blocks)" ++msgstr " (%ld ÂĚĎËŚ×)" + + #: src/info.c:179 + #, c-format +@@ -3632,8 +3632,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "úÍŚÝĹÎÎŃ 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "úÍŚÝĹÎÎŃ 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/wa.po.orig Thu Feb 6 00:09:52 2003 ++++ po/wa.po Tue Jun 15 03:15:09 2004 +@@ -2425,13 +2425,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d blok)" ++msgid " (%ld block)" ++msgstr " (%ld blok)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d bloks)" ++msgid " (%ld blocks)" ++msgstr " (%ld bloks)" + + #: src/info.c:179 + #, c-format +@@ -3650,7 +3650,7 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" ++msgid "Offset 0x%08lx" + msgstr "" + + #: src/view.c:826 +--- po/zh_CN.po.orig Thu Feb 6 00:09:52 2003 ++++ po/zh_CN.po Tue Jun 15 03:15:09 2004 +@@ -2396,13 +2396,13 @@ + + #: src/info.c:173 + #, c-format +-msgid " (%d block)" +-msgstr " (%d 个ĺ)" ++msgid " (%ld block)" ++msgstr " (%ld 个ĺ)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d 个ĺ)" ++msgid " (%ld blocks)" ++msgstr " (%ld 个ĺ)" + + #: src/info.c:179 + #, c-format +@@ -3629,8 +3629,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "ĺ秝 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "ĺ秝 0x%08lx" + + #: src/view.c:826 + #, c-format +--- po/zh_TW.po.orig Thu Feb 6 00:09:52 2003 ++++ po/zh_TW.po Tue Jun 15 03:15:09 2004 +@@ -2407,13 +2407,13 @@ + + #: src/info.c:173 + #, fuzzy, c-format +-msgid " (%d block)" +-msgstr " (%d Ó°Ďśô)" ++msgid " (%ld block)" ++msgstr " (%ld Ó°Ďśô)" + + #: src/info.c:173 + #, c-format +-msgid " (%d blocks)" +-msgstr " (%d Ó°Ďśô)" ++msgid " (%ld blocks)" ++msgstr " (%ld Ó°Ďśô)" + + #: src/info.c:179 + #, c-format +@@ -3655,8 +3655,8 @@ + + #: src/view.c:824 + #, c-format +-msgid "Offset 0x%08x" +-msgstr "°ž˛žČ 0x%08x" ++msgid "Offset 0x%08lx" ++msgstr "°ž˛žČ 0x%08lx" + + #: src/view.c:826 + #, c-format diff --git a/misc/mc/files/patch-slang-sltermin.c b/misc/mc/files/patch-slang-sltermin.c new file mode 100644 index 000000000000..73b194aea903 --- /dev/null +++ b/misc/mc/files/patch-slang-sltermin.c @@ -0,0 +1,18 @@ +--- slang/sltermin.c.orig Mon Oct 7 18:08:16 2002 ++++ slang/sltermin.c Tue Jun 15 03:15:09 2004 +@@ -267,9 +267,12 @@ + + if (NULL != (home = getenv ("HOME"))) + { +- strncpy (home_ti, home, sizeof (home_ti) - 11); +- home_ti [sizeof(home_ti) - 11] = 0; +- strcat (home_ti, "/.terminfo"); ++ size_t len = strlen (home); ++ ++ if (len > sizeof (home_ti) - sizeof ("/.terminfo")) ++ len = sizeof (home_ti) - sizeof ("/.terminfo"); ++ memcpy (home_ti, home, len); ++ memcpy (home_ti + len, "/.terminfo", sizeof ("/.terminfo")); + Terminfo_Dirs [0] = home_ti; + } + diff --git a/misc/mc/files/patch-src::Makefile.in b/misc/mc/files/patch-src-Makefile.in index 8379a8f5d5b2..8d2c70a67b51 100644 --- a/misc/mc/files/patch-src::Makefile.in +++ b/misc/mc/files/patch-src-Makefile.in @@ -1,5 +1,5 @@ ---- src/Makefile.in.orig Mon Feb 10 02:00:05 2003 -+++ src/Makefile.in Mon Feb 10 02:00:19 2003 +--- src/Makefile.in.orig Thu Feb 6 00:09:09 2003 ++++ src/Makefile.in Tue Jun 15 03:14:17 2004 @@ -700,7 +700,7 @@ install-data-am: diff --git a/misc/mc/files/patch-src-background.c b/misc/mc/files/patch-src-background.c new file mode 100644 index 000000000000..95e20450fdbe --- /dev/null +++ b/misc/mc/files/patch-src-background.c @@ -0,0 +1,11 @@ +--- src/background.c.orig Sat Sep 28 12:10:29 2002 ++++ src/background.c Tue Jun 15 03:17:55 2004 +@@ -142,7 +142,7 @@ + close (1); + close (2); + +- if ((nullfd = open ("/dev/null", O_RDONLY)) != -1){ ++ if ((nullfd = open ("/dev/null", O_RDWR)) != -1){ + while (dup2 (nullfd, 0) == -1 && errno == EINTR) + ; + while (dup2 (nullfd, 1) == -1 && errno == EINTR) diff --git a/misc/mc/files/patch-src-cmd.c b/misc/mc/files/patch-src-cmd.c new file mode 100644 index 000000000000..f92c6ca97c31 --- /dev/null +++ b/misc/mc/files/patch-src-cmd.c @@ -0,0 +1,11 @@ +--- src/cmd.c.orig Wed Feb 5 21:54:33 2003 ++++ src/cmd.c Tue Jun 15 03:15:09 2004 +@@ -1132,7 +1132,7 @@ + + q = g_strdup_printf (_(" Symlink `%s\' points to: "), name_trunc (p, 32)); + +- i = readlink (p, buffer, MC_MAXPATHLEN); ++ i = readlink (p, buffer, MC_MAXPATHLEN - 1); + if (i > 0) { + buffer [i] = 0; + dest = input_expand_dialog (_(" Edit symlink "), q, buffer); diff --git a/misc/mc/files/patch-src-command.c b/misc/mc/files/patch-src-command.c new file mode 100644 index 000000000000..1dc7e17c8f64 --- /dev/null +++ b/misc/mc/files/patch-src-command.c @@ -0,0 +1,11 @@ +--- src/command.c.orig Thu Nov 14 13:25:19 2002 ++++ src/command.c Tue Jun 15 03:15:09 2004 +@@ -258,7 +258,7 @@ + WInput * + command_new (int y, int x, int cols) + { +- WInput *cmd = g_new (WInput, 1); ++ WInput *cmd; + + cmd = input_new (y, x, DEFAULT_COLOR, cols, "", "cmdline"); + diff --git a/misc/mc/files/patch-src-complete.c b/misc/mc/files/patch-src-complete.c new file mode 100644 index 000000000000..6bcb16098ecd --- /dev/null +++ b/misc/mc/files/patch-src-complete.c @@ -0,0 +1,30 @@ +--- src/complete.c.orig Wed Nov 13 08:56:41 2002 ++++ src/complete.c Tue Jun 15 03:15:09 2004 +@@ -270,7 +270,7 @@ + *temp = '$'; + if (isbrace) + temp [1] = '{'; +- strncpy (temp + 1 + isbrace, *env_p, p - *env_p); ++ memcpy (temp + 1 + isbrace, *env_p, p - *env_p); + if (isbrace) + strcpy (temp + 2 + (p - *env_p), "}"); + else +@@ -605,8 +605,7 @@ + matches = i; + match_list [matches + 1] = NULL; + match_list[0] = g_malloc (low + 1); +- strncpy (match_list[0], match_list[1], low); +- match_list[0][low] = 0; ++ g_strlcpy (match_list[0], match_list[1], low + 1); + } + } else { /* There were no matches. */ + g_free (match_list); +@@ -806,7 +805,7 @@ + *(p++) = *(q++); + *p = 0; + } +- strncpy (in->buffer + start, text, len - start + end); ++ memcpy (in->buffer + start, text, len - start + end); + in->point += len; + update_input (in, 1); + end += len; diff --git a/misc/mc/files/patch-src::cons.handler.c b/misc/mc/files/patch-src-cons.handler.c index acdddaf6ecc5..ae2e1b659a59 100644 --- a/misc/mc/files/patch-src::cons.handler.c +++ b/misc/mc/files/patch-src-cons.handler.c @@ -1,11 +1,5 @@ -Index: cons.handler.c -=================================================================== -RCS file: /cvs/gnome/mc/src/cons.handler.c,v -retrieving revision 1.13 -retrieving revision 1.17 -diff -u -p -r1.13 -r1.17 ---- src/cons.handler.c 23 Sep 2002 06:43:23 -0000 1.13 -+++ src/cons.handler.c 5 Mar 2003 09:29:31 -0000 1.17 +--- src/cons.handler.c.orig Mon Sep 23 13:43:23 2002 ++++ src/cons.handler.c Tue Jun 15 03:14:17 2004 @@ -15,8 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -79,7 +73,7 @@ diff -u -p -r1.13 -r1.17 cons_saver_pid = 0; console_flag = 0; return; -@@ -75,9 +86,9 @@ void show_console_contents (int starty, +@@ -75,9 +86,9 @@ read (pipefd2[0], &bytes, 2); /* Read the bytes and output them */ @@ -91,7 +85,7 @@ diff -u -p -r1.13 -r1.17 read (pipefd2[0], &message, 1); addch (message); } -@@ -86,16 +97,15 @@ void show_console_contents (int starty, +@@ -86,16 +97,15 @@ read (pipefd2[0], &message, 1); } @@ -111,7 +105,7 @@ diff -u -p -r1.13 -r1.17 /* Close old pipe ends in case it is the 2nd time we run cons.saver */ close (pipefd1[1]); close (pipefd2[0]); -@@ -104,7 +114,7 @@ void handle_console (unsigned char actio +@@ -104,7 +114,7 @@ pipe (pipefd2); /* Get the console saver running */ cons_saver_pid = fork (); @@ -120,7 +114,7 @@ diff -u -p -r1.13 -r1.17 /* Cannot fork */ /* Delete pipes */ close (pipefd1[1]); -@@ -112,14 +122,14 @@ void handle_console (unsigned char actio +@@ -112,14 +122,14 @@ close (pipefd2[1]); close (pipefd2[0]); console_flag = 0; @@ -137,7 +131,7 @@ diff -u -p -r1.13 -r1.17 close (pipefd1[1]); close (pipefd2[0]); waitpid (cons_saver_pid, &status, 0); -@@ -152,33 +162,31 @@ void handle_console (unsigned char actio +@@ -152,33 +162,31 @@ close (1); close (0); _exit (3); @@ -177,7 +171,7 @@ diff -u -p -r1.13 -r1.17 waitpid (cons_saver_pid, &status, 0); console_flag = 0; } -@@ -186,221 +194,371 @@ void handle_console (unsigned char actio +@@ -186,221 +194,371 @@ } } @@ -393,13 +387,11 @@ diff -u -p -r1.13 -r1.17 + case CONSOLE_DONE: + console_shutdown (); + break; - -- saved_attr = ioctl(FD_OUT, GIO_ATTR, 0); ++ + case CONSOLE_SAVE: + console_save (); + break; - -- vidbuf = (unsigned short*) ioctl(FD_OUT, MAPCONS, 0); ++ + case CONSOLE_RESTORE: + console_restore (); + break; @@ -408,18 +400,14 @@ diff -u -p -r1.13 -r1.17 + } +} -- mi.size = sizeof(struct m6845_info); -- ioctl(FD_OUT, CONS_6845INFO, &mi); +- saved_attr = ioctl(FD_OUT, GIO_ATTR, 0); +static void +show_console_contents_sco (int starty, unsigned char begin_line, + unsigned char end_line) +{ + register int i, len = (end_line - begin_line) * width; -- { -- unsigned short* start = vidbuf + mi.screen_top; -- memcpy(screen, start, width * height * 2); -- } +- vidbuf = (unsigned short*) ioctl(FD_OUT, MAPCONS, 0); + attrset (DEFAULT_COLOR); + for (i = 0; i < len; i++) { + if ((i % width) == 0) @@ -427,9 +415,15 @@ diff -u -p -r1.13 -r1.17 + addch ((unsigned char) screen[width * starty + i]); + } +} -+ + +- mi.size = sizeof(struct m6845_info); +- ioctl(FD_OUT, CONS_6845INFO, &mi); +#elif defined(__FreeBSD__) -+ + +- { +- unsigned short* start = vidbuf + mi.screen_top; +- memcpy(screen, start, width * height * 2); +- } +/* + * FreeBSD support copyright (C) 2003 Alexander Serkov <serkov@ukrpost.net>. + * Support for screenmaps by Max Khon <fjoe@FreeBSD.org> @@ -694,7 +688,7 @@ diff -u -p -r1.13 -r1.17 { standend (); -@@ -408,14 +566,28 @@ void show_console_contents (int starty, +@@ -408,14 +566,28 @@ show_rxvt_contents (starty, begin_line, end_line); return; } diff --git a/misc/mc/files/patch-src-dir.c b/misc/mc/files/patch-src-dir.c new file mode 100644 index 000000000000..e9a97a35aefa --- /dev/null +++ b/misc/mc/files/patch-src-dir.c @@ -0,0 +1,53 @@ +--- src/dir.c.orig Tue Jan 21 06:41:45 2003 ++++ src/dir.c Tue Jun 15 03:15:09 2004 +@@ -503,9 +503,11 @@ + } + + if (next_free) { ++ char *path = vfs_canon ("."); + /* Add ".." except the root directory */ +- if (strcmp (vfs_canon ("."), "/") != 0) ++ if (strcmp (path, "/") != 0) + add_dotdot_to_list (list, next_free++); ++ g_free (path); + do_sort (list, sort, next_free - 1, reverse, case_sensitive); + } else { + tree_store_end_check (); +@@ -576,7 +578,7 @@ + int i, status, link_to_dir, stale_link; + struct stat buf; + int marked_cnt; +- GHashTable *marked_files = g_hash_table_new (g_str_hash, g_str_equal); ++ GHashTable *marked_files; + + tree_store_start_check_cwd (); + dirp = mc_opendir ("."); +@@ -587,6 +589,7 @@ + return set_zero_dir (list); + } + ++ marked_files = g_hash_table_new (g_str_hash, g_str_equal); + alloc_dir_copy (list->size); + for (marked_cnt = i = 0; i < count; i++) { + dir_copy.list[i].fnamelen = list->list[i].fnamelen; +@@ -622,6 +625,7 @@ + clean_dir (&dir_copy, count); + */ + tree_store_end_check (); ++ g_hash_table_destroy (marked_files); + return next_free; + } + +@@ -655,9 +659,11 @@ + tree_store_end_check (); + g_hash_table_destroy (marked_files); + if (next_free) { ++ char *path = vfs_canon ("."); + /* Add ".." except the root directory */ +- if (strcmp (vfs_canon ("."), "/") != 0) ++ if (strcmp (path, "/") != 0) + add_dotdot_to_list (list, next_free++); ++ g_free (path); + do_sort (list, sort, next_free - 1, rev, case_sensitive); + } else + next_free = set_zero_dir (list); diff --git a/misc/mc/files/patch-src-ext.c b/misc/mc/files/patch-src-ext.c new file mode 100644 index 000000000000..b20292d2b8e7 --- /dev/null +++ b/misc/mc/files/patch-src-ext.c @@ -0,0 +1,50 @@ +--- src/ext.c.orig Thu Nov 14 13:25:19 2002 ++++ src/ext.c Tue Jun 15 03:15:09 2004 +@@ -450,7 +450,7 @@ + + if (content_string && content_string[0] + && regexp_match (ptr, content_string + content_shift, +- match_normal)) { ++ match_regex)) { + found = 1; + } + +@@ -477,7 +477,6 @@ + int found = 0; + int error_flag = 0; + int ret = 0; +- int old_patterns; + struct stat mystat; + int view_at_line_number; + char *include_target; +@@ -559,8 +558,6 @@ + } + mc_stat (filename, &mystat); + +- old_patterns = easy_patterns; +- easy_patterns = 0; /* Real regular expressions are needed :) */ + include_target = NULL; + include_target_len = 0; + for (p = data; *p; p++) { +@@ -593,11 +590,11 @@ + /* Do not transform shell patterns, you can use shell/ for + * that + */ +- if (regexp_match (p, filename, match_normal)) ++ if (regexp_match (p, filename, match_regex)) + found = 1; + } else if (!strncmp (p, "directory/", 10)) { + if (S_ISDIR (mystat.st_mode) +- && regexp_match (p + 10, filename, match_normal)) ++ && regexp_match (p + 10, filename, match_regex)) + found = 1; + } else if (!strncmp (p, "shell/", 6)) { + p += 6; +@@ -683,7 +680,6 @@ + break; + } + } +- easy_patterns = old_patterns; + if (error_flag) + return -1; + return ret; diff --git a/misc/mc/files/patch-src-file.c b/misc/mc/files/patch-src-file.c new file mode 100644 index 000000000000..75db157dfd51 --- /dev/null +++ b/misc/mc/files/patch-src-file.c @@ -0,0 +1,31 @@ +--- src/file.c.orig Fri Dec 27 01:04:10 2002 ++++ src/file.c Tue Jun 15 03:15:09 2004 +@@ -366,7 +366,7 @@ + dst_is_symlink = 0; + + retry_src_readlink: +- len = mc_readlink (src_path, link_target, MC_MAXPATHLEN); ++ len = mc_readlink (src_path, link_target, MC_MAXPATHLEN - 1); + if (len < 0) { + return_status = + file_error (_(" Cannot read source link \"%s\" \n %s "), +@@ -715,6 +715,7 @@ + gettimeofday (&tv_current, NULL); + + if (n_read > 0) { ++ char *t = buf; + n_read_total += n_read; + + /* Windows NT ftp servers report that files have no +@@ -729,9 +730,10 @@ + + /* dst_write */ + while ((n_written = +- mc_write (dest_desc, buf, n_read)) < n_read) { ++ mc_write (dest_desc, t, n_read)) < n_read) { + if (n_written > 0) { + n_read -= n_written; ++ t += n_written; + continue; + } + return_status = diff --git a/misc/mc/files/patch-src-find.c b/misc/mc/files/patch-src-find.c new file mode 100644 index 000000000000..072b11eb452e --- /dev/null +++ b/misc/mc/files/patch-src-find.c @@ -0,0 +1,97 @@ +--- src/find.c.orig Tue Dec 24 17:28:26 2002 ++++ src/find.c Tue Jun 15 03:15:09 2004 +@@ -312,7 +312,7 @@ + dir_stack *new; + + new = g_new (dir_stack, 1); +- new->name = g_strdup (dir); ++ new->name = concat_dir_and_file (dir, ""); + new->prev = dir_stack_base; + dir_stack_base = new; + } +@@ -338,17 +338,9 @@ + { + char *tmp_name; + static char *dirname; +- int i; + +- if (dir [0] == PATH_SEP && dir [1] == PATH_SEP) ++ while (dir [0] == PATH_SEP && dir [1] == PATH_SEP) + dir++; +- i = strlen (dir); +- if (i){ +- if (dir [i - 1] != PATH_SEP){ +- dir [i] = PATH_SEP; +- dir [i + 1] = 0; +- } +- } + + if (old_dir){ + if (strcmp (old_dir, dir)){ +@@ -401,7 +393,7 @@ + char ch = 0; + int i = 0; + +- do { ++ for (;;) { + if (*pos >= *n_read){ + *pos = 0; + if ((*n_read = mc_read (file_fd, buf, buf_size)) <= 0) +@@ -420,10 +412,12 @@ + if (i >= buffer_size - 1){ + buffer = g_realloc (buffer, buffer_size += 80); + } ++ /* Strip newline to fix $ matching */ ++ if (ch == '\n') ++ break; + + buffer [i++] = ch; +- +- } while (ch != '\n'); ++ } + + *has_newline = ch ? 1 : 0; + +@@ -502,7 +496,7 @@ + { + static struct dirent *dp = 0; + static DIR *dirp = 0; +- static char directory [MC_MAXPATHLEN+2]; ++ static char *directory; + struct stat tmp_stat; + static int pos; + static int subdirs_left = 0; +@@ -513,6 +507,10 @@ + mc_closedir (dirp); + dirp = 0; + } ++ if (directory) { ++ g_free (directory); ++ directory = NULL; ++ } + dp = 0; + return 1; + } +@@ -550,8 +548,9 @@ + break; + } + +- strcpy (directory, tmp); +- g_free (tmp); ++ if (directory) ++ g_free (directory); ++ directory = tmp; + + if (verbose){ + char buffer [BUF_SMALL]; +@@ -582,8 +581,8 @@ + tmp_name = concat_dir_and_file (directory, dp->d_name); + + if (subdirs_left){ +- mc_lstat (tmp_name, &tmp_stat); +- if (S_ISDIR (tmp_stat.st_mode)){ ++ if (!mc_lstat (tmp_name, &tmp_stat) ++ && S_ISDIR (tmp_stat.st_mode)){ + push_directory (tmp_name); + subdirs_left--; + } diff --git a/misc/mc/files/patch-src-info.c b/misc/mc/files/patch-src-info.c new file mode 100644 index 000000000000..73c9ff177761 --- /dev/null +++ b/misc/mc/files/patch-src-info.c @@ -0,0 +1,20 @@ +--- src/info.c.orig Wed Jan 29 04:58:22 2003 ++++ src/info.c Tue Jun 15 03:15:09 2004 +@@ -123,7 +123,7 @@ + size_trunc_len (buffer1, 5, myfs_stats.avail, 1); + size_trunc_len (buffer2, 5, myfs_stats.total, 1); + printw (_("Free space: %s (%d%%) of %s"), buffer1, myfs_stats.total ? +- 100 * myfs_stats.avail / myfs_stats.total : 0, buffer2); ++ (int) (100.0 * myfs_stats.avail / myfs_stats.total) : 0, buffer2); + } else + addstr (_("No space information")); + +@@ -170,7 +170,7 @@ + printw (_("Size: %s"), buffer); + #ifdef HAVE_ST_BLOCKS + printw ((buf.st_blocks==1) ? +- _(" (%d block)") : _(" (%d blocks)"), buf.st_blocks); ++ _(" (%ld block)") : _(" (%ld blocks)"), (long) buf.st_blocks); + #endif + } + diff --git a/misc/mc/files/patch-src-main.c b/misc/mc/files/patch-src-main.c new file mode 100644 index 000000000000..b37514ff48a4 --- /dev/null +++ b/misc/mc/files/patch-src-main.c @@ -0,0 +1,11 @@ +--- src/main.c.orig Wed Feb 5 21:54:34 2003 ++++ src/main.c Tue Jun 15 03:15:09 2004 +@@ -1300,7 +1300,7 @@ + concat_dir_and_file (panel->cwd, selection (panel)->fname); + int i; + +- i = mc_readlink (p, buffer, MC_MAXPATHLEN); ++ i = mc_readlink (p, buffer, MC_MAXPATHLEN - 1); + g_free (p); + if (i > 0) { + buffer[i] = 0; diff --git a/misc/mc/files/patch-src-man2hlp.c b/misc/mc/files/patch-src-man2hlp.c new file mode 100644 index 000000000000..16f2758c1d5f --- /dev/null +++ b/misc/mc/files/patch-src-man2hlp.c @@ -0,0 +1,12 @@ +--- src/man2hlp.c.orig Tue Jan 21 05:23:42 2003 ++++ src/man2hlp.c Tue Jun 15 03:15:09 2004 +@@ -611,8 +611,7 @@ + /* Bold text or italics text */ + if (buffer[0] == '.' && (buffer[1] == 'I' || buffer[1] == 'B')) + for (buffer += 2; *buffer == ' ' || *buffer == '\t'; buffer++); +- strncpy (old, buffer, sizeof (old) - 1); +- old[sizeof (old) - 1] = 0; ++ g_strlcpy (old, buffer, sizeof (old)); + link_flag = 3; + break; + case 3: diff --git a/misc/mc/files/patch-src-profile.c b/misc/mc/files/patch-src-profile.c new file mode 100644 index 000000000000..41b9d389c3b5 --- /dev/null +++ b/misc/mc/files/patch-src-profile.c @@ -0,0 +1,12 @@ +--- src/profile.c.orig Mon Jan 20 20:33:02 2003 ++++ src/profile.c Tue Jun 15 03:15:09 2004 +@@ -325,8 +325,7 @@ + + s = GetSetProfileChar (set, AppName, KeyName, Default, FileName); + if (!set){ +- ReturnedString [Size-1] = 0; +- strncpy (ReturnedString, s, Size-1); ++ g_strlcpy (ReturnedString, s, Size); + } + return 1; + } diff --git a/misc/mc/files/patch-src-screen.c b/misc/mc/files/patch-src-screen.c new file mode 100644 index 000000000000..da4cbad9f71b --- /dev/null +++ b/misc/mc/files/patch-src-screen.c @@ -0,0 +1,52 @@ +--- src/screen.c.orig Wed Jan 29 04:58:22 2003 ++++ src/screen.c Tue Jun 15 03:22:46 2004 +@@ -672,7 +672,7 @@ + int len; + + link = concat_dir_and_file (panel->cwd, panel->dir.list [panel->selected].fname); +- len = mc_readlink (link, link_target, MC_MAXPATHLEN); ++ len = mc_readlink (link, link_target, MC_MAXPATHLEN - 1); + g_free (link); + if (len > 0){ + link_target[len] = 0; +@@ -1045,7 +1045,7 @@ + int spaces, extra; + int side, width; + +- char *txt, buffer[30]; /*Hope that this is enough ;-) */ ++ char *txt; + if (!panel->split) + adjust_top_file (panel); + +@@ -1071,18 +1071,14 @@ + txt = format->title; + + header_len = strlen (txt); +- if (header_len > format->field_len){ +- strcpy (buffer, txt); +- txt = buffer; +- txt [format->field_len] = 0; +- header_len = strlen (txt); +- } ++ if (header_len > format->field_len) ++ header_len = format->field_len; + + attrset (MARKED_COLOR); + spaces = (format->field_len - header_len) / 2; + extra = (format->field_len - header_len) % 2; +- printw ("%*s%-s%*s", spaces, "", +- txt, spaces+extra, ""); ++ printw ("%*s%.*s%*s", spaces, "", ++ header_len, txt, spaces+extra, ""); + width -= 2 * spaces + extra + header_len; + } else { + attrset (NORMAL_COLOR); +@@ -2021,7 +2017,7 @@ + int i; + struct stat mybuf; + +- i = readlink (selection (panel)->fname, buffer, MC_MAXPATHLEN); ++ i = readlink (selection (panel)->fname, buffer, MC_MAXPATHLEN - 1); + if (i < 0) + return; + if (mc_stat (selection (panel)->fname, &mybuf) < 0) diff --git a/misc/mc/files/patch-src-subshell.c b/misc/mc/files/patch-src-subshell.c new file mode 100644 index 000000000000..7f4565e3b7db --- /dev/null +++ b/misc/mc/files/patch-src-subshell.c @@ -0,0 +1,21 @@ +--- src/subshell.c.orig Sat Jan 25 03:37:28 2003 ++++ src/subshell.c Tue Jun 15 03:15:09 2004 +@@ -710,7 +710,9 @@ + } + + g_free (subshell_prompt); ++ g_free (pty_buffer); + subshell_prompt = NULL; ++ pty_buffer = NULL; + + return quit; + } +@@ -1166,6 +1168,8 @@ + #elif IS_AIX + strcpy (pty_name, "/dev/ptc"); + pty_master = open (pty_name, O_RDWR); ++#elif defined(__FreeBSD__) ++ pty_master = posix_openpt(O_RDWR); + #else + strcpy (pty_name, "/dev/ptmx"); + pty_master = open (pty_name, O_RDWR); diff --git a/misc/mc/files/patch-src-user.c b/misc/mc/files/patch-src-user.c new file mode 100644 index 000000000000..259640750a81 --- /dev/null +++ b/misc/mc/files/patch-src-user.c @@ -0,0 +1,183 @@ +--- src/user.c.orig Fri Nov 29 09:03:53 2002 ++++ src/user.c Tue Jun 15 03:15:09 2004 +@@ -138,19 +138,14 @@ + } + + /* Copy the variable name */ +- var_name = g_malloc (dots - p); +- strncpy (var_name, p+4, dots-2 - (p+3)); +- var_name [dots-2 - (p+3)] = 0; +- ++ var_name = g_strndup (p + 4, dots - p - 5); + value = getenv (var_name); + g_free (var_name); + if (value){ + *v = g_strdup (value); + return q-p; + } +- var_name = g_malloc (q - dots + 1); +- strncpy (var_name, dots, q - dots + 1); +- var_name [q-dots] = 0; ++ var_name = g_strndup (dots, q - dots); + *v = var_name; + return q-p; + } +@@ -300,13 +295,15 @@ + + /* Copies a whitespace separated argument from p to arg. Returns the + point after argument. */ +-static char *extract_arg (char *p, char *arg) ++static char *extract_arg (char *p, char *arg, size_t size) + { + while (*p && (*p == ' ' || *p == '\t' || *p == '\n')) + p++; + /* support quote space .mnu */ +- while (*p && (*p != ' ' || *(p-1) == '\\') && *p != '\t' && *p != '\n') ++ while (size > 1 && *p && (*p != ' ' || *(p-1) == '\\') && *p != '\t' && *p != '\n') { + *arg++ = *p++; ++ size--; ++ } + *arg = 0; + if (!*p || *p == '\n') + p --; +@@ -389,29 +386,29 @@ + p--; + break; + case 'f': /* file name pattern */ +- p = extract_arg (p, arg); ++ p = extract_arg (p, arg, sizeof (arg)); + *condition = panel && regexp_match (arg, panel->dir.list [panel->selected].fname, match_file); + break; + case 'y': /* syntax pattern */ + if (edit_widget && edit_widget->syntax_type) { +- p = extract_arg (p, arg); ++ p = extract_arg (p, arg, sizeof (arg)); + *condition = panel && + regexp_match (arg, edit_widget->syntax_type, match_normal); + } + break; + case 'd': +- p = extract_arg (p, arg); ++ p = extract_arg (p, arg, sizeof (arg)); + *condition = panel && regexp_match (arg, panel->cwd, match_file); + break; + case 't': +- p = extract_arg (p, arg); ++ p = extract_arg (p, arg, sizeof (arg)); + *condition = panel && test_type (panel, arg); + break; + case 'x': /* executable */ + { + struct stat status; + +- p = extract_arg (p, arg); ++ p = extract_arg (p, arg, sizeof (arg)); + if (stat (arg, &status) == 0) + *condition = is_exe (status.st_mode); + else +@@ -431,50 +428,43 @@ + static void + debug_out (char *start, char *end, int cond) + { +- static char msg [256]; ++ static char *msg; + int len; + + if (start == NULL && end == NULL){ +- if (cond == 0){ +- /* Init */ +- msg [0] = 0; +- } else { +- /* Show output */ +- if (!debug_flag) +- return; ++ /* Show output */ ++ if (debug_flag && msg) { + len = strlen (msg); + if (len) + msg [len - 1] = 0; + message (0, _(" Debug "), "%s", msg); +- debug_flag = 0; + } ++ debug_flag = 0; ++ g_free (msg); ++ msg = NULL; + } else { ++ char *type, *p; ++ + /* Save debug info for later output */ + if (!debug_flag) + return; + /* Save the result of the condition */ + if (debug_error){ +- strcat (msg, _(" ERROR: ")); ++ type = _(" ERROR: "); + debug_error = 0; + } + else if (cond) +- strcat (msg, _(" True: ")); ++ type = _(" True: "); + else +- strcat (msg, _(" False: ")); +- /* Copy condition statement */ +- len = strlen (msg); +- if (end == NULL){ +- /* Copy one character */ +- msg [len] = *start; +- msg [len + 1] = 0; +- } else { +- /* Copy many characters */ +- while (start < end){ +- msg [len++] = *start++; +- } +- msg [len] = 0; +- } +- strcat (msg, " \n"); ++ type = _(" False: "); ++ /* This is for debugging, don't need to be super efficient. */ ++ if (end == NULL) ++ p = g_strdup_printf ("%s%s%c \n", msg ? msg : "", type, *start); ++ else ++ p = g_strdup_printf ("%s%s%.*s \n", msg ? msg : "", type, ++ (int) (end - start), start); ++ g_free (msg); ++ msg = p; + } + } + +@@ -486,8 +476,6 @@ + char operator; + char *debug_start, *debug_end; + +- /* Init debugger */ +- debug_out (NULL, NULL, 0); + /* Repeat till end of line */ + while (*p && *p != '\n') { + /* support quote space .mnu */ +@@ -578,6 +566,8 @@ + break; + while (*commands == ' ' || *commands == '\t') + commands++; ++ if (*commands == '0') ++ break; + } + col++; + if (*commands == '\n') +@@ -734,7 +724,7 @@ + } else if (*p == '+'){ + if (*(p+1) == '='){ + /* Combined adding and default */ +- p = test_line (edit_widget, p, &accept_entry); ++ p = test_line (edit_widget, p + 1, &accept_entry); + if (selected == 0 && accept_entry) + selected = menu_lines; + } else { +@@ -744,7 +734,7 @@ + } else if (*p == '='){ + if (*(p+1) == '+'){ + /* Combined adding and default */ +- p = test_line (edit_widget, p, &accept_entry); ++ p = test_line (edit_widget, p + 1, &accept_entry); + if (selected == 0 && accept_entry) + selected = menu_lines; + } else { diff --git a/misc/mc/files/patch-src-util.c b/misc/mc/files/patch-src-util.c new file mode 100644 index 000000000000..b45eb0239144 --- /dev/null +++ b/misc/mc/files/patch-src-util.c @@ -0,0 +1,29 @@ +--- src/util.c.orig Wed Jan 29 04:58:23 2003 ++++ src/util.c Tue Jun 15 03:15:09 2004 +@@ -498,7 +498,7 @@ + char *new_pattern; + int was_wildcard = 0; + +- if (easy_patterns){ ++ if ((match_type != match_regex) && easy_patterns){ + new_pattern = g_malloc (MC_MAXPATHLEN); + d = new_pattern; + if (match_type == match_file) +@@ -848,7 +848,7 @@ + return NULL; + } + +- strncpy (buffer, p, len); ++ memcpy (buffer, p, len); + g_free (p); + + return buffer; +@@ -1063,7 +1063,7 @@ + if (!S_ISLNK (mybuf.st_mode)) + strcpy (r, p + 1); + else { +- len = mc_readlink (path, buf2, MC_MAXPATHLEN); ++ len = mc_readlink (path, buf2, MC_MAXPATHLEN - 1); + if (len < 0) { + g_free (buf); + g_free (buf2); diff --git a/misc/mc/files/patch-src-util.h b/misc/mc/files/patch-src-util.h new file mode 100644 index 000000000000..9d3ca4ba75ee --- /dev/null +++ b/misc/mc/files/patch-src-util.h @@ -0,0 +1,11 @@ +--- src/util.h.orig Tue Jan 28 03:07:29 2003 ++++ src/util.h Tue Jun 15 03:15:09 2004 +@@ -62,7 +62,7 @@ + #define icase_search(T,D) _icase_search((T), (D), NULL) + + /* Matching */ +-enum { match_file, match_normal }; ++enum { match_file, match_normal, match_regex }; + extern int easy_patterns; + char *convert_pattern (char *pattern, int match_type, int do_group); + int regexp_match (char *pattern, char *string, int match_type); diff --git a/misc/mc/files/patch-src-utilunix.c b/misc/mc/files/patch-src-utilunix.c new file mode 100644 index 000000000000..f0e2e2349174 --- /dev/null +++ b/misc/mc/files/patch-src-utilunix.c @@ -0,0 +1,40 @@ +--- src/utilunix.c.orig Thu Dec 26 20:47:46 2002 ++++ src/utilunix.c Tue Jun 15 03:15:09 2004 +@@ -280,9 +280,7 @@ + if (!p){ + passwd = getpwnam (directory); + } else { +- name = g_malloc (p - directory + 1); +- strncpy (name, directory, p - directory); +- name [p - directory] = 0; ++ name = g_strndup (directory, p - directory); + passwd = getpwnam (name); + g_free (name); + } +@@ -298,7 +296,7 @@ + + /* + * Return the directory where mc should keep its temporary files. +- * This directory is (in Bourne shell terms) "${TMPDIR=/tmp}-$USER" ++ * This directory is (in Bourne shell terms) "${TMPDIR=/tmp}/mc-$USER" + * When called the first time, the directory is created if needed. + * The first call should be done early, since we are using fprintf() + * and not message() to report possible problems. +@@ -372,6 +370,7 @@ + if (fallback_ok) { + fprintf (stderr, _("Temporary files will be created in %s\n"), + sys_tmp); ++ error = NULL; + } else { + fprintf (stderr, _("Temporary files will not be created\n")); + tmpdir = "/dev/null/"; +@@ -380,6 +379,9 @@ + fprintf (stderr, "%s\n", _("Press any key to continue...")); + getc (stdin); + } ++ ++ if (!error) ++ setenv ("MC_TMPDIR", tmpdir, 1); + + return tmpdir; + } diff --git a/misc/mc/files/patch-src-view.c b/misc/mc/files/patch-src-view.c new file mode 100644 index 000000000000..1556a9862f98 --- /dev/null +++ b/misc/mc/files/patch-src-view.c @@ -0,0 +1,116 @@ +--- src/view.c.orig Fri Dec 27 12:48:33 2002 ++++ src/view.c Tue Jun 15 03:15:09 2004 +@@ -74,6 +74,10 @@ + # define IFAIX(x) + #endif + ++#if GLIB_MAJOR_VERSION < 2 ++# define g_try_malloc g_malloc ++#endif ++ + #define vwidth (view->widget.cols - (view->have_frame ? 2 : 0)) + #define vheight (view->widget.lines - (view->have_frame ? 2 : 0)) + +@@ -308,7 +312,7 @@ + view->block_ptr = g_realloc (view->block_ptr, + sizeof (block_ptr_t) * page); + for (i = view->blocks; i < page; i++) { +- char *p = g_malloc (VIEW_PAGE_SIZE); ++ char *p = g_try_malloc (VIEW_PAGE_SIZE); + view->block_ptr[i].data = p; + if (!p) + return '\n'; +@@ -336,7 +340,7 @@ + } + view->blocks = page; + } +- if (byte_index > view->bytes_read) { ++ if (byte_index >= view->bytes_read) { + return -1; + } else + return view->block_ptr[page - 1].data[offset]; +@@ -573,9 +577,11 @@ + return init_growing_view (view, 0, view->filename); + } + #ifdef HAVE_MMAP +- view->data = +- mc_mmap (0, view->s.st_size, PROT_READ, MAP_FILE | MAP_SHARED, +- view->file, 0); ++ if ((size_t) view->s.st_size == view->s.st_size) ++ view->data = mc_mmap (0, view->s.st_size, PROT_READ, ++ MAP_FILE | MAP_SHARED, view->file, 0); ++ else ++ view->data = (caddr_t) -1; + if ((caddr_t) view->data != (caddr_t) - 1) { + /* mmap worked */ + view->first = 0; +@@ -589,7 +595,11 @@ + * file into memory (alex@bcs.zaporizhzhe.ua). Also, mmap can fail + * for any reason, so we use this as fallback (pavel@ucw.cz) */ + +- view->data = (unsigned char *) g_malloc (view->s.st_size); ++ if ((gulong) view->s.st_size == view->s.st_size) ++ view->data = (unsigned char *) g_try_malloc (view->s.st_size); ++ else ++ view->data = NULL; ++ + if (view->data == NULL + || mc_lseek (view->file, 0, SEEK_SET) != 0 + || mc_read (view->file, view->data, +@@ -821,7 +831,7 @@ + if (w > 46) { + widget_move (view, view->have_frame, 24 + view->have_frame); + if (view->hex_mode) +- printw (_("Offset 0x%08x"), view->edit_cursor); ++ printw (_("Offset 0x%08lx"), view->edit_cursor); + else + printw (_("Col %d"), -view->start_col); + } +@@ -1513,33 +1523,41 @@ + long i = 0; + int prev = 0; + ++ if (!pos && direction == -1) ++ return 0; ++ + /* skip over all the possible zeros in the file */ + while ((ch = get_byte (view, pos)) == 0) { ++ if (!pos && direction == -1) ++ return 0; + pos += direction; + i++; + } + *skipped = i; + +- if (pos) { +- prev = get_byte (view, pos - 1); ++ if (!i && (pos || direction == -1)) { ++ prev = get_byte (view, pos - direction); + if ((prev == -1) || (prev == '\n')) + prev = 0; + } + +- for (i = 0; ch != -1; ch = get_byte (view, pos)) { ++ for (i = 1; ch != -1; ch = get_byte (view, pos)) { + +- if (i == usable_size) { ++ if (i >= usable_size) { + buffer = grow_string_buffer (buffer, &buffer_size); + usable_size = buffer_size - 2; + } + ++ buffer[i++] = ch; ++ if (!pos && direction == -1) ++ break; ++ + pos += direction; +- i++; + + if (ch == '\n' || !ch) { ++ i--; + break; + } +- buffer[i] = ch; + } + if (buffer) { + buffer[0] = prev; diff --git a/misc/mc/files/patch-src-widget.c b/misc/mc/files/patch-src-widget.c new file mode 100644 index 000000000000..578da4fcbff5 --- /dev/null +++ b/misc/mc/files/patch-src-widget.c @@ -0,0 +1,24 @@ +--- src/widget.c.orig Thu Dec 26 05:15:48 2002 ++++ src/widget.c Tue Jun 15 03:15:09 2004 +@@ -607,7 +607,7 @@ + if (!g->shown) + printw ("%*s", gauge_len, ""); + else { +- long percentage, columns; ++ int percentage, columns; + long total = g->max, done = g->current; + + if (total <= 0 || done < 0) { +@@ -1255,10 +1255,11 @@ + { + int first = min (x_first, x_last); + int last = max (x_first, x_last); ++ size_t len = strlen (&in->buffer [last]) + 1; + + in->point = first; + in->mark = first; +- strcpy (&in->buffer [first], &in->buffer [last]); ++ memmove (&in->buffer [first], &in->buffer [last], len); + in->need_push = 1; + } + diff --git a/misc/mc/files/patch-src-wtools.c b/misc/mc/files/patch-src-wtools.c new file mode 100644 index 000000000000..4a85fdde2e52 --- /dev/null +++ b/misc/mc/files/patch-src-wtools.c @@ -0,0 +1,12 @@ +--- src/wtools.c.orig Thu Nov 14 13:25:19 2002 ++++ src/wtools.c Tue Jun 15 03:15:09 2004 +@@ -412,8 +412,7 @@ + /* we need a unique name for tkname because widget.c:history_tool() + needs a unique name for each dialog - using the header is ideal */ + +- strncpy (tk_name + 3, header, 60); +- tk_name[63] = '\0'; ++ g_strlcpy (tk_name + 3, header, 61); + quick_widgets[2].tkname = tk_name; + + len = max (strlen (header), msglen (text, &lines)) + 4; diff --git a/misc/mc/files/patch-src::subshell.c b/misc/mc/files/patch-src::subshell.c deleted file mode 100644 index 9a8ced756e80..000000000000 --- a/misc/mc/files/patch-src::subshell.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/subshell.c.orig Tue Jul 15 20:36:24 2003 -+++ src/subshell.c Tue Jul 15 20:36:56 2003 -@@ -1166,6 +1166,8 @@ - #elif IS_AIX - strcpy (pty_name, "/dev/ptc"); - pty_master = open (pty_name, O_RDWR); -+#elif defined(__FreeBSD__) -+ pty_master = posix_openpt(O_RDWR); - #else - strcpy (pty_name, "/dev/ptmx"); - pty_master = open (pty_name, O_RDWR); diff --git a/misc/mc/files/patch-vfs-cpio.c b/misc/mc/files/patch-vfs-cpio.c new file mode 100644 index 000000000000..cf7b72b1beea --- /dev/null +++ b/misc/mc/files/patch-vfs-cpio.c @@ -0,0 +1,141 @@ +--- vfs/cpio.c.orig Sun Dec 8 07:12:28 2002 ++++ vfs/cpio.c Tue Jun 15 03:15:09 2004 +@@ -103,9 +103,9 @@ + + static struct defer_inode * defer_find(struct defer_inode *l, struct defer_inode *i) + { +- if(!l) return NULL; +- return l->inumber == i->inumber && l->device == i->device ? l : +- defer_find(l->next, i); ++ while (l && (l->inumber != i->inumber || l->device != i->device)) ++ l = l->next; ++ return l; + } + + static int cpio_skip_padding(vfs_s_super *super) +@@ -127,8 +127,14 @@ + + static void cpio_free_archive(vfs *me, vfs_s_super *super) + { ++ struct defer_inode *l, *lnext; + if(super->u.cpio.fd != -1) +- mc_close(super->u.cpio.fd); ++ mc_close(super->u.cpio.fd), super->u.cpio.fd = -1; ++ for (l = super->u.cpio.defered; l; l = lnext) { ++ lnext = l->next; ++ g_free (l); ++ } ++ super->u.cpio.defered = NULL; + } + + static int cpio_open_cpio_file(vfs *me, vfs_s_super *super, char *name) +@@ -246,26 +252,34 @@ + #define HEAD_LENGTH (26) + static int cpio_read_bin_head(vfs *me, vfs_s_super *super) + { +- struct old_cpio_header buf; ++ union { ++ struct old_cpio_header buf; ++ short shorts[HEAD_LENGTH >> 1]; ++ } u; + int len; + char *name; + struct stat stat; + +- if((len = mc_read(super->u.cpio.fd, (char *)&buf, HEAD_LENGTH)) < HEAD_LENGTH) ++ if((len = mc_read(super->u.cpio.fd, (char *)&u.buf, HEAD_LENGTH)) < HEAD_LENGTH) + return STATUS_EOF; + CPIO_POS(super) += len; + if(super->u.cpio.type == CPIO_BINRE) { + int i; + for(i = 0; i < (HEAD_LENGTH >> 1); i++) +- ((short *)&buf)[i] = GUINT16_SWAP_LE_BE(((short *)&buf)[i]); ++ u.shorts[i] = GUINT16_SWAP_LE_BE(u.shorts[i]); + } +- g_assert(buf.c_magic == 070707); ++ g_assert(u.buf.c_magic == 070707); + +- name = g_malloc(buf.c_namesize); +- if((len = mc_read(super->u.cpio.fd, name, buf.c_namesize)) < buf.c_namesize){ ++ if (u.buf.c_namesize == 0 || u.buf.c_namesize > MC_MAXPATHLEN) { ++ message (1, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"), super->name); ++ return STATUS_FAIL; ++ } ++ name = g_malloc(u.buf.c_namesize); ++ if((len = mc_read(super->u.cpio.fd, name, u.buf.c_namesize)) < u.buf.c_namesize){ + g_free(name); + return STATUS_EOF; + } ++ name[u.buf.c_namesize - 1] = '\0'; + CPIO_POS(super) += len; + cpio_skip_padding(super); + +@@ -274,15 +288,15 @@ + return STATUS_TRAIL; + } + +- stat.st_dev = buf.c_dev; +- stat.st_ino = buf.c_ino; +- stat.st_mode = buf.c_mode; +- stat.st_nlink = buf.c_nlink; +- stat.st_uid = buf.c_uid; +- stat.st_gid = buf.c_gid; +- stat.st_rdev = buf.c_rdev; +- stat.st_size = (buf.c_filesizes[0] << 16) | buf.c_filesizes[1]; +- stat.st_atime = stat.st_mtime = stat.st_ctime = (buf.c_mtimes[0] << 16) | buf.c_mtimes[1]; ++ stat.st_dev = u.buf.c_dev; ++ stat.st_ino = u.buf.c_ino; ++ stat.st_mode = u.buf.c_mode; ++ stat.st_nlink = u.buf.c_nlink; ++ stat.st_uid = u.buf.c_uid; ++ stat.st_gid = u.buf.c_gid; ++ stat.st_rdev = u.buf.c_rdev; ++ stat.st_size = (u.buf.c_filesizes[0] << 16) | u.buf.c_filesizes[1]; ++ stat.st_atime = stat.st_mtime = stat.st_ctime = (u.buf.c_mtimes[0] << 16) | u.buf.c_mtimes[1]; + + return cpio_create_entry(me, super, &stat, name); + } +@@ -310,11 +324,16 @@ + return STATUS_FAIL; + } + ++ if (hd.c_namesize == 0 || hd.c_namesize > MC_MAXPATHLEN) { ++ message (1, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"), super->name); ++ return STATUS_FAIL; ++ } + name = g_malloc(hd.c_namesize); + if((len = mc_read(super->u.cpio.fd, name, hd.c_namesize)) < hd.c_namesize) { + g_free (name); + return STATUS_EOF; + } ++ name[hd.c_namesize - 1] = '\0'; + CPIO_POS(super) += len; + cpio_skip_padding(super); + +@@ -365,11 +384,16 @@ + (super->u.cpio.type == CPIO_CRC && hd.c_magic != 070702)) + return STATUS_FAIL; + ++ if (hd.c_namesize == 0 || hd.c_namesize > MC_MAXPATHLEN) { ++ message (1, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"), super->name); ++ return STATUS_FAIL; ++ } + name = g_malloc(hd.c_namesize); + if((len = mc_read(super->u.cpio.fd, name, hd.c_namesize)) < hd.c_namesize){ + g_free (name); + return STATUS_EOF; + } ++ name[hd.c_namesize - 1] = '\0'; + CPIO_POS(super) += len; + cpio_skip_padding(super); + +@@ -430,7 +454,8 @@ + message_3s(1, MSG_ERROR, _("Inconsistent hardlinks of\n%s\nin cpio archive\n%s"), + name, super->name); + inode = NULL; +- } ++ } else if (!inode->st.st_size) ++ inode->st.st_size = stat->st_size; + } + } + diff --git a/misc/mc/files/patch-vfs-direntry.c b/misc/mc/files/patch-vfs-direntry.c new file mode 100644 index 000000000000..8b8c7b7ed7c5 --- /dev/null +++ b/misc/mc/files/patch-vfs-direntry.c @@ -0,0 +1,102 @@ +--- vfs/direntry.c.orig Thu Dec 26 08:21:43 2002 ++++ vfs/direntry.c Tue Jun 15 03:15:09 2004 +@@ -217,13 +217,11 @@ + vfs_s_entry * + vfs_s_find_entry_tree (vfs *me, vfs_s_inode *root, char *path, int follow, int flags) + { +- unsigned int pseg; ++ size_t pseg; + vfs_s_entry *ent = NULL; +- char p[MC_MAXPATHLEN] = ""; ++ char p[MC_MAXPATHLEN] = "", *t = p; + + while (root){ +- int t; +- + while (*path == PATH_SEP) /* Strip leading '/' */ + path++; + +@@ -233,9 +231,14 @@ + for (pseg = 0; path[pseg] && path[pseg] != PATH_SEP; pseg++) + ; + +- strcat (p, PATH_SEP_STR); +- strncpy (p + (t = strlen (p)), path, pseg); +- p[t + pseg] = '\0'; ++ if (t + pseg + sizeof (PATH_SEP_STR) > p + sizeof (p)) ++ ERRNOR (ENOMEM, NULL); ++ ++ memcpy (t, PATH_SEP_STR, sizeof (PATH_SEP_STR) - 1); ++ t += sizeof (PATH_SEP_STR) - 1; ++ memcpy (t, path, pseg); ++ t += pseg; ++ *t = '\0'; + + for (ent = root->subdir; ent != NULL; ent = ent->next) + if (strlen (ent->name) == pseg && (!strncmp (ent->name, path, pseg))) +@@ -375,21 +378,31 @@ + + /* Convert absolute paths to relative ones */ + if (*linkname == PATH_SEP) { +- char *p, *q; ++ char *p, *q, *r, *end; + + for (p = path, q = entry->ino->linkname; *p == *q; p++, q++); + while (*(--q) != PATH_SEP); + q++; ++ r = buf; ++ end = buf + MC_MAXPATHLEN; + for (;; p++) { + p = strchr (p, PATH_SEP); + if (!p) { +- strcat (buf, q); ++ size_t len = strlen (q); ++ ++ if (r + len >= end) ++ break; ++ ++ memcpy (r, q, len + 1); ++ linkname = buf; + break; + } +- strcat (buf, ".."); +- strcat (buf, PATH_SEP_STR); ++ ++ if (r + sizeof (".." PATH_SEP_STR) > end) ++ break; ++ memcpy (r, ".." PATH_SEP_STR, sizeof (".." PATH_SEP_STR) - 1); ++ r += sizeof (".." PATH_SEP_STR) - 1; + } +- linkname = buf; + } + + return (MEDATA->find_entry) (me, entry->dir, linkname, follow - 1, 0); +@@ -622,8 +635,7 @@ + return NULL; + + if (info->cur->name) { +- strncpy(dir.dent.d_name, info->cur->name, MC_MAXPATHLEN); +- dir.dent.d_name[MC_MAXPATHLEN] = 0; ++ g_strlcpy(dir.dent.d_name, info->cur->name, MC_MAXPATHLEN); + } else { + vfs_die("Null in structure-cannot happen"); + } +@@ -729,8 +741,7 @@ + if (ino->linkname == NULL) + ERRNOR (EFAULT, -1); + +- strncpy (buf, ino->linkname, size); +- *(buf+size-1) = 0; ++ g_strlcpy (buf, ino->linkname, size); + return strlen (buf); + } + +@@ -1037,7 +1048,7 @@ + struct vfs_s_inode *ino; + char buf[MC_MAXPATHLEN]; + +- strncpy (buf, path, MC_MAXPATHLEN); ++ g_strlcpy (buf, path, MC_MAXPATHLEN); + ino = vfs_s_inode_from_path (me, path, FL_FOLLOW | FL_NONE); + + if (!ino->localname) diff --git a/misc/mc/files/patch-vfs-extfs b/misc/mc/files/patch-vfs-extfs new file mode 100644 index 000000000000..3712d74eae7e --- /dev/null +++ b/misc/mc/files/patch-vfs-extfs @@ -0,0 +1,351 @@ +--- vfs/extfs/deb.in.orig Thu Dec 12 02:57:00 2002 ++++ vfs/extfs/deb.in Tue Jun 15 03:15:09 2004 +@@ -149,15 +149,10 @@ + } + else + { +- $suffix = "aaa"; +- while (1) { +- $tmpdir = "/tmp/mcdebfs.run".$$.$suffix; +- last if mkdir $tmpdir, 0700; +- $suffix++; +- # Somebody is being really nasty, give up +- exit 1 if $suffix eq "zzz"; +- } +- ++ use File::Temp qw(mkdtemp); ++ my $template = "/tmp/mcdebfs.run.XXXXXX"; ++ $template="$ENV{MC_TMPDIR}/mcdebfs.XXXXXX" if ($ENV{MC_TMPDIR}); ++ $tmpdir = mkdtemp($template); + $tmpcmd="$tmpdir/run"; + &mcdebfs_copyout($archive, $filename, $tmpcmd); + system("chmod u+x $tmpcmd"); +--- vfs/extfs/rpm.orig Sun Dec 29 15:19:39 2002 ++++ vfs/extfs/rpm Tue Jun 15 03:25:41 2004 +@@ -1,14 +1,17 @@ + #! /bin/sh + # + # Written by Erik Troan (ewt@redhat.com) 1996 +-# Jakub Jelinek (jj@sunsite.mff.cuni.cz) 1996 ++# Jakub Jelinek (jj@sunsite.mff.cuni.cz) 1996, 2004 + # Tomasz Kłoczko (kloczek@rudy.mif.pg.gda.pl) 1997 + # minor changes by Wojtek Pilorz (wpilorz@bdk.lublin.pl) 1997 + # minor changes by Michele Marziani (marziani@fe.infn.it) 1997 + # bug files by Marc Merlin (marcsoft@merlins.org) 1998 + # locale bugfix by Michal Svec (rebel@penguin.cz) 2000 +-# (C) 1996 The Free Software Foundation. ++# Whitespace(s) & single quote(s) in filename workaround ++# by Andrew V. Samoilov <sav@bcs.zp.ua> 2004 ++# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=64007 + # ++# (C) 1996-2004 The Free Software Foundation. + # + + # override any locale for dates +@@ -22,6 +25,10 @@ + RPM="rpm" + fi + RPM2CPIO="rpm2cpio" ++SED=sed ++# Surround the whole filename with single quotes and handle specially ++# \', ' and \ at the end of the string. ++SEDCMD="s/\\(\\\\\\?\\)'/'\\1\\1\\\\''/g;s/\\\\\$/'\\\\\\\\'/;s/^/'/;s/\$/'/" + + mcrpmfs_list () + { +@@ -31,12 +38,13 @@ + if test -z "$MCFASTRPM"; then + MCFASTRPM=$MCFASTRPM_DFLT + fi ++ f="`echo "$1" | $SED "$SEDCMD"`" + FILEPREF="-r--r--r-- 1 root root " +- DESC=`$RPM -qip "$1" 2>/dev/null` || { ++ DESC=`$RPM -qip "$f" 2>/dev/null` || { + echo "$FILEPREF 0 "`date +"%b %d %H:%M"`" ERROR" + exit 1 + } +- DATE=`$RPM -qp --qf "%{BUILDTIME:date}\n" "$1" | cut -c 5-11,21-24` ++ DATE=`$RPM -qp --qf "%{BUILDTIME:date}\n" "$f" | cut -c 5-11,21-24` + HEADERSIZE=`echo "$DESC" | wc -c` + echo "-r--r--r-- 1 root root $HEADERSIZE $DATE HEADER" + echo "-r-xr-xr-x 1 root root 39 $DATE INSTALL" +@@ -47,25 +55,25 @@ + echo "$FILEPREF 0 $DATE INFO/BUILDHOST" + echo "$FILEPREF 0 $DATE INFO/SOURCERPM" + if test "$MCFASTRPM" = 0 ; then +- test "`$RPM -qp --qf \"%{DISTRIBUTION}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{DISTRIBUTION}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/DISTRIBUTION" +- test "`$RPM -qp --qf \"%{VENDOR}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{VENDOR}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/VENDOR" +- test "`$RPM -qp --qf \"%{DESCRIPTION}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{DESCRIPTION}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/DESCRIPTION" +- test "`$RPM -qp --qf \"%{SUMMARY}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{SUMMARY}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/SUMMARY" +- if test "`$RPM -qp --qf \"%{RPMTAG_PREIN}%{RPMTAG_POSTIN}%{RPMTAG_PREUN}%{RPMTAG_POSTUN}%{VERIFYSCRIPT}\" \"$1\"`" != "(none)(none)(none)(none)(none)"; then ++ if test "`$RPM -qp --qf \"%{RPMTAG_PREIN}%{RPMTAG_POSTIN}%{RPMTAG_PREUN}%{RPMTAG_POSTUN}%{VERIFYSCRIPT}\" \"$f\"`" != "(none)(none)(none)(none)(none)"; then + echo "dr-xr-xr-x 1 root root 0 $DATE INFO/SCRIPTS" +- test "`$RPM -qp --qf \"%{RPMTAG_PREIN}\" \"$1\"`" = '(none)' || ++ test "`$RPM -qp --qf \"%{RPMTAG_PREIN}\" \"$f\"`" = '(none)' || + echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREIN" +- test "`$RPM -qp --qf \"%{RPMTAG_POSTIN}\" \"$1\"`" = '(none)' || ++ test "`$RPM -qp --qf \"%{RPMTAG_POSTIN}\" \"$f\"`" = '(none)' || + echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTIN" +- test "`$RPM -qp --qf \"%{RPMTAG_PREUN}\" \"$1\"`" = '(none)' || ++ test "`$RPM -qp --qf \"%{RPMTAG_PREUN}\" \"$f\"`" = '(none)' || + echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREUN" +- test "`$RPM -qp --qf \"%{RPMTAG_POSTUN}\" \"$1\"`" = '(none)' || ++ test "`$RPM -qp --qf \"%{RPMTAG_POSTUN}\" \"$f\"`" = '(none)' || + echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTUN" +- test "`$RPM -qp --qf \"%{VERIFYSCRIPT}\" \"$1\"`" = '(none)' || ++ test "`$RPM -qp --qf \"%{VERIFYSCRIPT}\" \"$f\"`" = '(none)' || + echo "$FILEPREF 0 $DATE INFO/SCRIPTS/VERIFYSCRIPT" + echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL" + fi +@@ -83,15 +91,15 @@ + echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL" + fi + if test "$MCFASTRPM" = 0 ; then +- test "`$RPM -qp --qf \"%{PACKAGER}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{PACKAGER}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/PACKAGER" +- test "`$RPM -qp --qf \"%{URL}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{URL}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/URL" +- test "`$RPM -qp --qf \"%{SERIAL}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{SERIAL}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/SERIAL" +- test "`$RPM -qp --qf \"%{COPYRIGHT}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{COPYRIGHT}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/COPYRIGHT" +- test "`$RPM -qp --qf \"%{LICENSE}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{LICENSE}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/LICENSE" + else + echo "$FILEPREF 0 $DATE INFO/PACKAGER" +@@ -105,13 +113,13 @@ + echo "$FILEPREF 0 $DATE INFO/OS" + echo "$FILEPREF 0 $DATE INFO/SIZE" + if test "$MCFASTRPM" != 0 ; then +- $RPM -qp --qf "[%{REQUIRENAME}\n]" "$1" | grep "(none)" > /dev/null || ++ $RPM -qp --qf "[%{REQUIRENAME}\n]" "$f" | grep "(none)" > /dev/null || + echo "$FILEPREF 0 $DATE INFO/REQUIRENAME" +- $RPM -qp --qf "[%{OBSOLETES}\n]" "$1" | grep "(none)" > /dev/null || ++ $RPM -qp --qf "[%{OBSOLETES}\n]" "$f" | grep "(none)" > /dev/null || + echo "$FILEPREF 0 $DATE INFO/OBSOLETES" +- $RPM -qp --qf "[%{PROVIDES}\n]" "$1" | grep "(none)" > /dev/null || ++ $RPM -qp --qf "[%{PROVIDES}\n]" "$f" | grep "(none)" > /dev/null || + echo "$FILEPREF 0 $DATE INFO/PROVIDES" +- test "`$RPM -qp --qf \"%{CHANGELOGTEXT}\" \"$1\"`" = "(none)" || ++ test "`$RPM -qp --qf \"%{CHANGELOGTEXT}\" \"$f\"`" = "(none)" || + echo "$FILEPREF 0 $DATE INFO/CHANGELOG" + else + echo "$FILEPREF 0 $DATE INFO/REQUIRENAME" +@@ -120,61 +128,55 @@ + echo "$FILEPREF 0 $DATE INFO/CHANGELOG" + fi + +- $RPM2CPIO "$1" | cpio -tv --quiet + echo "$FILEPREF 0 $DATE CONTENTS.cpio" + } + + mcrpmfs_copyout () + { ++ f="`echo "$1" | $SED "$SEDCMD"`" + case "$2" in +- HEADER) $RPM -qip "$1" > "$3"; exit 0;; ++ HEADER) $RPM -qip "$f" > "$3"; exit 0;; + INSTALL) echo "# Run this to install this RPM package" > "$3"; exit 0;; + UPGRADE) echo "# Run this to upgrade this RPM package" > "$3"; exit 0;; +- ERROR) $RPM -qip "$1" > /dev/null 2> "$3"; exit 0;; +- INFO/NAME-VERSION-RELEASE) $RPM -qp --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" "$1" > "$3"; exit 0;; +- INFO/RELEASE) $RPM -qp --qf "%{RELEASE}\n" "$1" > "$3"; exit 0;; +- INFO/GROUP) $RPM -qp --qf "%{GROUP}\n" "$1" > "$3"; exit 0;; +- INFO/DISTRIBUTION) $RPM -qp --qf "%{DISTRIBUTION}\n" "$1" > "$3"; exit 0;; +- INFO/VENDOR) $RPM -qp --qf "%{VENDOR}\n" "$1" > "$3"; exit 0;; +- INFO/BUILDHOST) $RPM -qp --qf "%{BUILDHOST}\n" "$1" > "$3"; exit 0;; +- INFO/SOURCERPM) $RPM -qp --qf "%{SOURCERPM}\n" "$1" > "$3"; exit 0;; +- INFO/DESCRIPTION) $RPM -qp --qf "%{DESCRIPTION}\n" "$1" > "$3"; exit 0;; +- INFO/PACKAGER) $RPM -qp --qf "%{PACKAGER}\n" "$1" > "$3"; exit 0;; +- INFO/URL) $RPM -qp --qf "%{URL}\n" "$1" >"$3"; exit 0;; +- INFO/BUILDTIME) $RPM -qp --qf "%{BUILDTIME:date}\n" "$1" >"$3"; exit 0;; +- INFO/SERIAL) $RPM -qp --qf "%{SERIAL}\n" "$1" >"$3"; exit 0;; +- INFO/COPYRIGHT) $RPM -qp --qf "%{COPYRIGHT}\n" "$1" >"$3"; exit 0;; +- INFO/RPMVERSION) $RPM -qp --qf "%{RPMVERSION}\n" "$1" >"$3"; exit 0;; +- INFO/REQUIRENAME) $RPM -qp --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" "$1" >"$3"; exit 0;; +- INFO/PROVIDES) $RPM -qp --qf "[%{PROVIDES}\n]" "$1" >"$3"; exit 0;; +- INFO/SCRIPTS/PREIN) $RPM -qp --qf "%{RPMTAG_PREIN}\n" "$1" >"$3"; exit 0;; +- INFO/SCRIPTS/POSTIN) $RPM -qp --qf "%{RPMTAG_POSTIN}\n" "$1" >"$3"; exit 0;; +- INFO/SCRIPTS/PREUN) $RPM -qp --qf "%{RPMTAG_PREUN}\n" "$1" >"$3"; exit 0;; +- INFO/SCRIPTS/POSTUN) $RPM -qp --qf "%{RPMTAG_POSTUN}\n" "$1" >"$3"; exit 0;; +- INFO/SCRIPTS/VERIFYSCRIPT) $RPM -qp --qf "%{VERIFYSCRIPT}\n" "$1" >"$3"; exit 0;; +- INFO/SCRIPTS/ALL) $RPM -qp --scripts "$1" > "$3"; exit 0;; +- INFO/SUMMARY) $RPM -qp --qf "%{SUMMARY}\n" "$1" > "$3"; exit 0;; +- INFO/OS) $RPM -qp --qf "%{OS}\n" "$1" > "$3"; exit 0;; +- INFO/CHANGELOG) $RPM -qp --qf "[* %{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]\n" "$1" > "$3"; exit 0;; +- INFO/SIZE) $RPM -qp --qf "%{SIZE} bytes\n" "$1" > "$3"; exit 0;; ++ ERROR) $RPM -qip "$f" > /dev/null 2> "$3"; exit 0;; ++ INFO/NAME-VERSION-RELEASE) $RPM -qp --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" "$f" > "$3"; exit 0;; ++ INFO/RELEASE) $RPM -qp --qf "%{RELEASE}\n" "$f" > "$3"; exit 0;; ++ INFO/GROUP) $RPM -qp --qf "%{GROUP}\n" "$f" > "$3"; exit 0;; ++ INFO/DISTRIBUTION) $RPM -qp --qf "%{DISTRIBUTION}\n" "$f" > "$3"; exit 0;; ++ INFO/VENDOR) $RPM -qp --qf "%{VENDOR}\n" "$f" > "$3"; exit 0;; ++ INFO/BUILDHOST) $RPM -qp --qf "%{BUILDHOST}\n" "$f" > "$3"; exit 0;; ++ INFO/SOURCERPM) $RPM -qp --qf "%{SOURCERPM}\n" "$f" > "$3"; exit 0;; ++ INFO/DESCRIPTION) $RPM -qp --qf "%{DESCRIPTION}\n" "$f" > "$3"; exit 0;; ++ INFO/PACKAGER) $RPM -qp --qf "%{PACKAGER}\n" "$f" > "$3"; exit 0;; ++ INFO/URL) $RPM -qp --qf "%{URL}\n" "$f" >"$3"; exit 0;; ++ INFO/BUILDTIME) $RPM -qp --qf "%{BUILDTIME:date}\n" "$f" >"$3"; exit 0;; ++ INFO/SERIAL) $RPM -qp --qf "%{SERIAL}\n" "$f" >"$3"; exit 0;; ++ INFO/COPYRIGHT) $RPM -qp --qf "%{COPYRIGHT}\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/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;; ++ INFO/SCRIPTS/PREUN) $RPM -qp --qf "%{RPMTAG_PREUN}\n" "$f" >"$3"; exit 0;; ++ INFO/SCRIPTS/POSTUN) $RPM -qp --qf "%{RPMTAG_POSTUN}\n" "$f" >"$3"; exit 0;; ++ INFO/SCRIPTS/VERIFYSCRIPT) $RPM -qp --qf "%{VERIFYSCRIPT}\n" "$f" >"$3"; exit 0;; ++ INFO/SCRIPTS/ALL) $RPM -qp --scripts "$f" > "$3"; exit 0;; ++ INFO/SUMMARY) $RPM -qp --qf "%{SUMMARY}\n" "$f" > "$3"; exit 0;; ++ INFO/OS) $RPM -qp --qf "%{OS}\n" "$f" > "$3"; exit 0;; ++ INFO/CHANGELOG) $RPM -qp --qf "[* %{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]\n" "$f" > "$3"; exit 0;; ++ INFO/SIZE) $RPM -qp --qf "%{SIZE} bytes\n" "$f" > "$3"; exit 0;; + CONTENTS.cpio) $RPM2CPIO "$1" > "$3"; exit 0;; + *) +- TMPDIR=/tmp/mctmpdir.$$ +- mkdir $TMPDIR || exit 1 +- cd $TMPDIR +- # Files in RPM version 4 and above start with "./" - try both +- $RPM2CPIO "$1" | cpio -iumd --quiet "$2" "./$2" >/dev/null +- mv "$2" "$3" 2>/dev/null +- cd / +- rm -rf $TMPDIR;; ++ ;; + esac + } + + mcrpmfs_run () + { ++ f="`echo "$1" | $SED "$SEDCMD"`" + case "$2" in +- INSTALL) echo "Installing \"$1\""; $RPM -ivh "$1"; exit 0;; +- UPGRADE) echo "Upgrading \"$1\""; $RPM -iUvh "$1"; exit 0;; ++ INSTALL) echo "Installing \"$1\""; $RPM -ivh "$f"; exit 0;; ++ UPGRADE) echo "Upgrading \"$1\""; $RPM -Uvh "$f"; exit 0;; + esac + } + +--- vfs/extfs/uar.in.orig Thu Dec 12 15:21:35 2002 ++++ vfs/extfs/uar.in Tue Jun 15 03:15:09 2004 +@@ -22,8 +22,7 @@ + + mcarfs_copyin () + { +- TMPDIR=/tmp/mctmpdir-uar.$$ +- mkdir $TMPDIR || exit 1 ++ TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uar.XXXXXX` || exit 1 + name=`basename "$2"` + (cd $TMPDIR && cp -fp "$3" $name && $XAR r "$1" $name) + rm -rf $TMPDIR +--- vfs/extfs/uha.in.orig Sat Dec 14 11:10:53 2002 ++++ vfs/extfs/uha.in Tue Jun 15 03:15:09 2004 +@@ -31,8 +31,7 @@ + + mchafs_copyout () + { +- TMPDIR="/tmp/mctmpdir-uha.$$" +- mkdir $TMPDIR || exit 1 ++ TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uha.XXXXXX` || exit 1 + cd $TMPDIR + + $HA xyq "$1" "$2" >/dev/null +--- vfs/extfs/ulha.in.orig Sat Dec 14 10:39:10 2002 ++++ vfs/extfs/ulha.in Tue Jun 15 03:15:09 2004 +@@ -35,12 +35,6 @@ + LHA_GET="lha pq" + LHA_PUT="lha aq" + +-# Define a directory to create a temporary file for when +-# running a command to be run from the archive +-TMPDIR="/tmp/mctmpdir-uha.$$" +-# Temporary file within the directory +-TMPCMD=$TMPDIR/run +- + # The 'list' command executive + + mc_lha_fs_list() +@@ -121,9 +115,9 @@ + + mc_lha_fs_run() + { ++ TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-ulha.XXXXXX` || exit 1 + trap "rm -rf $TMPDIR; exit 0" 1 2 3 4 15 +- # FIXME: Try harder to generate a unique directory if this fails +- mkdir -m 0700 $TMPDIR || exit 1 ++ TMPCMD=$TMPDIR/run + $LHA_GET "$1" "$2" > $TMPCMD + chmod a+x $TMPCMD + $TMPCMD +--- vfs/extfs/urar.in.orig Fri Jan 24 21:56:25 2003 ++++ vfs/extfs/urar.in Tue Jun 15 03:15:09 2004 +@@ -77,8 +77,7 @@ + # preserve pwd. It is clean, but is it necessary? + pwd=`pwd` + # Create a directory and create in it a tmp directory with the good name +- dir=tmpdir.${RANDOM} +- mkdir $dir ++ dir=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-urar.XXXXXX` || exit 1 + cd $dir + mkdir -p "$2" + # rar cannot create an empty directory +--- vfs/extfs/uzip.in.orig Thu Dec 12 15:15:20 2002 ++++ vfs/extfs/uzip.in Tue Jun 15 03:18:53 2004 +@@ -76,7 +76,7 @@ + sub mczipfs_rmdir { + my ($qfile) = map { &zipquotemeta($_) } @_; + &checkargs(1, 'archive directory', @_); +- &safesystem("$cmd_delete $qarchive $qfile/ >/dev/null", 12); ++ &safesystem("$cmd_delete $qarchive $qfile/ >/dev/null 2>&1", 12); + exit; + } + +@@ -87,7 +87,7 @@ + my ($qafile, $qfsfile) = map { &zipquotemeta($_) } @_; + &checkargs(1, 'archive file', @_); + &checkargs(2, 'local file', @_); +- &safesystem("$cmd_extract $qarchive $qafile > $qfsfile", 11); ++ &safesystem("$cmd_extract $qarchive $qafile > $qfsfile 2>/dev/null", 11); + exit; + } + +@@ -344,10 +344,10 @@ + + # Make a temporary directory with mode 0700. + sub mktmpdir { +- while (1) { +- my $dir = POSIX::tmpnam(); +- return $dir if mkdir ($dir, 0700); +- } ++ use File::Temp qw(mkdtemp); ++ my $template = "/tmp/mcuzipfs.XXXXXX"; ++ $template="$ENV{MC_TMPDIR}/mcuzipfs.XXXXXX" if ($ENV{MC_TMPDIR}); ++ return mkdtemp($template); + } + + # Make a filename absolute and return it. +--- vfs/extfs/uzoo.in.orig Sat Dec 14 10:29:13 2002 ++++ vfs/extfs/uzoo.in Tue Jun 15 03:15:09 2004 +@@ -13,8 +13,7 @@ + # it to a temporary directory. + mklink () + { +- TMPDIR="/tmp/mctmpdir-uzoo.$$" +- mkdir $TMPDIR || exit 1 ++ TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uzoo.XXXXXX` || exit 1 + trap 'cd /; rm -rf $TMPDIR' 0 1 2 3 5 13 15 + ARCHIVE=$TMPDIR/tmp.zoo + ln -sf "$1" "$ARCHIVE" diff --git a/misc/mc/files/patch-vfs-extfs.c b/misc/mc/files/patch-vfs-extfs.c new file mode 100644 index 000000000000..105d9d96f2c8 --- /dev/null +++ b/misc/mc/files/patch-vfs-extfs.c @@ -0,0 +1,26 @@ +--- vfs/extfs.c.orig Thu Dec 26 03:42:59 2002 ++++ vfs/extfs.c Tue Jun 15 03:15:09 2004 +@@ -888,8 +888,7 @@ + if (!*info) + return NULL; + +- strncpy(dir.dent.d_name, (*info)->name, MC_MAXPATHLEN); +- dir.dent.d_name[MC_MAXPATHLEN] = 0; ++ g_strlcpy(dir.dent.d_name, (*info)->name, MC_MAXPATHLEN); + + compute_namelen(&dir.dent); + *info = (*info)->next_in_dir; +@@ -1002,10 +1001,10 @@ + if (entry == NULL) + return -1; + if (!S_ISLNK (entry->inode->mode)) ERRNOR (EINVAL, -1); +- if (size > (i = strlen (entry->inode->linkname))) { +- size = i; ++ if (size < (i = strlen (entry->inode->linkname))) { ++ i = size; + } +- strncpy (buf, entry->inode->linkname, i); ++ memcpy (buf, entry->inode->linkname, i); + return i; + } + diff --git a/misc/mc/files/patch-vfs-fish.c b/misc/mc/files/patch-vfs-fish.c new file mode 100644 index 000000000000..634580bacce0 --- /dev/null +++ b/misc/mc/files/patch-vfs-fish.c @@ -0,0 +1,21 @@ +--- vfs/fish.c.orig Thu Dec 26 08:21:43 2002 ++++ vfs/fish.c Tue Jun 15 03:15:09 2004 +@@ -96,8 +96,7 @@ + if (strncmp(answer, "### ", 4)) { + was_garbage = 1; + if (string_buf) { +- strncpy(string_buf, answer, string_len - 1); +- *(string_buf + string_len - 1) = 0; ++ g_strlcpy(string_buf, answer, string_len); + } + } else return decode_reply(answer+4, was_garbage); + } +@@ -668,7 +667,7 @@ + { + int r; + +- r = command (me, super, WAIT_REPLY, cmd); ++ r = command (me, super, WAIT_REPLY, "%s", cmd); + vfs_add_noncurrent_stamps (&vfs_fish_ops, (vfsid) super, NULL); + if (r != COMPLETE) ERRNOR (E_REMOTE, -1); + if (flags & OPT_FLUSH) diff --git a/misc/mc/files/patch-vfs-ftpfs.c b/misc/mc/files/patch-vfs-ftpfs.c new file mode 100644 index 000000000000..bfd46fef3436 --- /dev/null +++ b/misc/mc/files/patch-vfs-ftpfs.c @@ -0,0 +1,131 @@ +--- vfs/ftpfs.c.orig Thu Dec 26 08:21:43 2002 ++++ vfs/ftpfs.c Tue Jun 15 03:15:09 2004 +@@ -266,8 +266,7 @@ + switch (sscanf(answer, "%d", &code)){ + case 0: + if (string_buf) { +- strncpy (string_buf, answer, string_len - 1); +- *(string_buf + string_len - 1) = 0; ++ g_strlcpy (string_buf, answer, string_len); + } + code = 500; + return 5; +@@ -286,8 +285,7 @@ + } + } + if (string_buf){ +- strncpy (string_buf, answer, string_len - 1); +- *(string_buf + string_len - 1) = 0; ++ g_strlcpy (string_buf, answer, string_len); + } + return code / 100; + } +@@ -321,28 +319,28 @@ + va_list ap; + char *str, *fmt_str; + int status; +- int sock = SUP.sock; ++ int cmdlen; + + va_start (ap, fmt); + fmt_str = g_strdup_vprintf (fmt, ap); + va_end (ap); + +- status = strlen (fmt_str); +- str = g_realloc (fmt_str, status + 3); +- strcpy (str + status, "\r\n"); ++ cmdlen = strlen (fmt_str); ++ str = g_realloc (fmt_str, cmdlen + 3); ++ strcpy (str + cmdlen, "\r\n"); + + if (logfile){ + if (strncmp (str, "PASS ", 5) == 0){ + fputs ("PASS <Password not logged>\r\n", logfile); + } else +- fwrite (str, status + 2, 1, logfile); ++ fwrite (str, cmdlen + 2, 1, logfile); + + fflush (logfile); + } + + got_sigpipe = 0; + enable_interrupt_key (); +- status = write (SUP.sock, str, status + 2); ++ status = write (SUP.sock, str, cmdlen + 2); + + if (status < 0){ + code = 421; +@@ -353,7 +351,7 @@ + level = 1; + status = reconnect (me, super); + level = 0; +- if (status && write (SUP.sock, str, status + 2) > 0) ++ if (status && write (SUP.sock, str, cmdlen + 2) > 0) + goto ok; + } + got_sigpipe = 1; +@@ -367,7 +365,7 @@ + disable_interrupt_key (); + + if (wait_reply) +- return get_reply (me, sock, (wait_reply & WANT_STRING) ? reply_str : NULL, sizeof (reply_str)-1); ++ return get_reply (me, SUP.sock, (wait_reply & WANT_STRING) ? reply_str : NULL, sizeof (reply_str)-1); + return COMPLETE; + } + +@@ -903,23 +901,29 @@ + int data, len = sizeof(data_addr); + struct protoent *pe; + +- getsockname(SUP.sock, (struct sockaddr *) &data_addr, &len); +- data_addr.sin_port = 0; +- + pe = getprotobyname("tcp"); + if (pe == NULL) + ERRNOR (EIO, -1); ++again: ++ if (getsockname(SUP.sock, (struct sockaddr *) &data_addr, &len) == -1) ++ ERRNOR (EIO, -1); ++ data_addr.sin_port = 0; ++ + data = socket (AF_INET, SOCK_STREAM, pe->p_proto); + if (data < 0) + ERRNOR (EIO, -1); + + if (SUP.use_passive_connection){ +- if ((SUP.use_passive_connection = setup_passive (me, super, data, &data_addr))) ++ if (setup_passive (me, super, data, &data_addr)) + return data; + + SUP.use_source_route = 0; + SUP.use_passive_connection = 0; + print_vfs_message (_("ftpfs: could not setup passive mode")); ++ ++ /* data or data_addr may be damaged by setup_passive */ ++ close (data); ++ goto again; + } + + /* If passive setup fails, fallback to active connections */ +@@ -971,11 +975,12 @@ + data = s; + else { + data = accept (s, (struct sockaddr *)&from, &fromlen); +- close(s); + if (data < 0) { + my_errno = errno; ++ close(s); + return -1; + } ++ close(s); + } + disable_interrupt_key(); + return data; +@@ -1019,6 +1024,7 @@ + gettimeofday (&tim, NULL); + if (tim.tv_sec > start_tim.tv_sec + ABORT_TIMEOUT) { + /* server keeps sending, drop the connection and reconnect */ ++ close (dsock); + reconnect (me, super); + return; + } diff --git a/misc/mc/files/patch-vfs-mcfs.c b/misc/mc/files/patch-vfs-mcfs.c new file mode 100644 index 000000000000..e5d41730432e --- /dev/null +++ b/misc/mc/files/patch-vfs-mcfs.c @@ -0,0 +1,27 @@ +--- vfs/mcfs.c.orig Fri Nov 15 13:49:39 2002 ++++ vfs/mcfs.c Tue Jun 15 03:15:09 2004 +@@ -756,8 +756,7 @@ + return NULL; + } + dirent_dest = mcfs_readdir_data.dent.d_name; +- strncpy (dirent_dest, mcfs_info->current->text, MC_MAXPATHLEN); +- dirent_dest[MC_MAXPATHLEN] = 0; ++ g_strlcpy (dirent_dest, mcfs_info->current->text, MC_MAXPATHLEN); + cached_lstat_info = &mcfs_info->current->my_stat; + mcfs_info->current = mcfs_info->current->next; + +@@ -985,9 +984,12 @@ + if (!rpc_get (mc->sock, RPC_STRING, &stat_str, RPC_END)) + return the_error (-1, EIO); + +- strncpy (buf, stat_str, size); ++ status = strlen (stat_str); ++ if (status < size) ++ size = status; ++ memcpy (buf, stat_str, size); + g_free (stat_str); +- return strlen (buf); ++ return size; + } + + static int diff --git a/misc/mc/files/patch-vfs-mcserv.c b/misc/mc/files/patch-vfs-mcserv.c new file mode 100644 index 000000000000..44e3fdd1b894 --- /dev/null +++ b/misc/mc/files/patch-vfs-mcserv.c @@ -0,0 +1,11 @@ +--- vfs/mcserv.c.orig Sun Dec 8 07:12:30 2002 ++++ vfs/mcserv.c Tue Jun 15 03:15:09 2004 +@@ -582,7 +582,7 @@ + int n; + + rpc_get (msock, RPC_STRING, &file, RPC_END); +- n = readlink (file, buffer, 2048); ++ n = readlink (file, buffer, 2048 - 1); + send_status (n, errno); + if (n >= 0) { + buffer[n] = 0; diff --git a/misc/mc/files/patch-vfs-names.c b/misc/mc/files/patch-vfs-names.c new file mode 100644 index 000000000000..36f0a1b66357 --- /dev/null +++ b/misc/mc/files/patch-vfs-names.c @@ -0,0 +1,28 @@ +--- vfs/names.c.orig Fri Nov 15 12:19:34 2002 ++++ vfs/names.c Tue Jun 15 03:15:09 2004 +@@ -31,6 +31,7 @@ + #include <stdio.h> + #include <pwd.h> + #include <grp.h> ++#include <glib.h> + + #include "names.h" + +@@ -59,7 +60,7 @@ + + if (uname[0] != saveuname[0] /* Quick test w/o proc call */ + ||0 != strncmp (uname, saveuname, TUNMLEN)) { +- strncpy (saveuname, uname, TUNMLEN); ++ g_strlcpy (saveuname, uname, TUNMLEN); + pw = getpwnam (uname); + if (pw) { + saveuid = pw->pw_uid; +@@ -77,7 +78,7 @@ + + if (gname[0] != savegname[0] /* Quick test w/o proc call */ + ||0 != strncmp (gname, savegname, TUNMLEN)) { +- strncpy (savegname, gname, TUNMLEN); ++ g_strlcpy (savegname, gname, TUNMLEN); + gr = getgrnam (gname); + if (gr) { + savegid = gr->gr_gid; diff --git a/misc/mc/files/patch-vfs-samba-lib-util.c b/misc/mc/files/patch-vfs-samba-lib-util.c new file mode 100644 index 000000000000..923fc1238e31 --- /dev/null +++ b/misc/mc/files/patch-vfs-samba-lib-util.c @@ -0,0 +1,35 @@ +--- vfs/samba/lib/util.c.orig Fri Nov 15 23:02:44 2002 ++++ vfs/samba/lib/util.c Tue Jun 15 03:15:09 2004 +@@ -114,7 +114,7 @@ + char *tmpdir(void) + { + char *p; +- if ((p = getenv("TMPDIR"))) { ++ if ((p = getenv("MC_TMPDIR")) || (p = getenv("TMPDIR"))) { + return p; + } + return "/tmp"; +@@ -1885,20 +1885,17 @@ + + char *nis_map = (char *)lp_nis_home_map_name(); + +- char nis_domain[NIS_MAXNAMELEN + 1]; + char buffer[NIS_MAXATTRVAL + 1]; + nis_result *result; + nis_object *object; + entry_obj *entry; + +- strncpy(nis_domain, (char *)nis_local_directory(), NIS_MAXNAMELEN); +- nis_domain[NIS_MAXNAMELEN] = '\0'; +- +- DEBUG(5, ("NIS+ Domain: %s\n", nis_domain)); ++ DEBUG(5, ("NIS+ Domain: %s\n", (char *)nis_local_directory())); + + if (strcmp(user_name, last_key)) + { +- slprintf(buffer, sizeof(buffer)-1, "[%s=%s]%s.%s", "key", user_name, nis_map, nis_domain); ++ slprintf(buffer, sizeof(buffer)-1, "[%s=%s]%s.%s", "key", user_name, nis_map, ++ (char *)nis_local_directory()); + DEBUG(5, ("NIS+ querystring: %s\n", buffer)); + + if (result = nis_list(buffer, RETURN_RESULT, NULL, NULL)) diff --git a/misc/mc/files/patch-vfs-smbfs.c b/misc/mc/files/patch-vfs-smbfs.c new file mode 100644 index 000000000000..181580c40480 --- /dev/null +++ b/misc/mc/files/patch-vfs-smbfs.c @@ -0,0 +1,12 @@ +--- vfs/smbfs.c.orig Sat Jan 25 03:37:29 2003 ++++ vfs/smbfs.c Tue Jun 15 03:15:09 2004 +@@ -785,8 +785,7 @@ + #endif + return NULL; + } +- strncpy(dirent_dest, smbfs_info->current->text, MC_MAXPATHLEN); +- dirent_dest[MC_MAXPATHLEN] = 0; ++ g_strlcpy(dirent_dest, smbfs_info->current->text, MC_MAXPATHLEN); + smbfs_info->current = smbfs_info->current->next; + + compute_namelen(&smbfs_readdir_data.dent); diff --git a/misc/mc/files/patch-vfs-tar.c b/misc/mc/files/patch-vfs-tar.c new file mode 100644 index 000000000000..bbaf9e109b84 --- /dev/null +++ b/misc/mc/files/patch-vfs-tar.c @@ -0,0 +1,49 @@ +--- vfs/tar.c.orig Sun Dec 8 07:12:30 2002 ++++ vfs/tar.c Tue Jun 15 03:15:09 2004 +@@ -264,19 +264,26 @@ + char *bp, *data; + int size, written; + ++ if (hstat.st_size > MC_MAXPATHLEN) { ++ message_1s (1, MSG_ERROR, _("Inconsistent tar archive")); ++ return STATUS_BADCHECKSUM; ++ } ++ + longp = ((header->header.linkflag == LF_LONGNAME) + ? &next_long_name + : &next_long_link); + + if (*longp) + g_free (*longp); +- bp = *longp = g_malloc (hstat.st_size); ++ bp = *longp = g_malloc (hstat.st_size + 1); + + for (size = hstat.st_size; + size > 0; + size -= written) { + data = get_next_record (archive, tard)->charptr; + if (data == NULL) { ++ g_free (*longp); ++ *longp = NULL; + message_1s (1, MSG_ERROR, _("Unexpected EOF on archive file")); + return STATUS_BADCHECKSUM; + } +@@ -287,10 +294,14 @@ + memcpy (bp, data, written); + bp += written; + } +-#if 0 +- if (hstat.st_size > 1) +- bp [hstat.st_size - 1] = 0; /* just to make sure */ +-#endif ++ ++ if (bp - *longp == MC_MAXPATHLEN && bp[-1] != '\0') { ++ g_free (*longp); ++ *longp = NULL; ++ message_1s (1, MSG_ERROR, _("Inconsistent tar archive")); ++ return STATUS_BADCHECKSUM; ++ } ++ *bp = 0; + goto recurse; + } else { + struct stat st; diff --git a/misc/mc/files/patch-vfs-vfs.c b/misc/mc/files/patch-vfs-vfs.c new file mode 100644 index 000000000000..e8e132ba3c5c --- /dev/null +++ b/misc/mc/files/patch-vfs-vfs.c @@ -0,0 +1,12 @@ +--- vfs/vfs.c.orig Thu Dec 26 08:21:43 2002 ++++ vfs/vfs.c Tue Jun 15 03:15:09 2004 +@@ -637,8 +637,7 @@ + { + const char *cwd = mc_return_cwd(); + +- strncpy (buffer, cwd, size - 1); +- buffer [size - 1] = 0; ++ g_strlcpy (buffer, cwd, size); + return buffer; + } + |