OBS User unknown 2008-09-09 20:14:42 +00:00 committed by Git OBS Bridge
parent d820d46a6a
commit 655c4c74aa
22 changed files with 1804 additions and 16 deletions

34
01_ftpfs_symlink.patch Normal file
View File

@ -0,0 +1,34 @@
diff --git a/vfs/direntry.c b/vfs/direntry.c
index 3a52d22..b1dfdca 100644
--- a/vfs/direntry.c
+++ b/vfs/direntry.c
@@ -251,7 +251,13 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
char * const pathref = g_strdup (a_path);
char *path = pathref;
- canonicalize_pathname (path);
+ if (strncmp(me->name, "ftpfs", 5) != 0)
+ canonicalize_pathname (path);
+ else {
+ char *p = path + strlen (path) - 1;
+ while (p > path && *p == PATH_SEP)
+ *p-- = 0;
+ }
while (root) {
while (*path == PATH_SEP) /* Strip leading '/' */
@@ -324,7 +330,13 @@ vfs_s_find_entry_linear (struct vfs_class *me, struct vfs_s_inode *root,
if (root->super->root != root)
vfs_die ("We have to use _real_ root. Always. Sorry.");
- canonicalize_pathname (path);
+ if (strncmp (me->name, "ftpfs", 5) != 0)
+ canonicalize_pathname (path);
+ else {
+ char *p = path + strlen (path) - 1;
+ while (p > path && *p == PATH_SEP)
+ *p-- = 0;
+ }
if (!(flags & FL_DIR)) {
char *dirname, *name, *save;

View File

@ -0,0 +1,13 @@
diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c
index 43d363c..1b137ae 100644
--- a/vfs/ftpfs.c
+++ b/vfs/ftpfs.c
@@ -1526,7 +1526,7 @@ static int ftpfs_chmod (struct vfs_class *me, const char *path, int mode)
char buf[BUF_SMALL];
g_snprintf(buf, sizeof(buf), "SITE CHMOD %4.4o /%%s", mode & 07777);
- return ftpfs_send_command(me, path, buf, OPT_FLUSH);
+ return ftpfs_send_command(me, path, buf, OPT_FLUSH | OPT_IGNORE_ERROR);
}
static int ftpfs_chown (struct vfs_class *me, const char *path, int owner, int group)

View File

@ -0,0 +1,188 @@
diff --git a/vfs/fish.c b/vfs/fish.c
index 2a2deb6..d03917e 100644
--- a/vfs/fish.c
+++ b/vfs/fish.c
@@ -366,15 +366,15 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
dir->timestamp.tv_sec += fish_directory_timeout;
quoted_path = name_quote (remote_path, 0);
fish_command (me, super, NONE,
- "#LIST /%s\n"
- "if ls -1 /%s >/dev/null 2>&1 ;\n"
+ "#LIST \"/%s\"\n"
+ "if ls -1 \"/%s\" >/dev/null 2>&1 ;\n"
"then\n"
- "ls -lLan /%s 2>/dev/null | grep '^[^cbt]' | (\n"
+ "ls -lQLan \"/%s\" 2>/dev/null | grep '^[^cbt]' | (\n"
"while read p l u g s m d y n; do\n"
- "echo \"P$p $u.$g\nS$s\nd$m $d $y\n:$n\n\"\n"
+ "echo \"P$p $u.$g\nS$s\nd$m $d $y\n:$n\n\"|sed 's#\\\"##g'\n"
"done\n"
")\n"
- "ls -lan /%s 2>/dev/null | grep '^[cb]' | (\n"
+ "ls -lQan \"/%s\" 2>/dev/null | grep '^[cb]' | (\n"
"while read p l u g a i m d y n; do\n"
"echo \"P$p $u.$g\nE$a$i\nd$m $d $y\n:$n\n\"\n"
"done\n"
@@ -527,16 +527,16 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
* instead of stderr. It makes impossible the use of "head || dd"
* algorithm for file appending case, therefore just "dd" is used for it.
*/
-
+ name = unescape_string(name);
print_vfs_message(_("fish: store %s: sending command..."), name );
- quoted_name = name_quote (name, 0);
+ quoted_name = unescape_string (name_quote (name, 0));
/* FIXME: File size is limited to ULONG_MAX */
if (!fh->u.fish.append)
n = fish_command (me, super, WAIT_REPLY,
- "#STOR %lu /%s\n"
+ "#STOR %lu \"/%s\"\n"
"echo '### 001'\n"
- "file=/%s\n"
+ "file=\"/%s\"\n"
"res=`exec 3>&1\n"
"(\n"
"head -c %lu -q - || echo DD >&3\n"
@@ -558,10 +558,10 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
(unsigned long) s.st_size);
else
n = fish_command (me, super, WAIT_REPLY,
- "#STOR %lu /%s\n"
+ "#STOR %lu \"/%s\"\n"
"echo '### 001'\n"
"{\n"
- "file=/%s\n"
+ "file=\"/%s\"\n"
"rest=%lu\n"
"while [ $rest -gt 0 ]\n"
"do\n"
@@ -627,7 +627,7 @@ fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset)
return 0;
quoted_name = name_quote (name, 0);
g_free (name);
- name = quoted_name;
+ name = unescape_string(quoted_name);
fh->u.fish.append = 0;
/*
@@ -637,15 +637,15 @@ fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset)
* standard output (i.e. over the network).
*/
offset = fish_command (me, FH_SUPER, WANT_STRING,
- "#RETR /%s\n"
- "if dd if=/%s of=/dev/null bs=1 count=1 2>/dev/null ;\n"
+ "#RETR \"/%s\"\n"
+ "if dd if=\"/%s\" of=/dev/null bs=1 count=1 2>/dev/null ;\n"
"then\n"
- "ls -ln /%s 2>/dev/null | (\n"
+ "ls -ln \"/%s\" 2>/dev/null | (\n"
"read p l u g s r\n"
"echo \"$s\"\n"
")\n"
"echo '### 100'\n"
- "cat /%s\n"
+ "cat \"//%s\"\n"
"echo '### 200'\n"
"else\n"
"echo '### 500'\n"
@@ -767,6 +767,7 @@ fish_send_command(struct vfs_class *me, struct vfs_s_super *super, const char *c
return -1; \
} \
rpath = name_quote (crpath, 0); \
+ rpath = unescape_string(rpath); \
g_free (mpath);
#define POSTFIX(flags) \
@@ -777,7 +778,7 @@ static int
fish_chmod (struct vfs_class *me, const char *path, int mode)
{
PREFIX
- g_snprintf(buf, sizeof(buf), "#CHMOD %4.4o /%s\n"
+ g_snprintf(buf, sizeof(buf), "#CHMOD %4.4o \"/%s\"\n"
"chmod %4.4o \"/%s\" 2>/dev/null\n"
"echo '### 000'\n",
mode & 07777, rpath,
@@ -811,11 +812,11 @@ static int fish_##name (struct vfs_class *me, const char *path1, const char *pat
return fish_send_command(me, super2, buf, OPT_FLUSH); \
}
-FISH_OP(rename, "#RENAME /%s /%s\n"
- "mv /%s /%s 2>/dev/null\n"
+FISH_OP(rename, "#RENAME \"/%s\" \"/%s\"\n"
+ "mv \"/%s\" \"/%s\" 2>/dev/null\n"
"echo '### 000'" )
-FISH_OP(link, "#LINK /%s /%s\n"
- "ln /%s /%s 2>/dev/null\n"
+FISH_OP(link, "#LINK \"/%s\" \"/%s\"\n"
+ "ln \"/%s\" \"/%s\" 2>/dev/null\n"
"echo '### 000'" )
static int fish_symlink (struct vfs_class *me, const char *setto, const char *path)
@@ -824,8 +825,8 @@ static int fish_symlink (struct vfs_class *me, const char *setto, const char *pa
PREFIX
qsetto = name_quote (setto, 0);
g_snprintf(buf, sizeof(buf),
- "#SYMLINK %s /%s\n"
- "ln -s %s /%s 2>/dev/null\n"
+ "#SYMLINK \"%s\" \"/%s\"\n"
+ "ln -s \"%s\" \"/%s\" 2>/dev/null\n"
"echo '### 000'\n",
qsetto, rpath, qsetto, rpath);
g_free (qsetto);
@@ -850,16 +851,16 @@ fish_chown (struct vfs_class *me, const char *path, int owner, int group)
{
PREFIX
g_snprintf (buf, sizeof(buf),
- "#CHOWN /%s /%s\n"
- "chown %s /%s 2>/dev/null\n"
+ "#CHOWN /%s \"/%s\"\n"
+ "chown %s \"/%s\" 2>/dev/null\n"
"echo '### 000'\n",
sowner, rpath,
sowner, rpath);
fish_send_command (me, super, buf, OPT_FLUSH);
/* FIXME: what should we report if chgrp succeeds but chown fails? */
g_snprintf (buf, sizeof(buf),
- "#CHGRP /%s /%s\n"
- "chgrp %s /%s 2>/dev/null\n"
+ "#CHGRP /%s \"/%s\"\n"
+ "chgrp %s \"/%s\" 2>/dev/null\n"
"echo '### 000'\n",
sgroup, rpath,
sgroup, rpath);
@@ -872,8 +873,8 @@ static int fish_unlink (struct vfs_class *me, const char *path)
{
PREFIX
g_snprintf(buf, sizeof(buf),
- "#DELE /%s\n"
- "rm -f /%s 2>/dev/null\n"
+ "#DELE \"/%s\"\n"
+ "rm -f \"/%s\" 2>/dev/null\n"
"echo '### 000'\n",
rpath, rpath);
POSTFIX(OPT_FLUSH);
@@ -884,10 +885,9 @@ static int fish_mkdir (struct vfs_class *me, const char *path, mode_t mode)
PREFIX
(void) mode;
-
g_snprintf(buf, sizeof(buf),
- "#MKD /%s\n"
- "mkdir /%s 2>/dev/null\n"
+ "#MKD \"/%s\"\n"
+ "mkdir \"/%s\" 2>/dev/null\n"
"echo '### 000'\n",
rpath, rpath);
POSTFIX(OPT_FLUSH);
@@ -897,8 +897,8 @@ static int fish_rmdir (struct vfs_class *me, const char *path)
{
PREFIX
g_snprintf(buf, sizeof(buf),
- "#RMD /%s\n"
- "rmdir /%s 2>/dev/null\n"
+ "#RMD \"/%s\"\n"
+ "rmdir \"/%s\" 2>/dev/null\n"
"echo '### 000'\n",
rpath, rpath);
POSTFIX(OPT_FLUSH);

View File

@ -0,0 +1,45 @@
diff --git a/vfs/fish.c b/vfs/fish.c
index d03917e..e0e4471 100644
--- a/vfs/fish.c
+++ b/vfs/fish.c
@@ -536,6 +536,7 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
n = fish_command (me, super, WAIT_REPLY,
"#STOR %lu \"/%s\"\n"
"echo '### 001'\n"
+ "if touch \"/%s\"; then\n"
"file=\"/%s\"\n"
"res=`exec 3>&1\n"
"(\n"
@@ -552,14 +553,18 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
" n=`dd bs=256 count=$cnt | tee -a \"$file\" | wc -c`\n"
" rest=`expr $rest - $n`\n"
"done\n"
- "}; echo '### 200'\n",
- (unsigned long) s.st_size, name,
+ "}; echo '### 200'\n"
+ "else\n"
+ "echo '### 500'\n"
+ "fi\n",
+ (unsigned long) s.st_size, name, name,
quoted_name, (unsigned long) s.st_size,
(unsigned long) s.st_size);
else
n = fish_command (me, super, WAIT_REPLY,
"#STOR %lu \"/%s\"\n"
"echo '### 001'\n"
+ "if touch \"/%s\"; then\n"
"{\n"
"file=\"/%s\"\n"
"rest=%lu\n"
@@ -570,7 +575,10 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
" rest=`expr $rest - $n`\n"
"done\n"
"}; echo '### 200'\n",
- (unsigned long) s.st_size, name,
+ "else\n"
+ "echo '### 500'\n"
+ "fi\n",
+ (unsigned long) s.st_size, name, name,
quoted_name, (unsigned long) s.st_size);
g_free (quoted_name);

210
05_add_lzma_support.patch Normal file
View File

@ -0,0 +1,210 @@
diff --git a/edit/edit.c b/edit/edit.c
index ff2b2e7..3b9c750 100644
--- a/edit/edit.c
+++ b/edit/edit.c
@@ -182,6 +182,7 @@ edit_load_file_fast (WEdit *edit, const char *filename)
static const struct edit_filters {
const char *read, *write, *extension;
} all_filters[] = {
+ { "lzma -cd %s 2>&1", "lzma > %s", ".bz2" },
{ "bzip2 -cd %s 2>&1", "bzip2 > %s", ".bz2" },
{ "gzip -cd %s 2>&1", "gzip > %s", ".gz" },
{ "gzip -cd %s 2>&1", "gzip > %s", ".Z" }
diff --git a/lib/mc.ext.in b/lib/mc.ext.in
index af63f0e..dfe72bb 100644
--- a/lib/mc.ext.in
+++ b/lib/mc.ext.in
@@ -119,6 +119,11 @@ regex/\.t(ar\.bz2|bz|b2)$
Open=%cd %p#utar
View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
+# .tar.lzma, .tlz
+regex/\.t(ar\.lzma|lz)$
+ Open=%cd %p#utar
+ View=%view{ascii} lzma -dc %f 2>/dev/null | tar tvvf -
+
# .tar.F - used in QNX
regex/\.tar\.F$
# Open=%cd %p#utar
@@ -298,6 +303,10 @@ regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$
Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
+regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$
+ Open=case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
+ View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
+
### Images ###
@@ -545,6 +554,11 @@ type/^compress
Open=gzip -dc %f | %var{PAGER:more}
View=%view{ascii} gzip -dc %f 2>/dev/null
+# lzma
+regex/\.lzma$
+ Open=lzma -dc %f | %var{PAGER:more}
+ View=%view{ascii} lzma -dc %f 2>/dev/null
+
### Default ###
diff --git a/src/util.c b/src/util.c
index da6d1b2..b27f3b3 100644
--- a/src/util.c
+++ b/src/util.c
@@ -942,7 +942,7 @@ get_current_wd (char *buffer, int size)
enum compression_type
get_compression_type (int fd)
{
- unsigned char magic[4];
+ unsigned char magic[16];
/* Read the magic signature */
if (mc_read (fd, (char *) magic, 4) != 4)
@@ -986,6 +986,31 @@ get_compression_type (int fd)
return COMPRESSION_BZIP2;
}
}
+
+ /* LZMA files; both LZMA_Alone and LZMA utils formats. The LZMA_Alone
+ * format is used by the LZMA_Alone tool from LZMA SDK. The LZMA utils
+ * format is the default format of LZMA utils 4.32.1 and later. */
+ if (magic[0] < 0xE1 || (magic[0] == 0xFF && magic[1] == 'L' &&
+ magic[2] == 'Z' && magic[3] == 'M')) {
+ if (mc_read (fd, (char *) magic + 4, 9) == 9) {
+ /* LZMA utils format */
+ if (magic[0] == 0xFF && magic[4] == 'A' && magic[5] == 0x00)
+ return COMPRESSION_LZMA;
+ /* The LZMA_Alone format has no magic bytes, thus we
+ * need to play a wizard. This can give false positives,
+ * thus the detection below should be removed when
+ * the newer LZMA utils format has got popular. */
+ if (magic[0] < 0xE1 && magic[4] < 0x20 &&
+ ((magic[10] == 0x00 && magic[11] == 0x00 &&
+ magic[12] == 0x00) ||
+ (magic[5] == 0xFF && magic[6] == 0xFF &&
+ magic[7] == 0xFF && magic[8] == 0xFF &&
+ magic[9] == 0xFF && magic[10] == 0xFF &&
+ magic[11] == 0xFF && magic[12] == 0xFF)))
+ return COMPRESSION_LZMA;
+ }
+ }
+
return 0;
}
@@ -996,6 +1021,7 @@ decompress_extension (int type)
case COMPRESSION_GZIP: return "#ugz";
case COMPRESSION_BZIP: return "#ubz";
case COMPRESSION_BZIP2: return "#ubz2";
+ case COMPRESSION_LZMA: return "#ulzma";
}
/* Should never reach this place */
fprintf (stderr, "Fatal: decompress_extension called with an unknown argument\n");
diff --git a/src/util.h b/src/util.h
index 4e9a113..5e773f8 100644
--- a/src/util.h
+++ b/src/util.h
@@ -179,7 +179,8 @@ enum compression_type {
COMPRESSION_NONE,
COMPRESSION_GZIP,
COMPRESSION_BZIP,
- COMPRESSION_BZIP2
+ COMPRESSION_BZIP2,
+ COMPRESSION_LZMA
};
/* Looks for ``magic'' bytes at the start of the VFS file to guess the
diff --git a/vfs/extfs/iso9660.in b/vfs/extfs/iso9660.in
index 91d1b1e..467efdb 100644
--- a/vfs/extfs/iso9660.in
+++ b/vfs/extfs/iso9660.in
@@ -29,6 +29,7 @@ test_iso () {
mcisofs_list () {
# left as a reminder to implement compressed image support =)
case "$1" in
+ *.lzma) MYCAT="lzma -dc";;
*.bz2) MYCAT="bzip2 -dc";;
*.gz) MYCAT="gzip -dc";;
*.z) MYCAT="gzip -dc";;
diff --git a/vfs/extfs/lslR.in b/vfs/extfs/lslR.in
index 273fe5e..67f5edb 100644
--- a/vfs/extfs/lslR.in
+++ b/vfs/extfs/lslR.in
@@ -12,6 +12,7 @@ AWK=@AWK@
mclslRfs_list () {
case "$1" in
+ *.lzma) MYCAT="lzma -dc";;
*.bz2) MYCAT="bzip2 -dc";;
*.gz) MYCAT="gzip -dc";;
*.z) MYCAT="gzip -dc";;
diff --git a/vfs/extfs/mailfs.in b/vfs/extfs/mailfs.in
index 7bb62f9..91cf3d7 100644
--- a/vfs/extfs/mailfs.in
+++ b/vfs/extfs/mailfs.in
@@ -7,6 +7,7 @@ use bytes;
$zcat="zcat"; # gunzip to stdout
$bzcat="bzip2 -dc"; # bunzip2 to stdout
+$lzcat="lzma -dc"; # unlzma to stdout
$file="file"; # "file" command
$TZ='GMT'; # default timezone (for Date module)
@@ -182,6 +183,8 @@ if (/gzip/) {
exit 1 unless (open IN, "$zcat $mbox_qname|");
} elsif (/bzip/) {
exit 1 unless (open IN, "$bzcat $mbox_qname|");
+} elsif (/lzma/) {
+ exit 1 unless (open IN, "$lzcat $mbox_qname|");
} else {
exit 1 unless (open IN, "<$mbox_name");
}
diff --git a/vfs/extfs/patchfs.in b/vfs/extfs/patchfs.in
index dc3757d..62a6d0d 100644
--- a/vfs/extfs/patchfs.in
+++ b/vfs/extfs/patchfs.in
@@ -12,6 +12,7 @@ use POSIX;
use File::Temp 'tempfile';
# standard binaries
+my $lzma = 'lzma';
my $bzip = 'bzip2';
my $gzip = 'gzip';
my $fileutil = 'file';
@@ -70,7 +71,9 @@ sub myin
my ($qfname)=(quotemeta $_[0]);
$_=`$fileutil $qfname`;
- if (/bzip/) {
+ if (/lzma/) {
+ return "$lzma -dc $qfname";
+ } elsif (/bzip/) {
return "$bzip -dc $qfname";
} elsif (/gzip/) {
return "$gzip -dc $qfname";
@@ -86,7 +89,9 @@ sub myout
my ($sep) = $append ? '>>' : '>';
$_=`$fileutil $qfname`;
- if (/bzip/) {
+ if (/lzma/) {
+ return "$lzma -c $sep $qfname";
+ } elsif (/bzip/) {
return "$bzip -c $sep $qfname";
} elsif (/gzip/) {
return "$gzip -c $sep $qfname";
diff --git a/vfs/extfs/sfs.ini b/vfs/extfs/sfs.ini
index 5c3d8e2..fc77e04 100644
--- a/vfs/extfs/sfs.ini
+++ b/vfs/extfs/sfs.ini
@@ -10,6 +10,8 @@ bz/1 bzip < %1 > %3
ubz/1 bzip -d < %1 > %3
bz2/1 bzip2 < %1 > %3
ubz2/1 bzip2 -d < %1 > %3
+lzma/1 lzma < %1 > %3
+ulzma/1 lzma -d < %1 > %3
tar/1 tar cf %3 %1
tgz/1 tar czf %3 %1
uhtml/1 lynx -force_html -dump %1 > %3

View File

@ -0,0 +1,62 @@
--- mc/vfs/extfs/rpm 2006-11-01 02:30:26.000000000 -0800
+++ mc/vfs/extfs/rpm.new 2007-10-18 14:39:23.000000000 -0700
@@ -95,10 +95,6 @@ mcrpmfs_list ()
echo "$FILEPREF 0 $DATE INFO/PACKAGER"
test "`$RPM -qp --qf \"%{URL}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/URL"
- test "`$RPM -qp --qf \"%{SERIAL}\" \"$f\"`" = "(none)" ||
- echo "$FILEPREF 0 $DATE INFO/SERIAL"
- test "`$RPM -qp --qf \"%{COPYRIGHT}\" \"$f\"`" = "(none)" ||
- echo "$FILEPREF 0 $DATE INFO/COPYRIGHT"
test "`$RPM -qp --qf \"%{EPOCH}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/EPOCH"
test "`$RPM -qp --qf \"%{LICENSE}\" \"$f\"`" = "(none)" ||
@@ -106,8 +102,6 @@ mcrpmfs_list ()
else
echo "$FILEPREF 0 $DATE INFO/PACKAGER"
echo "$FILEPREF 0 $DATE INFO/URL"
- echo "$FILEPREF 0 $DATE INFO/SERIAL"
- echo "$FILEPREF 0 $DATE INFO/COPYRIGHT"
echo "$FILEPREF 0 $DATE INFO/EPOCH"
echo "$FILEPREF 0 $DATE INFO/LICENSE"
fi
@@ -156,8 +150,6 @@ mcrpmfs_copyout ()
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/EPOCH) $RPM -qp --qf "%{EPOCH}\n" "$f" >"$3"; exit 0;;
INFO/LICENSE) $RPM -qp --qf "%{LICENSE}\n" "$f" >"$3"; exit 0;;
INFO/RPMVERSION) $RPM -qp --qf "%{RPMVERSION}\n" "$f" >"$3"; exit 0;;
--- mc/vfs/extfs/trpm 2006-11-01 02:30:26.000000000 -0800
+++ mc/vfs/extfs/trpm.new 2007-10-18 14:40:12.000000000 -0700
@@ -85,10 +85,6 @@ mcrpmfs_list ()
echo "$FILEPREF 0 $DATE INFO/PACKAGER"
test "`$RPM -q --qf \"%{URL}\" -- "$1"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/URL"
- test "`$RPM -q --qf \"%{SERIAL}\" -- "$1"`" = "(none)" ||
- echo "$FILEPREF 0 $DATE INFO/SERIAL"
- test "`$RPM -q --qf \"%{COPYRIGHT}\" -- "$1"`" = "(none)" ||
- echo "$FILEPREF 0 $DATE INFO/COPYRIGHT"
test "`$RPM -q --qf \"%{EPOCH}\" -- "$1"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/EPOCH"
test "`$RPM -q --qf \"%{LICENSE}\" -- "$1"`" = "(none)" ||
@@ -96,8 +92,6 @@ mcrpmfs_list ()
else
echo "$FILEPREF 0 $DATE INFO/PACKAGER"
echo "$FILEPREF 0 $DATE INFO/URL"
- echo "$FILEPREF 0 $DATE INFO/SERIAL"
- echo "$FILEPREF 0 $DATE INFO/COPYRIGHT"
echo "$FILEPREF 0 $DATE INFO/EPOCH"
echo "$FILEPREF 0 $DATE INFO/LICENSE"
fi
@@ -143,8 +137,6 @@ mcrpmfs_copyout ()
INFO/PACKAGER) $RPM -q --qf "%{PACKAGER}\n" -- "$1" > "$3"; exit 0;;
INFO/URL) $RPM -q --qf "%{URL}\n" -- "$1" > "$3"; exit 0;;
INFO/BUILDTIME) $RPM -q --qf "%{BUILDTIME:date}\n" -- "$1" > "$3"; exit 0;;
- INFO/SERIAL) $RPM -q --qf "%{SERIAL}\n" -- "$1" > "$3"; exit 0;;
- INFO/COPYRIGHT) $RPM -q --qf "%{COPYRIGHT}\n" -- "$1" > "$3"; exit 0;;
INFO/EPOCH) $RPM -q --qf "%{EPOCH}\n" -- "$1" > "$3"; exit 0;;
INFO/LICENSE) $RPM -q --qf "%{LICENSE}\n" -- "$1" > "$3"; exit 0;;
INFO/RPMVERSION) $RPM -q --qf "%{RPMVERSION}\n" -- "$1" > "$3"; exit 0;;

View File

@ -0,0 +1,55 @@
diff --git a/vfs/extfs/u7z b/vfs/extfs/u7z
index da2272e..c722388 100644
--- a/vfs/extfs/u7z
+++ b/vfs/extfs/u7z
@@ -2,6 +2,7 @@
#
# extfs support for p7zip
# Written by Pavel Roskin <proski@gnu.org>
+# Some Bugfixes/workarounds by Sergiy Niskorodov <sgh@mail.zp.ua>
# Licensed under GNU GPL version 2 or later version.
P7ZIP=7za
@@ -19,7 +20,10 @@ mcu7zip_list ()
mcu7zip_copyout ()
{
- $P7ZIP e -so "$1" "$2" > "$3" 2>/dev/null
+ #first we check if we have old p7zip archive with prefix ./ in filename
+ $P7ZIP l "$1" "$2" | grep -q "0 files" && \
+ EXFNAME=*./"$2" || EXFNAME="$2"
+ $P7ZIP e -so "$1" "$EXFNAME" > "$3" 2>/dev/null
}
mcu7zip_copyin ()
@@ -31,19 +35,27 @@ mcu7zip_mkdir ()
{
dir=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-u7z.XXXXXX"` || exit 1
mkdir -p "$dir"/"$2"
- $P7ZIP a -w"$dir" "$1" "$2" >/dev/null 2>&1
+ $P7ZIP a -w"$dir" "$1" "$dir"/"$2" >/dev/null 2>&1
rm -rf "$dir"
}
mcu7zip_rm ()
{
# NOTE: Version 4.20 fails to delete files in subdirectories
- $P7ZIP d "$1" "$2" >/dev/null 2>&1
+ #first we check if we have old p7zip archive with prefix ./ in filename
+ $P7ZIP l "$1" "$2" | grep -q "0 files" && \
+ EXFNAME=*./"$2" || EXFNAME="$2"
+ $P7ZIP d "$1" "$EXFNAME" 2>&1 | grep -q E_NOTIMPL &> /dev/null && \
+ { echo -e "Function not implemented...\n7z cannot delete from solid archive." >&2 ; exit 1 ; }
}
mcu7zip_rmdir ()
{
- $P7ZIP d "$1" "$2"/ >/dev/null 2>&1
+ #first we check if we have old p7zip archive with prefix ./ in filename
+ $P7ZIP l "$1" "$2" | grep -q "0 files" && \
+ EXFNAME=*./"$2" || EXFNAME="$2"
+ $P7ZIP d "$1" "$EXFNAME"/ 2>&1 | grep -q E_NOTIMPL &> /dev/null && \
+ { echo -e "Function not implemented...\n7z cannot delete from solid archive." >&2 ; exit 1 ; }
}
# override any locale for dates

View File

@ -0,0 +1,15 @@
diff --git a/vfs/extfs/urar.in b/vfs/extfs/urar.in
index c8dbde1..6d29cd0 100644
--- a/vfs/extfs/urar.in
+++ b/vfs/extfs/urar.in
@@ -22,6 +22,10 @@ for dir in $PATH; do
fi
done
+if [ ! -x $UNRAR -a -x $RAR ]; then
+ UNRAR=$RAR
+fi
+
mcrarfs_list ()
{
$UNRAR v -c- "$1" | @AWK@ -v uid=`id -u` -v gid=`id -g` '

61
100_fix_bashisms.patch Normal file
View File

@ -0,0 +1,61 @@
diff -Nurwd orig/mc-4.6.2~git20080311/vfs/extfs/u7z mc-4.6.2~git20080311/vfs/extfs/u7z
--- orig/mc-4.6.2~git20080311/vfs/extfs/u7z 2008-07-26 11:26:48.000000000 +0200
+++ mc-4.6.2~git20080311/vfs/extfs/u7z 2008-07-26 11:30:24.000000000 +0200
@@ -45,8 +45,8 @@
#first we check if we have old p7zip archive with prefix ./ in filename
$P7ZIP l "$1" "$2" | grep -q "0 files" && \
EXFNAME=*./"$2" || EXFNAME="$2"
- $P7ZIP d "$1" "$EXFNAME" 2>&1 | grep -q E_NOTIMPL &> /dev/null && \
- { echo -e "Function not implemented...\n7z cannot delete from solid archive." >&2 ; exit 1 ; }
+ $P7ZIP d "$1" "$EXFNAME" 2>&1 | grep -q E_NOTIMPL > /dev/null 2>&1 && \
+ { printf "Function not implemented...\n7z cannot delete from solid archive.\n" >&2 ; exit 1 ; }
}
mcu7zip_rmdir ()
@@ -54,8 +54,8 @@
#first we check if we have old p7zip archive with prefix ./ in filename
$P7ZIP l "$1" "$2" | grep -q "0 files" && \
EXFNAME=*./"$2" || EXFNAME="$2"
- $P7ZIP d "$1" "$EXFNAME"/ 2>&1 | grep -q E_NOTIMPL &> /dev/null && \
- { echo -e "Function not implemented...\n7z cannot delete from solid archive." >&2 ; exit 1 ; }
+ $P7ZIP d "$1" "$EXFNAME"/ 2>&1 | grep -q E_NOTIMPL > /dev/null 2>&1 && \
+ { printf "Function not implemented...\n7z cannot delete from solid archive.\n" >&2 ; exit 1 ; }
}
# override any locale for dates
diff -Nurwd orig/mc-4.6.2~git20080311/vfs/extfs/uarj.in mc-4.6.2~git20080311/vfs/extfs/uarj.in
--- orig/mc-4.6.2~git20080311/vfs/extfs/uarj.in 2008-07-26 11:26:48.000000000 +0200
+++ mc-4.6.2~git20080311/vfs/extfs/uarj.in 2008-07-26 11:34:19.000000000 +0200
@@ -16,7 +16,7 @@
mcarjfs_list ()
{
- $ARJ v "$1" | @AWK@ -v uuid=${UID-0} '
+ $ARJ v "$1" | @AWK@ -v uuid=$(id -ru) '
{
if (($0 ~ /^[0-9]+\) .*/)||($0 ~ /^------------ ---------- ---------- -----/)){
if (filestr ~ /^[0-9]+\) .*/) {
diff -Nurwd orig/mc-4.6.2~git20080311/vfs/extfs/uha.in mc-4.6.2~git20080311/vfs/extfs/uha.in
--- orig/mc-4.6.2~git20080311/vfs/extfs/uha.in 2008-07-26 11:26:48.000000000 +0200
+++ mc-4.6.2~git20080311/vfs/extfs/uha.in 2008-07-26 11:34:39.000000000 +0200
@@ -10,7 +10,7 @@
mchafs_list ()
{
- $HA lf "$1" 2>/dev/null | @AWK@ -v uid=${UID-0} '
+ $HA lf "$1" 2>/dev/null | @AWK@ -v uid=$(id -ru) '
/^===========/ {next}
{
if ($5="%" && $8~/DIR|ASC|HSC|CPY/) {
diff -Nurwd orig/mc-4.6.2~git20080311/vfs/extfs/uzoo.in mc-4.6.2~git20080311/vfs/extfs/uzoo.in
--- orig/mc-4.6.2~git20080311/vfs/extfs/uzoo.in 2008-07-26 11:26:48.000000000 +0200
+++ mc-4.6.2~git20080311/vfs/extfs/uzoo.in 2008-07-26 11:36:00.000000000 +0200
@@ -23,7 +23,7 @@
mczoofs_list ()
{
mklink "$1"
- $ZOO lq "$ARCHIVE" | @AWK@ -v uid=${UID-0} '
+ $ZOO lq "$ARCHIVE" | @AWK@ -v uid=$(id -ru) '
/^[^\ ]/ { next }
{
if (NF < 8)

12
28_mc-dontrewrite.patch Normal file
View File

@ -0,0 +1,12 @@
diff -Nurwd ./mc-4.6.2~pre1/edit/editcmd.c ./mc-4.6.2~pre1.patched/edit/editcmd.c
--- ./edit/editcmd.c 2008-02-12 19:58:24.000000000 +0100
+++ ./edit/editcmd.c 2008-02-12 19:57:11.000000000 +0100
@@ -243,7 +243,7 @@
this_save_mode = option_save_mode;
if (this_save_mode != EDIT_QUICK_SAVE) {
if (!vfs_file_is_local (filename) ||
- (fd = mc_open (filename, O_WRONLY | O_BINARY)) == -1) {
+ (fd = mc_open (filename, O_RDONLY | O_BINARY)) == -1) {
/*
* The file does not exists yet, so no safe save or
* backup are necessary.

166
61_escaping.patch Normal file
View File

@ -0,0 +1,166 @@
diff -u -w -r1.141 util.c
--- ./src/util.c 25 Sep 2007 15:33:37 -0000 1.141
+++ ./src/util.c 27 Feb 2008 15:38:13 -0000
@@ -1525,3 +1525,58 @@
return (sep != NULL) ? sep + 1 : result;
}
+/* Unescape paths or other strings for e.g the internal cd */
+char *
+unescape_string ( const char * in ) {
+ char * local = NULL;
+ int i = 0;
+ int j = 20;
+ int k = 0;
+
+ local = g_malloc(j);
+
+ for (i=0;i<=strlen(in);i++) {
+ if (i-k+1 >= j ) {
+ j = j + 20;
+ local = g_realloc(local,j);
+ }
+ if ( (strchr(" \t*|;<>~#()?[]{}&",in[i])) && ( strchr("\\",in[i-1])) ) {
+ k++;
+ local[i-k] = in[i];
+ } else {
+ local[i-k] = in[i];
+ }
+ }
+ local[i-k] = '\0';
+
+ return local;
+}
+
+/* To be compatible with the general posix command lines we have to escape *
+ * strings for the command line */
+char *
+escape_string ( const char * in ) {
+ char * local = NULL;
+ int i = 0;
+ int j = 20;
+ int k = 0;
+
+ local = g_malloc(j);
+
+ for (i=0;i<strlen(in);i++) {
+ if (i+k+1 >= j ) { //If 20 chars is too low for the path
+ j = j + 20;
+ local = g_realloc(local,j);
+ }
+ if ( (strchr(" \t*|;<>~#()?[]{}&",in[i])) && (! strchr("\\",in[i-1])) ) {
+ local[i+k] = 92; // Ascii for "\"
+ k = k+1;
+ local[i+k] = in[i];
+ } else {
+ local[i+k] = in[i];
+ }
+ }
+ local[i+k] = '\0';
+
+ return local;
+}
diff -u -w -r1.78 util.h
--- ./src/util.h 3 Feb 2006 17:04:17 -0000 1.78
+++ ./src/util.h 27 Feb 2008 15:38:13 -0000
@@ -14,6 +14,8 @@
extern const char *cstrcasestr (const char *haystack, const char *needle);
extern const char *cstrstr (const char *haystack, const char *needle);
+char *unescape_string ( const char * in );
+char *escape_string ( const char * in );
void str_replace(char *s, char from, char to);
int is_printable (int c);
void msglen (const char *text, /*@out@*/ int *lines, /*@out@*/ int *columns);
diff -u -w -r1.61 complete.c
--- ./src/complete.c 25 Sep 2007 15:33:36 -0000 1.61
+++ ./src/complete.c 27 Feb 2008 15:38:14 -0000
@@ -40,6 +40,7 @@
#include "wtools.h"
#include "complete.h"
#include "main.h"
+#include "util.h"
#include "key.h" /* XCTRL and ALT macros */
typedef char *CompletionFunction (char *, int);
@@ -911,6 +912,7 @@
static int
complete_engine (WInput *in, int what_to_do)
{
+ char *complete = NULL;
if (in->completions && in->point != end)
free_completions (in);
if (!in->completions){
@@ -924,7 +926,8 @@
}
if (in->completions){
if (what_to_do & DO_INSERTION || ((what_to_do & DO_QUERY) && !in->completions[1])) {
- if (insert_text (in, in->completions [0], strlen (in->completions [0]))){
+ complete = escape_string(in->completions [0]);
+ if (insert_text (in, complete, strlen (complete))){
if (in->completions [1])
beep ();
else
@@ -940,9 +943,11 @@
Dlg_head *query_dlg;
WListbox *query_list;
- for (p=in->completions + 1; *p; count++, p++)
+ for (p=in->completions + 1; *p; count++, p++) {
+ *p = escape_string(*p);
if ((i = strlen (*p)) > maxlen)
maxlen = i;
+ }
start_x = in->widget.x;
start_y = in->widget.y;
if (start_y - 2 >= count) {
diff -u -w -r1.34 command.c
--- ./src/command.c 26 Sep 2007 10:22:25 -0000 1.34
+++ ./src/command.c 27 Feb 2008 15:38:15 -0000
@@ -64,6 +64,7 @@
const char *t;
/* Tilde expansion */
+ path = unescape_string(path);
path_tilde = tilde_expand (path);
/* Leave space for further expansion */
diff -u -w -r1.151 file.c
--- ./src/file.c 25 Sep 2007 15:33:36 -0000 1.151
+++ ./src/file.c 5 Mar 2008 09:15:47 -0000
@@ -63,6 +63,7 @@
#include "widget.h"
#include "wtools.h"
#include "background.h" /* we_are_background */
+#include "util.h"
/* Needed for current_panel, other_panel and WTree */
#include "dir.h"
@@ -791,7 +807,7 @@
}
}
- if (!appending) {
+ if (!appending && ctx->preserve) {
while (mc_chmod (dst_path, (src_mode & ctx->umask_kill))) {
temp_status = file_error (
_(" Cannot chmod target file \"%s\" \n %s "), dst_path);
@@ -1872,6 +1890,8 @@
dest = temp2;
temp = NULL;
+ source_with_path = unescape_string(source_with_path);
+ dest = unescape_string(dest);
switch (operation) {
case OP_COPY:
/*
@@ -1963,6 +1983,9 @@
else {
char *temp2 = concat_dir_and_file (dest, temp);
+ source_with_path = unescape_string(source_with_path);
+ temp2 = unescape_string(temp2);
+
switch (operation) {
case OP_COPY:
/*

23
64_visible_tabs.patch Normal file
View File

@ -0,0 +1,23 @@
--- ./src/setup.c 26 Sep 2007 10:22:25 -0000 1.93
+++ ./src/setup.c 27 Feb 2008 18:48:37 -0000
@@ -216,6 +216,8 @@
{ "editor_option_typewriter_wrap", &option_typewriter_wrap },
{ "editor_edit_confirm_save", &edit_confirm_save },
{ "editor_syntax_highlighting", &option_syntax_highlighting },
+ { "editor_visible_tabs", &visible_tabs },
+ { "editor_visible_spaces", &visible_tws },
#endif /* USE_INTERNAL_EDIT */
{ "nice_rotating_dash", &nice_rotating_dash },
--- ./edit/edit.h 24 Sep 2007 09:28:35 -0000 1.88
+++ ./edit/edit.h 27 Feb 2008 18:48:37 -0000
@@ -298,6 +298,9 @@
extern int edit_confirm_save;
extern int column_highlighting;
+extern int visible_tabs;
+extern int visible_tws;
+
/* File names */
#define EDIT_DIR ".mc" PATH_SEP_STR "cedit"
#define SYNTAX_FILE EDIT_DIR PATH_SEP_STR "Syntax"

View File

@ -0,0 +1,312 @@
--- mc-4.6.2~git20080311/edit/editcmd.c.orig 2008-06-22 14:47:49.000000000 +0200
+++ mc-4.6.2~git20080311/edit/editcmd.c 2008-06-22 14:47:41.000000000 +0200
@@ -2076,6 +2076,33 @@
edit_error_dialog (_("Error"), _(" Invalid regular expression, or scanf expression with too many conversions "));
}
+int mc_isdigit(mc_wchar_t c)
+{
+#ifndef UTF8
+ return isdigit(c);
+#else /* UTF8 */
+ return iswdigit(c);
+#endif /* UTF8 */
+}
+
+mc_wchar_t * mc_memmove(mc_wchar_t *to, mc_wchar_t *from, size_t size)
+{
+#ifndef UTF8
+ return memmove(to, from, size);
+#else /* UTF8 */
+ return wmemmove(to, from, size);
+#endif /* UTF8 */
+}
+
+mc_wchar_t * mc_strchr(mc_wchar_t *str, mc_wchar_t c)
+{
+#ifndef UTF8
+ return strchr(str, c);
+#else /* UTF8 */
+ return wcschr(str, c);
+#endif /* UTF8 */
+}
+
/* call with edit = 0 before shutdown to close memory leaks */
void
edit_replace_cmd (WEdit *edit, int again)
@@ -2092,6 +2119,8 @@
int replace_continue;
int treplace_prompt = 0;
long times_replaced = 0, last_search;
+ mc_wchar_t *repl_templ;
+ mc_wchar_t *repl_str;
int argord[NUM_REPL_ARGS];
if (!edit) {
@@ -2145,7 +2174,68 @@
}
- {
+#ifndef UTF8
+ repl_templ = g_strdup(input2);
+#else /* UTF8 */
+ repl_templ = mbstr_to_wchar(input2);
+#endif /* UTF8 */
+
+ if (replace_regexp) {
+ /*
+ * edit replace template - convert subpattern references (\1) to
+ * snprintf_p arguments (%s) and fill "argord" array to match captured
+ * subpatterns
+ */
+ int ao;
+ int ord;
+ mc_wchar_t *s;
+ mc_wchar_t *param;
+ mc_wchar_t *endptr;
+#ifndef UTF8
+#define MC_CHAR(c) ((mc_wchar_t) c)
+#else /* UTF8 */
+#define MC_CHAR(c) (L##c)
+#endif /* UTF8 */
+
+ endptr = mc_strchr(repl_templ, MC_CHAR('\0'));
+ s = repl_templ;
+ ao = 0;
+ while ((s = mc_strchr(s, MC_CHAR('\\')))) {
+ param = s;
+ s++;
+ if (!s) break;
+ /* implement \n \r and \t escape sequences in replace string */
+ if (*s == MC_CHAR('n')) {
+ *s = MC_CHAR('\n');
+ } else if (*s == MC_CHAR('r')) {
+ *s = MC_CHAR('\r');
+ } else if (*s == MC_CHAR('t')) {
+ *s = MC_CHAR('\t');
+ }
+ if (!mc_isdigit(*s)) {
+ mc_memmove(param, s, endptr - s + 1);
+ continue;
+ }
+ ord = 0;
+ while (mc_isdigit(*s)) {
+ ord *= 10;
+ ord += *s - MC_CHAR('0');
+ s++;
+ }
+ if ((ord > 0) && (ord <= NUM_REPL_ARGS)) {
+ argord[ao++] = ord - 1;
+ *param++ = MC_CHAR('%');
+ *param++ = MC_CHAR('s');
+ mc_memmove(param, s, endptr - s + 1);
+ s = param;
+ }
+ }
+ while (ao < NUM_REPL_ARGS) {
+ argord[ao] = ao;
+ ao++;
+ }
+
+ } else {
const char *s;
int ord;
size_t i;
@@ -2176,6 +2266,12 @@
&& !replace_backwards)
edit->search_start++;
+ if (replace_scanf || replace_regexp) {
+ repl_str = g_malloc(((MAX_REPL_LEN + 2)+1) * sizeof(mc_wchar_t));
+ } else {
+ repl_str = repl_templ;
+ }
+
do {
int len = 0;
long new_start;
@@ -2200,8 +2296,47 @@
replace_yes = 1;
+ if (replace_scanf || replace_regexp) {
+ int ret = 0;
+
+ /* we need to fill in sargs just like with scanf */
+ if (replace_regexp) {
+ int k, j;
+ for (k = 1; k < NUM_REPL_ARGS && pmatch[k].rm_eo >= 0;
+ k++) {
+ mc_wchar_t *t;
+
+ if (pmatch[k].rm_eo - pmatch[k].rm_so > 255) {
+ ret = -1;
+ break;
+ }
+ t = (mc_wchar_t *) &sargs[k - 1][0];
+ for (j = 0; j < pmatch[k].rm_eo - pmatch[k].rm_so &&
+ j < 255; j++, t++)
+ *t = edit_get_byte (edit, edit->search_start -
+ pmatch[0].rm_so + pmatch[k].rm_so + j);
+ *t = '\0';
+ }
+ for (; k <= NUM_REPL_ARGS; k++)
+ sargs[k - 1][0] = 0;
+ }
+ if (ret >= 0)
+ ret = snprintf_p (repl_str, MAX_REPL_LEN + 2, repl_templ,
+ PRINTF_ARGS);
+ if (ret < 0) {
+ edit_error_dialog (_(" Replace "),
+ ret == -2
+ ? _(" Error in replacement format string. ")
+ : _(" Replacement too long. "));
+ treplace_prompt = 0;
+ replace_yes = 0;
+ replace_continue = 0;
+ }
+ }
+
if (treplace_prompt) {
int l;
+ char *displ_repl_str;
l = edit->curs_row - edit->num_widget_lines / 3;
if (l > 0)
edit_scroll_downward (edit, l);
@@ -2215,7 +2350,15 @@
/*so that undo stops at each query */
edit_push_key_press (edit);
- switch (edit_replace_prompt (edit, input2, /* and prompt 2/3 down */
+#ifndef UTF8
+ displ_repl_str = g_strdup(repl_str);
+#else /* UTF8 */
+ displ_repl_str = wchar_to_mbstr(repl_str);
+ /* wchar_to_mbstr(str) returns NULL when length of str == 0 */
+ if (!displ_repl_str) displ_repl_str = g_strdup("");
+#endif /* UTF8 */
+ convert_to_display (displ_repl_str);
+ switch (edit_replace_prompt (edit, displ_repl_str, /* and prompt 2/3 down */
(edit->num_widget_columns -
CONFIRM_DLG_WIDTH) / 2,
edit->num_widget_lines * 2 /
@@ -2237,99 +2380,15 @@
replace_continue = 0;
break;
}
+ g_free(displ_repl_str);
}
if (replace_yes) { /* delete then insert new */
-#ifdef UTF8
- mc_wchar_t *winput2 = mbstr_to_wchar(input2);
-#endif /* UTF8 */
- if (replace_scanf) {
- mc_wchar_t repl_str[MAX_REPL_LEN + 2];
- int ret = 0;
-
- /* we need to fill in sargs just like with scanf */
- if (replace_regexp) {
- int k, j;
- for (k = 1;
- k < NUM_REPL_ARGS && pmatch[k].rm_eo >= 0;
- k++) {
-#ifndef UTF8
- unsigned char *t;
-#else /* UTF8 */
- mc_wchar_t *t;
-#endif
-
- if (pmatch[k].rm_eo - pmatch[k].rm_so > 255) {
- ret = -1;
- break;
- }
-#ifndef UTF8
- t = (unsigned char *) &sargs[k - 1][0];
-#else /* UTF8 */
- t = (mc_wchar_t *) &sargs[k - 1][0];
-#endif /* UTF8 */
- for (j = 0;
- j < pmatch[k].rm_eo - pmatch[k].rm_so
- && j < 255; j++, t++)
- *t = edit_get_byte (edit,
- edit->
- search_start
- -
- pmatch
- [0].
- rm_so +
- pmatch
- [k].
- rm_so +
- j);
- *t = '\0';
- }
- for (; k <= NUM_REPL_ARGS; k++)
- sargs[k - 1][0] = 0;
- }
- if (!ret)
- ret =
-#ifndef UTF8
- snprintf_p (repl_str, MAX_REPL_LEN + 2, input2,
-#else /* UTF8 */
- snprintf_p (repl_str, MAX_REPL_LEN + 2, winput2,
-#endif /* UTF8 */
- PRINTF_ARGS);
- if (ret >= 0) {
- times_replaced++;
- while (i--)
- edit_delete (edit);
-#ifndef UTF8
- while (repl_str[++i])
- edit_insert (edit, repl_str[i]);
-#else /* UTF8 */
- while (winput2[++i])
- edit_insert (edit, winput2[i]);
-#endif /* UTF8 */
- } else {
- edit_error_dialog (_(" Replace "),
- ret ==
- -2 ?
- _
- (" Error in replacement format string. ")
- : _(" Replacement too long. "));
- replace_continue = 0;
- }
- } else {
- times_replaced++;
- while (i--)
- edit_delete (edit);
-#ifndef UTF8
- while (input2[++i])
- edit_insert (edit, input2[i]);
-#else /* UTF8 */
- while (winput2[++i])
- edit_insert (edit, winput2[i]);
-#endif /* UTF8 */
- }
+ times_replaced++;
+ while (i--)
+ edit_delete (edit);
+ while (repl_str[++i])
+ edit_insert (edit, repl_str[i]);
edit->found_len = i;
-#ifdef UTF8
- g_free (winput2);
-#endif /* UTF8 */
}
/* so that we don't find the same string again */
if (replace_backwards) {
@@ -2358,6 +2417,12 @@
}
} while (replace_continue);
+ /* cleanup */
+ if (replace_scanf || replace_regexp) {
+ g_free(repl_str);
+ }
+ g_free(repl_templ);
+
edit->force = REDRAW_COMPLETELY;
edit_scroll_screen_over_cursor (edit);
cleanup:

View File

@ -0,0 +1,11 @@
--- mc-4.6.2~git20080311/edit/editcmd.c.orig 2008-06-22 16:58:16.000000000 +0200
+++ mc-4.6.2~git20080311/edit/editcmd.c 2008-06-22 16:58:53.000000000 +0200
@@ -1721,7 +1721,7 @@
int found_start, match_bol, move_win = 0;
while (start + offset < last_byte) {
- match_bol = (offset == 0 || (*get_byte) (data, start + offset - 1) == '\n');
+ match_bol = (start == 0 || (*get_byte) (data, start + offset - 1) == '\n');
if (!move_win) {
p = start + offset;
q = 0;

View File

@ -0,0 +1,53 @@
--- mc-4.6.2~git20080311/edit/editcmd.c.orig 2008-06-23 01:48:03.000000000 +0200
+++ mc-4.6.2~git20080311/edit/editcmd.c 2008-06-23 01:58:32.000000000 +0200
@@ -1511,6 +1511,32 @@
sargs[argord[8]], sargs[argord[9]], sargs[argord[10]], sargs[argord[11]], \
sargs[argord[12]], sargs[argord[13]], sargs[argord[14]], sargs[argord[15]]
+#ifdef UTF8
+size_t
+real_mbstrlen (const char *str)
+{
+ if (SLsmg_Is_Unicode) {
+ size_t width = 0;
+
+ for (; *str; str++) {
+ wchar_t c;
+ size_t len;
+
+ len = mbrtowc (&c, str, MB_CUR_MAX, NULL);
+
+ if (len == (size_t)(-1) || len == (size_t)(-2)) break;
+
+ if (len > 0) {
+ width ++;
+ str += len-1;
+ }
+ }
+
+ return width;
+ } else
+ return strlen (str);
+}
+#endif
/* This function is a modification of mc-3.2.10/src/view.c:regexp_view_search() */
/* returns -3 on error in pattern, -1 on not found, found_len = 0 if either */
@@ -1581,7 +1607,7 @@
continue;
tmp = string[pmatch[i].rm_so];
string[pmatch[i].rm_so] = 0;
- new_o = mbstrlen(string);
+ new_o = real_mbstrlen(string);
string[pmatch[i].rm_so] = tmp;
pmatch[i].rm_so = new_o;
@@ -1589,7 +1615,7 @@
continue;
tmp = string[pmatch[i].rm_eo];
string[pmatch[i].rm_eo] = 0;
- new_o = mbstrlen(string);
+ new_o = real_mbstrlen(string);
string[pmatch[i].rm_eo] = tmp;
pmatch[i].rm_eo = new_o;
}

View File

@ -0,0 +1,12 @@
--- mc-4.6.2~git20080311/edit/editcmd.c.orig 2008-06-23 02:22:30.000000000 +0200
+++ mc-4.6.2~git20080311/edit/editcmd.c 2008-06-23 02:23:34.000000000 +0200
@@ -1570,7 +1570,8 @@
g_free (old_pattern);
old_pattern = 0;
}
- if (regcomp (&r, pattern, REG_EXTENDED | (icase ? REG_ICASE : 0))) {
+ if (regcomp (&r, pattern, REG_EXTENDED | (icase ? REG_ICASE : 0) |
+ REG_NEWLINE)) {
*found_len = 0;
return -3;
}

227
mc-cvs-fixes.patch Normal file
View File

@ -0,0 +1,227 @@
--- src/achown.c
+++ src/achown.c
@@ -265,7 +265,7 @@
/* get and put user names in the listbox */
setpwent ();
while ((chl_pass = getpwent ())) {
- listbox_add_item (chl_list, LISTBOX_APPEND_AT_END, 0,
+ listbox_add_item (chl_list, LISTBOX_APPEND_SORTED, 0,
chl_pass->pw_name, NULL);
}
endpwent ();
@@ -275,7 +275,7 @@
/* get and put group names in the listbox */
setgrent ();
while ((chl_grp = getgrent ())) {
- listbox_add_item (chl_list, LISTBOX_APPEND_AT_END, 0,
+ listbox_add_item (chl_list, LISTBOX_APPEND_SORTED, 0,
chl_grp->gr_name, NULL);
}
endgrent ();
--- src/chown.c
+++ src/chown.c
@@ -180,14 +180,14 @@
/* get and put user names in the listbox */
setpwent ();
while ((l_pass = getpwent ())) {
- listbox_add_item (l_user, 0, 0, l_pass->pw_name, NULL);
+ listbox_add_item (l_user, LISTBOX_APPEND_SORTED, 0, l_pass->pw_name, NULL);
}
endpwent ();
/* get and put group names in the listbox */
setgrent ();
while ((l_grp = getgrent ())) {
- listbox_add_item (l_group, 0, 0, l_grp->gr_name, NULL);
+ listbox_add_item (l_group, LISTBOX_APPEND_SORTED, 0, l_grp->gr_name, NULL);
}
endgrent ();
--- src/widget.c
+++ src/widget.c
@@ -2402,8 +2402,6 @@
else
l->height = height;
l->count = 0;
- l->top = 0;
- l->current = 0;
l->cback = callback;
l->allow_duplicates = 1;
l->scrollbar = slow_terminal ? 0 : 1;
@@ -2443,6 +2441,22 @@
e->next = l->current->next;
l->current->next->prev = e;
l->current->next = e;
+ } else if (pos == LISTBOX_APPEND_SORTED) {
+ WLEntry *w = l->list;
+
+ while (w->next != l->list && strcmp (e->text, w->text) > 0)
+ w = w->next;
+ if (w->next == l->list) {
+ e->prev = w;
+ e->next = l->list;
+ w->next = e;
+ l->list->prev = e;
+ } else {
+ e->next = w;
+ e->prev = w->prev;
+ w->prev->next = e;
+ w->prev = e;
+ }
}
l->count++;
}
--- src/widget.h
+++ src/widget.h
@@ -181,7 +181,8 @@
enum append_pos {
LISTBOX_APPEND_AT_END, /* append at the end */
LISTBOX_APPEND_BEFORE, /* insert before current */
- LISTBOX_APPEND_AFTER /* insert after current */
+ LISTBOX_APPEND_AFTER, /* insert after current */
+ LISTBOX_APPEND_SORTED /* insert alphabetically */
};
char *listbox_add_item (WListbox *l, enum append_pos pos, int
--- vfs/direntry.c
+++ vfs/direntry.c
@@ -447,7 +447,6 @@
CALL (free_archive) (me, super);
g_free (super->name);
- super->name = NULL;
g_free(super);
}
--- vfs/fish.c
+++ vfs/fish.c
@@ -355,6 +355,7 @@
struct vfs_s_entry *ent = NULL;
FILE *logfile;
char *quoted_path;
+ int reply_code;
logfile = MEDATA->logfile;
@@ -365,6 +366,8 @@
quoted_path = name_quote (remote_path, 0);
fish_command (me, super, NONE,
"#LIST /%s\n"
+ "if ls -1 /%s >/dev/null 2>&1 ;\n"
+ "then\n"
"ls -lLan /%s 2>/dev/null | grep '^[^cbt]' | (\n"
"while read p l u g s m d y n; do\n"
"echo \"P$p $u.$g\nS$s\nd$m $d $y\n:$n\n\"\n"
@@ -375,8 +378,11 @@
"echo \"P$p $u.$g\nE$a$i\nd$m $d $y\n:$n\n\"\n"
"done\n"
")\n"
- "echo '### 200'\n",
- remote_path, quoted_path, quoted_path);
+ "echo '### 200'\n"
+ "else\n"
+ "echo '### 500'\n"
+ "fi\n",
+ remote_path, quoted_path, quoted_path, quoted_path);
g_free (quoted_path);
ent = vfs_s_generate_entry(me, NULL, dir, 0);
while (1) {
@@ -455,17 +461,21 @@
}
vfs_s_free_entry (me, ent);
- me->verrno = E_REMOTE;
- if (fish_decode_reply(buffer+4, 0) == COMPLETE) {
+ reply_code = fish_decode_reply(buffer + 4, 0);
+ if (reply_code == COMPLETE) {
g_free (SUP.cwdir);
SUP.cwdir = g_strdup (remote_path);
print_vfs_message (_("%s: done."), me->name);
return 0;
+ } else if (reply_code == ERROR) {
+ me->verrno = EACCES;
+ } else {
+ me->verrno = E_REMOTE;
}
error:
print_vfs_message (_("%s: failure"), me->name);
- return 1;
+ return -1;
}
static int
@@ -618,25 +628,39 @@
g_free (name);
name = quoted_name;
fh->u.fish.append = 0;
+
+ /*
+ * Check whether the remote file is readable by using `dd' to copy
+ * a single byte from the remote file to /dev/null. If `dd' completes
+ * with exit status of 0 use `cat' to send the file contents to the
+ * standard output (i.e. over the network).
+ */
offset = fish_command (me, FH_SUPER, WANT_STRING,
"#RETR /%s\n"
+ "if dd if=/%s of=/dev/null bs=1 count=1 2>/dev/null ;\n"
+ "then\n"
"ls -ln /%s 2>/dev/null | (\n"
"read p l u g s r\n"
"echo \"$s\"\n"
")\n"
"echo '### 100'\n"
"cat /%s\n"
- "echo '### 200'\n",
- name, name, name );
+ "echo '### 200'\n"
+ "else\n"
+ "echo '### 500'\n"
+ "fi\n",
+ name, name, name, name );
g_free (name);
if (offset != PRELIM) ERRNOR (E_REMOTE, 0);
fh->linear = LS_LINEAR_OPEN;
fh->u.fish.got = 0;
-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 || (defined _LARGE_FILES && _LARGE_FILES)
- if (sscanf( reply_str, "%llu", &fh->u.fish.total )!=1)
+ errno = 0;
+#if SIZEOF_OFF_T == SIZEOF_LONG
+ fh->u.fish.total = strtol (reply_str, NULL, 10);
#else
- if (sscanf( reply_str, "%u", &fh->u.fish.total )!=1)
+ fh->u.fish.total = strtoll (reply_str, NULL, 10);
#endif
+ if (errno != 0)
ERRNOR (E_REMOTE, 0);
return 1;
}
@@ -760,7 +784,7 @@
POSTFIX(OPT_FLUSH);
}
-#define FISH_OP(name, chk, string) \
+#define FISH_OP(name, string) \
static int fish_##name (struct vfs_class *me, const char *path1, const char *path2) \
{ \
char buf[BUF_LARGE]; \
@@ -786,13 +810,12 @@
return fish_send_command(me, super2, buf, OPT_FLUSH); \
}
-#define XTEST if (bucket1 != bucket2) { ERRNOR (EXDEV, -1); }
-FISH_OP(rename, XTEST, "#RENAME /%s /%s\n"
- "mv /%s /%s 2>/dev/null\n"
- "echo '### 000'" )
-FISH_OP(link, XTEST, "#LINK /%s /%s\n"
- "ln /%s /%s 2>/dev/null\n"
- "echo '### 000'" )
+FISH_OP(rename, "#RENAME /%s /%s\n"
+ "mv /%s /%s 2>/dev/null\n"
+ "echo '### 000'" )
+FISH_OP(link, "#LINK /%s /%s\n"
+ "ln /%s /%s 2>/dev/null\n"
+ "echo '### 000'" )
static int fish_symlink (struct vfs_class *me, const char *setto, const char *path)
{

14
mc-f-keys.patch Normal file
View File

@ -0,0 +1,14 @@
--- src/key.c
+++ src/key.c
@@ -233,6 +233,11 @@
{ KEY_F(9), ESC_STR "[20~", MCKEY_NOACTION },
{ KEY_F(10), ESC_STR "[21~", MCKEY_NOACTION },
+ { KEY_M_SHIFT | KEY_F(1), ESC_STR "[1;2P", MCKEY_NOACTION },
+ { KEY_M_SHIFT | KEY_F(2), ESC_STR "[1;2Q", MCKEY_NOACTION },
+ { KEY_M_SHIFT | KEY_F(3), ESC_STR "[1;2R", MCKEY_NOACTION },
+ { KEY_M_SHIFT | KEY_F(4), ESC_STR "[1;2S", MCKEY_NOACTION },
+
/* old xterm Shift-arrows */
{ KEY_M_SHIFT | KEY_UP, ESC_STR "O2A", MCKEY_NOACTION },
{ KEY_M_SHIFT | KEY_DOWN, ESC_STR "O2B", MCKEY_NOACTION },

View File

@ -45,12 +45,10 @@
$RPM -qp --qf "[%{OBSOLETES}\n]" "$f" | grep "(none)" > /dev/null || $RPM -qp --qf "[%{OBSOLETES}\n]" "$f" | grep "(none)" > /dev/null ||
echo "$FILEPREF 0 $DATE INFO/OBSOLETES" echo "$FILEPREF 0 $DATE INFO/OBSOLETES"
$RPM -qp --qf "[%{PROVIDES}\n]" "$f" | grep "(none)" > /dev/null || $RPM -qp --qf "[%{PROVIDES}\n]" "$f" | grep "(none)" > /dev/null ||
@@ -128,8 +136,10 @@ @@ -130,6 +138,10 @@
echo "$FILEPREF 0 $DATE INFO/CHANGELOG"
else
echo "$FILEPREF 0 $DATE INFO/REQUIRENAME" echo "$FILEPREF 0 $DATE INFO/REQUIRENAME"
- echo "$FILEPREF 0 $DATE INFO/OBSOLETES" echo "$FILEPREF 0 $DATE INFO/OBSOLETES"
- echo "$FILEPREF 0 $DATE INFO/PROVIDES" echo "$FILEPREF 0 $DATE INFO/PROVIDES"
+ echo "$FILEPREF 0 $DATE INFO/ENHANCES" + echo "$FILEPREF 0 $DATE INFO/ENHANCES"
+ echo "$FILEPREF 0 $DATE INFO/SUGGESTS" + echo "$FILEPREF 0 $DATE INFO/SUGGESTS"
+ echo "$FILEPREF 0 $DATE INFO/RECOMMENDS" + echo "$FILEPREF 0 $DATE INFO/RECOMMENDS"
@ -58,7 +56,7 @@
echo "$FILEPREF 0 $DATE INFO/CONFLICTS" echo "$FILEPREF 0 $DATE INFO/CONFLICTS"
echo "$FILEPREF 0 $DATE INFO/CHANGELOG" echo "$FILEPREF 0 $DATE INFO/CHANGELOG"
fi fi
@@ -162,6 +172,10 @@ @@ -162,6 +174,10 @@
INFO/LICENSE) $RPM -qp --qf "%{LICENSE}\n" "$f" >"$3"; exit 0;; INFO/LICENSE) $RPM -qp --qf "%{LICENSE}\n" "$f" >"$3"; exit 0;;
INFO/RPMVERSION) $RPM -qp --qf "%{RPMVERSION}\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/REQUIRENAME) $RPM -qp --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" "$f" >"$3"; exit 0;;

214
mc-utf8-look-and-feel.patch Normal file
View File

@ -0,0 +1,214 @@
Index: mc-4.6.2~git20080311/src/main.c
===================================================================
--- mc-4.6.2~git20080311.orig/src/main.c 2008-05-18 14:10:20.000000000 +0200
+++ mc-4.6.2~git20080311/src/main.c 2008-05-18 14:11:06.000000000 +0200
@@ -276,6 +276,9 @@
/* The user's shell */
const char *shell = NULL;
+/* Is the LANG UTF-8 ? */
+gboolean is_utf8 = FALSE;
+
/* mc_home: The home of MC */
char *mc_home = NULL;
@@ -2141,6 +2144,16 @@
/* if on, it displays the information that files have been moved to ~/.mc */
int show_change_notice = 0;
+ /* Check whether we have UTF-8 locale */
+ char *lang = getenv("LANG");
+ size_t len = 0;
+
+ if ( lang )
+ len = strlen(lang);
+
+ if ( len >= 5 && !strcasecmp(&lang[len-5],"UTF-8") )
+ is_utf8 = TRUE;
+
/* We had LC_CTYPE before, LC_ALL includs LC_TYPE as well */
setlocale (LC_ALL, "");
bindtextdomain ("mc", LOCALEDIR);
Index: mc-4.6.2~git20080311/src/widget.c
===================================================================
--- mc-4.6.2~git20080311.orig/src/widget.c 2008-05-18 14:10:20.000000000 +0200
+++ mc-4.6.2~git20080311/src/widget.c 2008-05-18 14:10:26.000000000 +0200
@@ -1946,52 +1946,86 @@
return in;
}
-
-/* Listbox widget */
-
-/* Should draw the scrollbar, but currently draws only
- * indications that there is more information
- */
-static int listbox_cdiff (WLEntry *s, WLEntry *e);
+/* Vertical scrollbar widget */
-static void
-listbox_drawscroll (WListbox *l)
+void
+vscrollbar (Widget widget, int height, int width, int tpad, int bpad,
+ int selected, int count, gboolean color)
{
int line;
- int i, top;
- int max_line = l->height-1;
-
+ int i;
+
/* Are we at the top? */
- widget_move (&l->widget, 0, l->width);
- if (l->list == l->top)
- one_vline ();
+ widget_move (&widget, tpad, width);
+#ifndef UTF8
+ if (!selected)
+ one_vline ();
else
- addch ('^');
+ addch ('^');
+#else
+ if (color) attrset (MARKED_COLOR);
+ if (is_utf8)
+ SLsmg_write_string("▴");
+ else
+ addch ('^');
+ if (color) attrset (NORMAL_COLOR);
+#endif
/* Are we at the bottom? */
- widget_move (&l->widget, max_line, l->width);
- top = listbox_cdiff (l->list, l->top);
- if ((top + l->height == l->count) || l->height >= l->count)
- one_vline ();
+ widget_move (&widget, height-1-bpad, width);
+#ifndef UTF8
+ if (selected == count-1)
+ one_vline ();
+ else
+ addch ('v');
+#else
+ if (color) attrset (MARKED_COLOR);
+ if (is_utf8)
+ SLsmg_write_string("▾");
else
- addch ('v');
+ addch('v');
+ if (color) attrset (NORMAL_COLOR);
+#endif
/* Now draw the nice relative pointer */
- if (l->count)
- line = 1+ ((l->pos * (l->height-2)) / l->count);
+ if (count > 1)
+ line = tpad + 1 + ((selected * (height-3-tpad-bpad)) / (count-1));
else
- line = 0;
-
- for (i = 1; i < max_line; i++){
- widget_move (&l->widget, i, l->width);
- if (i != line)
- one_vline ();
- else
- addch ('*');
+ line = 0;
+
+ for (i = tpad + 1; i < height-1-bpad; i++){
+ widget_move (&widget, i, width);
+ if (i != line)
+#ifndef UTF8
+ one_vline ();
+ else
+ addch ('*');
+#else
+ if (is_utf8)
+ SLsmg_write_string("▒");
+ else
+ one_vline();
+ else {
+ if (color) attrset (MARKED_COLOR);
+ if (is_utf8)
+ SLsmg_write_string("◈");
+ else
+ addch('*');
+ if (color) attrset (NORMAL_COLOR);
+ }
+#endif
}
}
-
-static void
+
+
+/* Listbox widget */
+
+/* Should draw the scrollbar, but currently draws only
+ * indications that there is more information
+ */
+static int listbox_cdiff (WLEntry *s, WLEntry *e);
+
+void
listbox_draw (WListbox *l, int focused)
{
WLEntry *e;
@@ -2032,7 +2066,7 @@
if (!l->scrollbar)
return;
attrset (normalc);
- listbox_drawscroll (l);
+ vscrollbar (l->widget, l->height, l->width, 0, 0, l->pos, l->count, FALSE);
}
/* Returns the number of items between s and e,
Index: mc-4.6.2~git20080311/src/screen.c
===================================================================
--- mc-4.6.2~git20080311.orig/src/screen.c 2008-05-18 14:10:20.000000000 +0200
+++ mc-4.6.2~git20080311/src/screen.c 2008-05-18 14:10:26.000000000 +0200
@@ -889,6 +889,9 @@
}
#endif /* HAVE_SLANG */
+ vscrollbar (panel->widget, panel->widget.lines, panel->widget.cols-1, 2, 2,
+ panel->selected, panel->count, TRUE);
+
if (panel->active)
attrset (REVERSE_COLOR);
@@ -1489,7 +1492,7 @@
panel->dirty = 1;
/* Status needn't to be split */
- usable_columns = ((panel->widget.cols-2)/((isstatus)
+ usable_columns = ((panel->widget.cols-3)/((isstatus)
? 1
: (panel->split+1))) - (!isstatus && panel->split);
Index: mc-4.6.2~git20080311/src/widget.h
===================================================================
--- mc-4.6.2~git20080311.orig/src/widget.h 2008-05-18 14:10:20.000000000 +0200
+++ mc-4.6.2~git20080311/src/widget.h 2008-05-18 14:10:26.000000000 +0200
@@ -169,6 +169,10 @@
/* Listbox manager */
WLEntry *listbox_get_data (WListbox *l, int pos);
+/* Vertical scrollbar */
+void vscrollbar (Widget widget, int height, int width, int tpad, int bpad,
+ int selected, int count, gboolean color);
+
/* search text int listbox entries */
WLEntry *listbox_search_text (WListbox *l, const char *text);
void listbox_select_entry (WListbox *l, WLEntry *dest);
Index: mc-4.6.2~git20080311/src/main.h
===================================================================
--- mc-4.6.2~git20080311.orig/src/main.h 2008-02-19 18:25:27.000000000 +0100
+++ mc-4.6.2~git20080311/src/main.h 2008-05-18 14:10:26.000000000 +0200
@@ -69,6 +69,7 @@
extern int only_leading_plus_minus;
extern int output_starts_shell;
extern int midnight_shutdown;
+extern gboolean is_utf8;
extern char cmd_buf [512];
extern const char *shell;

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Sep 9 18:05:39 CEST 2008 - nadvornik@suse.cz
- added bugfixes from upstream cvs and from debian package for
* preserve Attributes checkbox [bnc#419832]
* fish filesystem [bnc#400515]
* regexp matching
* lzma support [bnc#400388]
* other fixes and improvements
- fixed information displayed for rpm files [bnc#410704]
- partialy fixed SHIFT-Fn key behavior [bnc#400552]
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Mar 31 18:30:47 CEST 2008 - nadvornik@suse.cz Mon Mar 31 18:30:47 CEST 2008 - nadvornik@suse.cz

71
mc.spec
View File

@ -2,9 +2,16 @@
# spec file for package mc (Version 4.6.2.pre1) # spec file for package mc (Version 4.6.2.pre1)
# #
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
# #
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via http://bugs.opensuse.org/
# #
@ -19,7 +26,7 @@ Group: Productivity/File utilities
PreReq: permissions PreReq: permissions
AutoReqProv: on AutoReqProv: on
Version: 4.6.2.pre1 Version: 4.6.2.pre1
Release: 50 Release: 116
Summary: Midnight Commander Summary: Midnight Commander
Source: mc-4.6.2-pre1.tar.bz2 Source: mc-4.6.2-pre1.tar.bz2
Source1: x11_browser Source1: x11_browser
@ -42,6 +49,28 @@ Patch15: mc-utf8-nlink.patch
Patch16: mc-esc-seq.patch Patch16: mc-esc-seq.patch
Patch17: mc-rpm.patch Patch17: mc-rpm.patch
Patch18: mc-cursor-appearance.patch Patch18: mc-cursor-appearance.patch
Patch19: mc-cvs-fixes.patch
Patch20: mc-f-keys.patch
#debian fixes for utf8
Patch22: mc-utf8-look-and-feel.patch
#debian fixes for vfs
Patch23: 01_ftpfs_symlink.patch
Patch24: 02_ignore_ftp_chmod_error.patch
Patch25: 03_fix_whitespace_via_fish.patch
Patch26: 04_error_on_copymove_over_fish.patch
Patch28: 05_add_lzma_support.patch
Patch30: 06_remove_obsolete_rpm_tags.patch
Patch32: 08_improved_u7z_support.patch
Patch33: 09_choose_correct_urar.patch
#other debian fixes
Patch34: 28_mc-dontrewrite.patch
Patch35: 61_escaping.patch
Patch36: 64_visible_tabs.patch
Patch37: 99a_fix-regex-bol-match.patch
Patch38: 99b_fix-regex-pattern-lengths.patch
Patch39: 99c_fix-regex-newline-match.patch
Patch40: 99_regexp-replace-fixed.patch
Patch41: 100_fix_bashisms.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://www.ibiblio.org/mc/ Url: http://www.ibiblio.org/mc/
Requires: %{name}-lang = %{version} Requires: %{name}-lang = %{version}
@ -125,6 +154,25 @@ Authors:
%patch16 %patch16
%patch17 %patch17
%patch18 %patch18
%patch19
%patch20
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch28 -p1
%patch30 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%build %build
pushd po pushd po
@ -167,13 +215,7 @@ popd
popd popd
autoreconf --force --install autoreconf --force --install
%define warn_flags -W -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security -Wno-unused-parameter %define warn_flags -W -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security -Wno-unused-parameter
%if %suse_version > 1000 export CFLAGS="$RPM_OPT_FLAGS %{warn_flags}"
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fstack-protector"
%endif
CFLAGS="$RPM_OPT_FLAGS %{warn_flags}"
# LIBS=-L/usr/X11R6/lib
# _libdir=%{_libdir}
export CFLAGS #LIBS _libdir
./configure \ ./configure \
--mandir=%{_mandir} \ --mandir=%{_mandir} \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
@ -226,6 +268,15 @@ rm -rf %{buildroot}
%files lang -f %{name}.lang %files lang -f %{name}.lang
%changelog %changelog
* Tue Sep 09 2008 nadvornik@suse.cz
- added bugfixes from upstream cvs and from debian package for
* preserve Attributes checkbox [bnc#419832]
* fish filesystem [bnc#400515]
* regexp matching
* lzma support [bnc#400388]
* other fixes and improvements
- fixed information displayed for rpm files [bnc#410704]
- partialy fixed SHIFT-Fn key behavior [bnc#400552]
* Mon Mar 31 2008 nadvornik@suse.cz * Mon Mar 31 2008 nadvornik@suse.cz
- fixed cursor appearance on visible tabs - fixed cursor appearance on visible tabs
* Mon Nov 05 2007 nadvornik@suse.cz * Mon Nov 05 2007 nadvornik@suse.cz