diff --git a/vfs/ChangeLog b/vfs/ChangeLog index a78be3c82..a3372b49f 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,7 @@ +1998-05-26 Miguel de Icaza + + * vfs.c (MC_DIROP): Macro now returns the proper value. + 1998-maj-18 Tamasi Gyorgy (gt_cosy@usa.net) * Makefile.in ('install' target): 'mcserv' not installed, if diff --git a/vfs/vfs.c b/vfs/vfs.c index bfce269c4..59e218c98 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -412,15 +412,31 @@ type mc_##name inarg \ \ if (!dirp){ \ errno = EFAULT; \ - return NULL; \ + return onerr; \ } \ handle = *(int *) dirp; \ vfs = vfs_op (handle); \ return vfs->name ? (*vfs->name) callarg : onerr; \ } +#define MC_DIROP_VOID(name, inarg, callarg ) \ +void mc_##name inarg \ +{ \ + int handle; \ + vfs *vfs; \ +\ + if (!dirp){ \ + errno = EFAULT; \ + return; \ + } \ + handle = *(int *) dirp; \ + vfs = vfs_op (handle); \ + if (vfs->name) \ + (*vfs->name) callarg; \ +} + MC_DIROP (readdir, struct dirent *, (DIR *dirp), (vfs_info (handle)), NULL) -MC_DIROP (seekdir, void, (DIR *dirp, int offset), (vfs_info (handle), offset), -1) +MC_DIROP_VOID (seekdir, (DIR *dirp, int offset), (vfs_info (handle), offset)) MC_DIROP (telldir, int, (DIR *dirp), (vfs_info (handle)), -1) int mc_closedir (DIR *dirp) @@ -1504,6 +1520,6 @@ vfs_die (char *m) char * vfs_get_password (char *msg) { - return input_dialog (msg, _("Password:"), ""); + return (char *) input_dialog (msg, _("Password:"), ""); } #endif