This patch fixes the bug.
Apply this patch to fish.c
I have tested it, and it works.
After the patch it is possible to specify the port number in a shell
link like this:
/#sh:[EMAIL PROTECTED]:3000/home/foo/
---
Mange venlige hilsner/Best regards
Kim Lesmer
Programmer/Unix systemadministrator
Web : www.bitflop.com
E-mail : [EMAIL PROTECTED]
--- fish.c~ 2006-10-27 14:23:29.000000000 +0300
+++ fish.c 2006-10-27 14:56:12.000000000 +0300
@@ -214,7 +214,8 @@ static int
fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
{
{
- const char *argv[10];
+ char gbuf[10];
+ const char *argv[10]; /* All of 10 is used now */
const char *xsh = (SUP.flags == FISH_FLAG_RSH ? "rsh" : "ssh");
int i = 0;
@@ -224,6 +225,11 @@ fish_open_archive_int (struct vfs_class
#endif
if (SUP.flags == FISH_FLAG_COMPRESSED)
argv[i++] = "-C";
+ if (SUP.flags > FISH_FLAG_RSH) {
+ argv[i++] = "-p";
+ g_snprintf (gbuf, sizeof (gbuf), "%d", SUP.flags);
+ argv[i++] = gbuf;
+ }
argv[i++] = "-l";
argv[i++] = SUP.user;
argv[i++] = SUP.host;
@@ -323,7 +329,7 @@ fish_open_archive (struct vfs_class *me,
SUP.user = user;
SUP.flags = flags;
if (!strncmp (op, "rsh:", 4))
- SUP.flags |= FISH_FLAG_RSH;
+ SUP.flags = FISH_FLAG_RSH;
SUP.cwdir = NULL;
if (password)
SUP.password = password;
@@ -913,22 +919,23 @@ static void
fish_fill_names (struct vfs_class *me, fill_names_f func)
{
struct vfs_s_super *super = MEDATA->supers;
- const char *flags;
char *name;
-
+ char gbuf[10];
+
while (super){
- switch (SUP.flags & (FISH_FLAG_RSH | FISH_FLAG_COMPRESSED)) {
+ const char *flags = "";
+ switch (SUP.flags) {
case FISH_FLAG_RSH:
flags = ":r";
break;
case FISH_FLAG_COMPRESSED:
flags = ":C";
break;
- case FISH_FLAG_RSH | FISH_FLAG_COMPRESSED:
- flags = "";
- break;
default:
- flags = "";
+ if (SUP.flags > FISH_FLAG_RSH) {
+ g_snprintf (gbuf, sizeof (gbuf), ":%d", SUP.flags);
+ flags = gbuf;
+ }
break;
}