1
1

* cmd.c (do_link): Append filename to the default symlink

target.  Don't add path separator if there is no listing on
the other panel.  Avoid using fixed size buffers.
From Max Schedriviy <max@tavrida.net>
Этот коммит содержится в:
Pavel Roskin 2001-07-26 15:47:19 +00:00
родитель 11fd4abc0e
Коммит f0beaa4ed7
2 изменённых файлов: 19 добавлений и 18 удалений

Просмотреть файл

@ -1,5 +1,10 @@
2001-07-26 Pavel Roskin <proski@gnu.org>
* cmd.c (do_link): Append filename to the default symlink
target. Don't add path separator if there is no listing on
the other panel. Avoid using fixed size buffers.
From Max Schedriviy <max@tavrida.net>
* main.c [HAVE_X]: Disable eight_bit_clean and full_eight_bits.
* util.c (is_printable) [HAVE_X]: Simplify.

Просмотреть файл

@ -1032,26 +1032,22 @@ do_link (int symbolic_link, char *fname)
if (-1 == mc_link (fname, dest))
message (1, MSG_ERROR, _(" link: %s "), unix_error_string (errno));
} else {
#ifdef OLD_SYMLINK_VERSION
symlink_dialog (fname, "", &dest, &src);
#else
char *s;
char *d;
/* suggest the full path for symlink */
char s[MC_MAXPATHLEN];
char d[MC_MAXPATHLEN];
strcpy(s, cpanel->cwd);
if ( ! ((s[0] == '/') && (s[1] == 0)))
strcat(s, "/");
strcat(s, fname);
if (get_other_type () == view_listing)
strcpy(d, opanel->cwd);
else
strcpy (d,"");
if ( ! ((d[0] == '/') && (d[1] == 0)))
strcat(d, "/");
s = concat_dir_and_file (cpanel->cwd, fname);
if (get_other_type () == view_listing) {
d = concat_dir_and_file (opanel->cwd, fname);
} else {
d = g_strdup (fname);
}
symlink_dialog (s, d, &dest, &src);
#endif /* !OLD_SYMLINK_VERSION */
g_free (d);
g_free (s);
if (!dest || !*dest || !src || !*src) {
if (src)
g_free (src);