Sun May 10 13:21:45 1998 Norbert Warmuth <k3190@fh-sw.de>
* edit/syntax.c: Disable debug messages on stderr. * edit/edit.h: Added missing _() Sun May 10 14:51:03 1998 Norbert Warmuth <k3190@fh-sw.de> * ftpfs.c (__ftpfs_chdir): CWD command wasn't sent at all. This optimation is wrong because for directories containing spaces we have to "CWD <pathname>" and "LIST -la" instead of "LIST -la <pathname>". I implemented a different optimation. Now ftpfs_chdir only stores the new working directory and sets a flag. __ftpfs_chdir is called when we really want to change the directory on the ftp server. (resolve_symlink): Log the directory listing to the logfile. * ftpfs.h (struct ftpfs_connection): Added a (per connection) cwd_defered flag. Sun May 10 13:27:50 1998 Norbert Warmuth <k3190@fh-sw.de> * widget.c (handle_char): Don't try to to delete default text in input widget more than once. Right after MC's start copy_filename (ESC Enter) failed because a flag wasn't cleared while characters were stuffed into the commandline (Andrej reported this bug). * main.c (copy_readlink): usr mc_readlink instead of readlink * file.c: Changed default for the copy/move option "dive into subdir if exists" to off (note: this was only possible after the change in setup.c). (copy_dir_dir): Activated the previously uncommented code which implements "Dive into subdirs". Even when there's no case where we actually would like that behaviour it is a documented feature. Though I don't wanted to change the default behavour. Hence the option change. (file_mask_defaults): set dive_into_subdirs (file_mask_dialog): Fix for debian Bug #20727: Move operation with "[ ] Dive into subdir if exists" and destination filename not wildcarded. If destination is an existing directory then files will be moved into this directory. If destination is not an existing directory then src file will be renamed (one file selected) or an error will be displayed (more than one file selected). (file_mask_dialog): made the option "Using shell patterns" local to the current copy/move operation, i.e. this option is always initialized with the global options's value. Previously it affected the global Options/Configuration/shell Patterns. Another possiblilty would be to make the global option a default option on startup and keep changes in the copy/move dialog (without saving these changes with save setup). * setup.c: Don't save and load options which can be changed outside the options menu. For example I don't like that preserve_uid_gid and dive_into_subdirs from the copy/move dialog are saved and restored (strange, what about the other options from this dialog?). It would be much cleaner to make these option read-only. This way one could edit ~/.mc/ini to provide default option setting on startup and "Save setup" wouldn't have side effects outside the option's menu. Sun May 10 13:24:20 1998 Norbert Warmuth <k3190@fh-sw.de> * doc/mc.1.in, doc/mc.sgml, mc.hlp: Updated to reflect new default for dive into subdirs.
Этот коммит содержится в:
родитель
d51b0cacff
Коммит
293b05aaac
19
doc/mc.1.in
19
doc/mc.1.in
@ -2081,15 +2081,18 @@ Follow links tells whether make the symlinks and hardlinks in the source
|
||||
directory (recursively in subdirectories) new links in the target
|
||||
directory or whether would you like to copy their content.
|
||||
.PP
|
||||
Dive into subdirs tells what to do if in the target directory exists a
|
||||
directory with the same name as the file/directory being copied. The default
|
||||
action is to copy it into that directory, by disabling this you can copy a
|
||||
directory's content into that directory. Perhaps an example will help:
|
||||
Dive into subdirs tells what to do if in the target
|
||||
directory exists a directory with the same name as the
|
||||
file/directory being copied. The default action is to copy
|
||||
it's content into that directory, by enabling this
|
||||
you can copy the source directory into that directory.
|
||||
Perhaps an example will help:
|
||||
.PP
|
||||
You want to copy content of a directory foo to /bla/foo, which is an already
|
||||
existing directory. Normally (when Dive is set), mc would copy the content
|
||||
into /bla/foo/foo, 'cause the directory already exists. By disabling this
|
||||
option you will copy it exactly into /bla/foo.
|
||||
You want to copy content of a directory foo to /bla/foo,
|
||||
which is an already existing directory. Normally (when
|
||||
Dive is not set), mc would copy it exactly into /bla/foo.
|
||||
By enabling this option you will copy the content into /bla/foo/foo,
|
||||
because the directory already exists.
|
||||
.PP
|
||||
Preserve attributes tells whether to preserve the original files'
|
||||
permissions, timestamps and if you are root whether to preserve
|
||||
|
12
doc/mc.sgml
12
doc/mc.sgml
@ -1761,15 +1761,15 @@ keep short symlinks inside inodes and thus don't waste much disk space).
|
||||
<tag/Dive into subdirs/ tells what to do if in the target
|
||||
directory exists a directory with the same name as the
|
||||
file/directory being copied. The default action is to copy
|
||||
it into that directory, by disabling this you can copy a
|
||||
directory's content into that directory. Perhaps an
|
||||
example will help:
|
||||
it's content into that directory, by enabling this
|
||||
you can copy the source directory into that directory.
|
||||
Perhaps an example will help:
|
||||
|
||||
You want to copy content of a directory foo to /bla/foo,
|
||||
which is an already existing directory. Normally (when
|
||||
Dive is set), mc would copy the content into /bla/foo/foo,
|
||||
because the directory already exists. By disabling this
|
||||
option you will copy it exactly into /bla/foo.
|
||||
Dive is not set), mc would copy it exactly into /bla/foo.
|
||||
By enabling this option you will copy the content into /bla/foo/foo,
|
||||
because the directory already exists.
|
||||
|
||||
<tag/Preserve attributes/ tells whether to preserve the
|
||||
original files' permissions, timestamps and if you are
|
||||
|
@ -473,8 +473,8 @@ void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg);
|
||||
# define mkdir(s,m) mc_mkdir(s,m)
|
||||
# define itoa MY_itoa
|
||||
|
||||
# define edit_get_load_file(d,f,h) input_dialog (h, " Enter file name: ", f)
|
||||
# define edit_get_save_file(d,f,h) input_dialog (h, " Enter file name: ", f)
|
||||
# define edit_get_load_file(d,f,h) input_dialog (h, _(" Enter file name: "), f)
|
||||
# define edit_get_save_file(d,f,h) input_dialog (h, _(" Enter file name: "), f)
|
||||
# define CMalloc(x) malloc(x)
|
||||
|
||||
# define set_error_msg(s) edit_init_error_msg = strdup(s)
|
||||
|
@ -231,7 +231,7 @@ static int compare_word_to_left (WEdit * edit, long i, char *text, char *whole_l
|
||||
}
|
||||
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
#define debug_printf(x,y) fprintf(stderr,x,y)
|
||||
#else
|
||||
#define debug_printf(x,y)
|
||||
|
@ -1,3 +1,61 @@
|
||||
Sun May 10 13:27:50 1998 Norbert Warmuth <k3190@fh-sw.de>
|
||||
|
||||
* widget.c (handle_char): Don't try to to delete default text in
|
||||
input widget more than once. Right after MC's start copy_filename
|
||||
(ESC Enter) failed because a flag wasn't cleared while characters
|
||||
were stuffed into the commandline (Andrej reported this bug).
|
||||
|
||||
* main.c (copy_readlink): usr mc_readlink instead of readlink
|
||||
|
||||
* file.c: Changed default for the copy/move option "dive into
|
||||
subdir if exists" to off (note: this was only possible after the
|
||||
change in setup.c).
|
||||
|
||||
(copy_dir_dir): Activated the previously uncommented code which
|
||||
implements "Dive into subdirs". Even when there's no case where we
|
||||
actually would like that behaviour it is a documented feature.
|
||||
Though I don't wanted to change the default behavour. Hence the
|
||||
option change.
|
||||
|
||||
(file_mask_defaults): set dive_into_subdirs
|
||||
|
||||
(file_mask_dialog): Fix for debian Bug #20727: Move operation with
|
||||
"[ ] Dive into subdir if exists" and destination filename not
|
||||
wildcarded. If destination is an existing directory then files
|
||||
will be moved into this directory. If destination is not an
|
||||
existing directory then src file will be renamed (one file
|
||||
selected) or an error will be displayed (more than one file
|
||||
selected).
|
||||
|
||||
(file_mask_dialog): made the option "Using shell patterns" local
|
||||
to the current copy/move operation, i.e. this option is always
|
||||
initialized with the global options's value. Previously it affected
|
||||
the global Options/Configuration/shell Patterns.
|
||||
Another possiblilty would be to make the global option a default
|
||||
option on startup and keep changes in the copy/move dialog
|
||||
(without saving these changes with save setup).
|
||||
|
||||
* setup.c: Don't save and load options which can be changed
|
||||
outside the options menu. For example I don't like that
|
||||
preserve_uid_gid and dive_into_subdirs from the copy/move dialog
|
||||
are saved and restored (strange, what about the other options from
|
||||
this dialog?).
|
||||
It would be much cleaner to make these option read-only. This way
|
||||
one could edit ~/.mc/ini to provide default option setting on
|
||||
startup and "Save setup" wouldn't have side effects outside the
|
||||
option's menu.
|
||||
|
||||
Sun May 10 13:24:20 1998 Norbert Warmuth <k3190@fh-sw.de>
|
||||
|
||||
* doc/mc.1.in, doc/mc.sgml, mc.hlp: Updated to reflect new default
|
||||
for dive into subdirs.
|
||||
|
||||
Sun May 10 13:21:45 1998 Norbert Warmuth <k3190@fh-sw.de>
|
||||
|
||||
* edit/syntax.c: Disable debug messages on stderr.
|
||||
|
||||
* edit/edit.h: Added missing _()
|
||||
|
||||
1998-05-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* layout.c (flag_winch): Propagate the window change to the slave
|
||||
|
13
src/file.c
13
src/file.c
@ -122,7 +122,7 @@ int do_reget;
|
||||
int verbose = 1;
|
||||
|
||||
/* Recursive operation on subdirectories */
|
||||
int dive_into_subdirs = 1;
|
||||
int dive_into_subdirs = 0;
|
||||
|
||||
/* When moving directories cross filesystem boundaries delete the successfull
|
||||
copied files when all files below the directory and its subdirectories
|
||||
@ -1381,13 +1381,16 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
|
||||
* so, say /bla exists, if we copy /tmp/\* to /bla, we get /bla/tmp/\*
|
||||
* or ( /bla doesn't exist ) /tmp/\* to /bla -> /bla/\*
|
||||
*/
|
||||
#if 0
|
||||
#if 1
|
||||
/* Again, I'm getting curious. Is not d already what we wanted, incl.
|
||||
* masked source basename? Is not this just a relict of the past versions?
|
||||
* I'm afraid this will lead into a two level deep dive :(
|
||||
*
|
||||
* I think this is indeed the problem. I can not remember any case where
|
||||
* we actually would like that behaviour -miguel
|
||||
*
|
||||
* It's a documented feature (option `Dive into subdir if exists' in the
|
||||
* copy/move dialog). -Norbert
|
||||
*/
|
||||
if (toplevel && dive_into_subdirs){
|
||||
dest_dir = concat_dir_and_file (d, x_basename (s));
|
||||
@ -1911,6 +1914,7 @@ file_mask_defaults (void)
|
||||
{
|
||||
stable_symlinks = 0;
|
||||
op_follow_links = 0;
|
||||
dive_into_subdirs = 0;
|
||||
xstat = mc_lstat;
|
||||
|
||||
preserve = 1;
|
||||
@ -2113,7 +2117,7 @@ ask_file_mask:
|
||||
source_easy_patterns = easy_patterns;
|
||||
easy_patterns = 1;
|
||||
source_mask = convert_pattern (source_mask, match_file, 1);
|
||||
source_easy_patterns = easy_patterns;
|
||||
easy_patterns = source_easy_patterns;
|
||||
error = re_compile_pattern (source_mask, strlen (source_mask), &rx);
|
||||
free (source_mask);
|
||||
} else
|
||||
@ -2134,7 +2138,8 @@ ask_file_mask:
|
||||
else
|
||||
dest_mask++;
|
||||
orig_mask = dest_mask;
|
||||
if (!*dest_mask || (!dive_into_subdirs && !is_wildcarded (dest_mask)) ||
|
||||
if (!*dest_mask || (!dive_into_subdirs && !is_wildcarded (dest_mask) &&
|
||||
(!only_one || (!mc_stat (dest_dir, &buf) && S_ISDIR (buf.st_mode)))) ||
|
||||
(dive_into_subdirs && ((!only_one && !is_wildcarded (dest_mask)) ||
|
||||
(only_one && !mc_stat (dest_dir, &buf) && S_ISDIR (buf.st_mode)))))
|
||||
dest_mask = strdup ("*");
|
||||
|
@ -1558,7 +1558,7 @@ static void copy_readlink (WPanel *panel)
|
||||
char *p = concat_dir_and_file (panel->cwd, selection (panel)->fname);
|
||||
int i;
|
||||
|
||||
i = readlink (p, buffer, MC_MAXPATHLEN);
|
||||
i = mc_readlink (p, buffer, MC_MAXPATHLEN);
|
||||
free (p);
|
||||
if (i > 0) {
|
||||
buffer [i] = 0;
|
||||
|
10
src/mc.hlp
10
src/mc.hlp
@ -1869,15 +1869,15 @@ like to copy their content.
|
||||
Dive into subdirs tells what to do if in the target
|
||||
directory exists a directory with the same name as the
|
||||
file/directory being copied. The default action is to copy
|
||||
it into that directory, by disabling this you can copy a
|
||||
directory's content into that directory. Perhaps an
|
||||
it's content into that directory, by enabling this you can
|
||||
copy the source directory into that directory. Perhaps an
|
||||
example will help:
|
||||
|
||||
You want to copy content of a directory foo to /bla/foo,
|
||||
which is an already existing directory. Normally (when
|
||||
Dive is set), mc would copy the content into /bla/foo/foo,
|
||||
'cause the directory already exists. By disabling this
|
||||
option you will copy it exactly into /bla/foo.
|
||||
Dive is not set), mc would copy it exactly into /bla/foo.
|
||||
By enabling this option you will copy the content into
|
||||
/bla/foo/foo, because the directory already exists.
|
||||
|
||||
Preserve attributes tells whether to preserve the original
|
||||
files' permissions, timestamps and if you are root whether
|
||||
|
15
src/setup.c
15
src/setup.c
@ -142,7 +142,12 @@ static struct {
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
#undef SAVE_CHANGES_OUTSIDE_OPTIONS_MENU
|
||||
|
||||
#ifdef SAVE_CHANGES_OUTSIDE_OPTIONS_MENU
|
||||
extern int preserve_uidgid;
|
||||
#endif
|
||||
|
||||
static struct {
|
||||
char *opt_name;
|
||||
@ -174,7 +179,6 @@ static struct {
|
||||
{ "full_eight_bits", &full_eight_bits },
|
||||
{ "use_8th_bit_as_meta", &use_8th_bit_as_meta },
|
||||
{ "confirm_view_dir", &confirm_view_dir },
|
||||
{ "tree_navigation_flag", &tree_navigation_flag },
|
||||
{ "mouse_move_pages", &mouse_move_pages },
|
||||
{ "mouse_move_pages_viewer", &mouse_move_pages_viewer },
|
||||
{ "fast_refresh", &fast_refresh },
|
||||
@ -193,10 +197,15 @@ static struct {
|
||||
{ "only_leading_plus_minus", &only_leading_plus_minus },
|
||||
{ "show_output_starts_shell", &output_starts_shell },
|
||||
{ "panel_scroll_pages", &panel_scroll_pages },
|
||||
{ "dive_into_subdirs", &dive_into_subdirs },
|
||||
{ "preserve_uidgid", &preserve_uidgid },
|
||||
{ "xtree_mode", &xtree_mode },
|
||||
{ "num_history_items_recorded", &num_history_items_recorded },
|
||||
#ifdef SAVE_CHANGES_OUTSIDE_OPTIONS_MENU
|
||||
{ "dive_into_subdirs", &dive_into_subdirs },
|
||||
{ "preserve_uidgid", &preserve_uidgid },
|
||||
/* What about the other two options in the copy dialog
|
||||
(follow links, stable symlinks) -Norbert */
|
||||
{ "tree_navigation_flag", &tree_navigation_flag },
|
||||
#endif
|
||||
#ifdef USE_VFS
|
||||
{ "tar_gzipped_memlimit", &tar_gzipped_memlimit },
|
||||
{ "vfs_timeout", &vfs_timeout },
|
||||
|
@ -1560,6 +1560,7 @@ handle_char (WInput *in, int c_code)
|
||||
if (in->first){
|
||||
*in->buffer = 0;
|
||||
in->point = 0;
|
||||
in->first = 0;
|
||||
}
|
||||
free_completions (in);
|
||||
v = insert_char (in, c_code);
|
||||
|
@ -1,3 +1,18 @@
|
||||
Sun May 10 14:51:03 1998 Norbert Warmuth <k3190@fh-sw.de>
|
||||
|
||||
* ftpfs.c (__ftpfs_chdir): CWD command wasn't sent at all. This
|
||||
optimation is wrong because for directories containing spaces we
|
||||
have to "CWD <pathname>" and "LIST -la" instead of
|
||||
"LIST -la <pathname>".
|
||||
I implemented a different optimation. Now ftpfs_chdir only stores
|
||||
the new working directory and sets a flag. __ftpfs_chdir is called
|
||||
when we really want to change the directory on the ftp server.
|
||||
|
||||
(resolve_symlink): Log the directory listing to the logfile.
|
||||
|
||||
* ftpfs.h (struct ftpfs_connection): Added a (per connection)
|
||||
cwd_defered flag.
|
||||
|
||||
Mon May 4 10:27:49 1998 Norbert Warmuth <k3190@fh-sw.de>
|
||||
|
||||
* Makefile.in: Links to mad.c and mad.h were created wrong when
|
||||
|
32
vfs/ftpfs.c
32
vfs/ftpfs.c
@ -1282,6 +1282,10 @@ resolve_symlink(struct ftpfs_connection *bucket, struct ftpfs_dir *dir)
|
||||
while (1) {
|
||||
if (fgets (buffer, sizeof (buffer), fp) == NULL)
|
||||
goto done;
|
||||
if (ftpfs_debug_server_dialog){
|
||||
fputs (buffer, ftpfs_logfile);
|
||||
fflush (ftpfs_logfile);
|
||||
}
|
||||
if (parse_ls_lga (buffer, &s, &filename, NULL)) {
|
||||
int r = strcmp(fe->name, filename);
|
||||
free(filename);
|
||||
@ -1444,6 +1448,7 @@ retrieve_dir(struct ftpfs_connection *bucket, char *remote_path)
|
||||
|
||||
if (ftpfs_debug_server_dialog){
|
||||
fputs (buffer, ftpfs_logfile);
|
||||
fputs ("\n", ftpfs_logfile);
|
||||
fflush (ftpfs_logfile);
|
||||
}
|
||||
if (buffer [0] == 0 && eof)
|
||||
@ -2377,14 +2382,11 @@ static int ftpfs_rename (char *path1, char *path2)
|
||||
static int
|
||||
__ftpfs_chdir (struct ftpfs_connection *bucket ,char *remote_path)
|
||||
{
|
||||
#ifdef ARE_WE_SURE_WE_DONT_NEED_THIS_P
|
||||
int r;
|
||||
#endif
|
||||
|
||||
if (ftpfs_same_dir (remote_path, bucket))
|
||||
if (!bucket->cwd_defered && ftpfs_same_dir (remote_path, bucket))
|
||||
return COMPLETE;
|
||||
|
||||
#ifdef ARE_WE_SURE_WE_DONT_NEED_THIS_P
|
||||
r = command (bucket, WAIT_REPLY, "CWD %s", remote_path);
|
||||
if (r != COMPLETE) {
|
||||
ftpfserrno = EIO;
|
||||
@ -2392,35 +2394,25 @@ __ftpfs_chdir (struct ftpfs_connection *bucket ,char *remote_path)
|
||||
if (qcdir(bucket))
|
||||
free(qcdir(bucket));
|
||||
qcdir(bucket) = strdup (remote_path);
|
||||
bucket->cwd_defered = 0;
|
||||
}
|
||||
return r;
|
||||
#else
|
||||
|
||||
if (qcdir(bucket))
|
||||
free(qcdir(bucket));
|
||||
qcdir(bucket) = strdup (remote_path);
|
||||
|
||||
return COMPLETE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int ftpfs_chdir (char *path)
|
||||
{
|
||||
char *remote_path;
|
||||
struct ftpfs_connection *bucket;
|
||||
int r;
|
||||
|
||||
retry:
|
||||
if (!(remote_path = ftpfs_get_path(&bucket, path)))
|
||||
return -1;
|
||||
got_sigpipe = 0;
|
||||
r = __ftpfs_chdir (bucket, remote_path);
|
||||
free (remote_path);
|
||||
if (got_sigpipe)
|
||||
goto retry;
|
||||
if (qcdir(bucket))
|
||||
free(qcdir(bucket));
|
||||
qcdir(bucket) = remote_path;
|
||||
bucket->cwd_defered = 1;
|
||||
|
||||
vfs_add_noncurrent_stamps (&ftpfs_vfs_ops, (vfsid) bucket, NULL);
|
||||
return r == COMPLETE ? 0 : -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ftpfs_lseek (void *data, off_t offset, int whence)
|
||||
|
@ -45,6 +45,8 @@ struct ftpfs_connection {
|
||||
int use_source_route;
|
||||
int use_passive_connection;
|
||||
int isbinary;
|
||||
int cwd_defered; /* current_directory was changed but CWD command hasn't
|
||||
been sent yet */
|
||||
};
|
||||
|
||||
#define qhost(b) (b)->host
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user