From 0b25d26cf099a36f09a7f3df6963abf123911b4c Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 25 Feb 2000 12:53:06 +0000 Subject: [PATCH] 2000-02-25 Pavel Machek Patch by Andrew V. Samoilov * vfs.[ch] (vfs_canon, mc_open, vfs_file_is_local, mc_(un)?getlocalcopy): added const qualifier (mc_def_getlocalcopy): tempnam() returns malloc()ed buffer, so, free() it, not g_free(); (vfs_canon): prepend filename by cwd when tilde '~' cannot be expanded; --- vfs/ChangeLog | 10 ++++++++++ vfs/cpio.c | 4 ++-- vfs/fish.c | 1 + vfs/ftpfs.c | 3 +++ vfs/ftpfs.h | 4 ++-- vfs/smbfs.c | 2 +- vfs/vfs.h | 4 ++-- vfs/xdirentry.h | 2 +- 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 07c5cb1d0..91a565d36 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,13 @@ +2000-02-25 Pavel Machek + + Patch by Andrew V. Samoilov + + * vfs.[ch] (vfs_canon, mc_open, vfs_file_is_local, + mc_(un)?getlocalcopy): added const qualifier + (mc_def_getlocalcopy): tempnam() returns malloc()ed buffer, + so, free() it, not g_free(); + (vfs_canon): prepend filename by cwd when tilde '~' cannot be expanded; + 2000-02-23 Pavel Machek * cpio.c: cpio.h is missing, so don't try to include it. (It is diff --git a/vfs/cpio.c b/vfs/cpio.c index 5ba79975e..9accc19ad 100644 --- a/vfs/cpio.c +++ b/vfs/cpio.c @@ -39,7 +39,7 @@ enum { STATUS_OK, STATUS_TRAIL, STATUS_FAIL, - STATUS_EOF, + STATUS_EOF }; enum { @@ -101,7 +101,7 @@ static int cpio_create_entry(vfs *me, vfs_s_super *super, struct stat *stat, cha static int cpio_read(void *fh, char *buffer, int count); #define CPIO_POS(super) cpio_position -/* #define CPIO_POS(super) (super)->u.cpio.fd /* If some time reentrancy should be needed */ +//#define CPIO_POS(super) (super)->u.cpio.fd /* If some time reentrancy should be needed */ #define CPIO_SEEK_SET(super, where) mc_lseek((super)->u.cpio.fd, CPIO_POS(super) = (where), SEEK_SET) #define CPIO_SEEK_CUR(super, where) mc_lseek((super)->u.cpio.fd, CPIO_POS(super) += (where), SEEK_SET) diff --git a/vfs/fish.c b/vfs/fish.c index 4e8f392e1..9462ae85c 100644 --- a/vfs/fish.c +++ b/vfs/fish.c @@ -38,6 +38,7 @@ #undef HAVE_HACKED_SSH #include "utilvfs.h" +#include "../src/dialog.h" /* For MSG_ERROR */ #include "xdirentry.h" #include "vfs.h" diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index 5f0796c18..a79374c1d 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -154,6 +154,9 @@ static char reply_str [80]; c) strip trailing "/." */ +static char *ftpfs_get_current_directory (vfs *me, vfs_s_super *super); +static int ftpfs_chdir_internal (vfs *me, vfs_s_super *super, char *remote_path); + static char * translate_path (vfs *me, vfs_s_super *super, const char *remote_path) { diff --git a/vfs/ftpfs.h b/vfs/ftpfs.h index b8f0b27fa..3a4eb95e0 100644 --- a/vfs/ftpfs.h +++ b/vfs/ftpfs.h @@ -1,5 +1,7 @@ /* ftpfs.h */ +/* $Id$ */ + #if !defined(__FTPFS_H) #define __FTPFS_H @@ -90,8 +92,6 @@ extern int ftpfs_directory_timeout; extern int ftpfs_always_use_proxy; void ftpfs_init_passwd (void); -static char *ftpfs_get_current_directory (vfs *me, vfs_s_super *super); -static int ftpfs_chdir_internal (vfs *me, vfs_s_super *super, char *remote_path); #define OPT_FLUSH 1 #define OPT_IGNORE_ERROR 2 diff --git a/vfs/smbfs.c b/vfs/smbfs.c index d6f129a0e..a4ceffa91 100644 --- a/vfs/smbfs.c +++ b/vfs/smbfs.c @@ -1239,7 +1239,7 @@ smbfs_open_link(char *host, char *path, char *user, int *port, char *this_pass) if (my_errno != EPERM) return 0; message_1s (1, MSG_ERROR, - " Authentication failed "); + _(" Authentication failed ")); /* authentication failed, try again */ authinfo_remove (bucket->host, bucket->service); diff --git a/vfs/vfs.h b/vfs/vfs.h index f67d26942..8d9bf08d1 100644 --- a/vfs/vfs.h +++ b/vfs/vfs.h @@ -157,7 +157,7 @@ struct utimbuf { void vfs_rm_parents (struct vfs_stamping *stamp); char *vfs_path (char *path); char *vfs_strip_suffix_from_filename (char *filename); - char *vfs_canon (char *path); + char *vfs_canon (const char *path); char *mc_get_current_wd (char *buffer, int bufsize); int vfs_current_is_local (void); #if 0 @@ -165,7 +165,7 @@ struct utimbuf { int vfs_current_is_tarfs (void); int vfs_current_is_cpiofs (void); #endif - int vfs_file_is_local (char *name); + int vfs_file_is_local (const char *name); int vfs_file_is_ftp (char *filename); int vfs_file_is_smb (char *filename); char *vfs_get_current_dir (void); diff --git a/vfs/xdirentry.h b/vfs/xdirentry.h index eb5b6edd5..20d64cdb3 100644 --- a/vfs/xdirentry.h +++ b/vfs/xdirentry.h @@ -123,7 +123,7 @@ typedef struct vfs_s_super { int fd; struct stat stat; int type; /* Type of the archive */ - /* int pos; /* In case reentrancy will be needed */ + /*int pos; In case reentrancy will be needed */ struct defer_inode *defered; /* List of inodes for which another entries may appear */ } cpio; } u;