From 66293f72cde3bb17c1cb83b2f6f4dd4c5f84e3d2 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Tue, 9 Mar 1999 01:54:38 +0000 Subject: [PATCH] 1999-03-08 Miguel de Icaza * cmd.c (edit_symlink_cmd): Small fix to improve the messages printed. --- src/ChangeLog | 5 +++++ src/cmd.c | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ffd478075..0f4bfc82b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +1999-03-08 Miguel de Icaza + + * cmd.c (edit_symlink_cmd): Small fix to improve the messages + printed. + Tue Mar 2 22:54:50 1999 Norbert Warmuth * util.c (name_quote): Quote '<' and '>'. diff --git a/src/cmd.c b/src/cmd.c index d25a4d058..637c0cebb 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1108,10 +1108,14 @@ void edit_symlink_cmd (void) if (dest) { if (*dest && strcmp (buffer, dest)) { save_cwds_stat (); - mc_unlink (p); - if (-1 == mc_symlink (dest, p)) - message (1, MSG_ERROR, _(" edit symlink: %s "), - unix_error_string (errno)); + if (-1 == mc_unlink (p)){ + message (1, MSG_ERROR, _(" edit symlink, unable to remove %s: %s "), + p, unix_error_string (errno)); + } else { + if (-1 == mc_symlink (dest, p)) + message (1, MSG_ERROR, _(" edit symlink: %s "), + unix_error_string (errno)); + } update_panels (UP_OPTIMIZE, UP_KEEPSEL); repaint_screen (); }