* mu-cmd.c: (mu mv) make --printtarget work even with target=/dev/null
This commit is contained in:
15
src/mu-cmd.c
15
src/mu-cmd.c
@ -316,9 +316,12 @@ mu_cmd_mv (MuConfig *opts)
|
|||||||
if (unlink (opts->params[1]) != 0) {
|
if (unlink (opts->params[1]) != 0) {
|
||||||
g_warning ("unlink failed: %s", strerror (errno));
|
g_warning ("unlink failed: %s", strerror (errno));
|
||||||
return MU_EXITCODE_ERROR;
|
return MU_EXITCODE_ERROR;
|
||||||
} else
|
} else {
|
||||||
|
if (opts->printtarget) /* if the move worked, print */
|
||||||
|
g_print ("%s\n", "/dev/null"); /* /dev/null */
|
||||||
return MU_EXITCODE_OK;
|
return MU_EXITCODE_OK;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = NULL;
|
err = NULL;
|
||||||
fullpath = mu_msg_file_move_to_maildir (opts->params[1], opts->params[2],
|
fullpath = mu_msg_file_move_to_maildir (opts->params[1], opts->params[2],
|
||||||
@ -330,14 +333,16 @@ mu_cmd_mv (MuConfig *opts)
|
|||||||
}
|
}
|
||||||
return MU_EXITCODE_ERROR;
|
return MU_EXITCODE_ERROR;
|
||||||
|
|
||||||
} else if (opts->printtarget) /* if the move worked, print the */
|
} else {
|
||||||
g_print ("%s\n", fullpath); /* target (if user set
|
if (opts->printtarget)
|
||||||
* --printtarget) */
|
g_print ("%s\n", fullpath);
|
||||||
|
return MU_EXITCODE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
g_free (fullpath);
|
g_free (fullpath);
|
||||||
|
|
||||||
return MU_EXITCODE_OK;
|
return MU_EXITCODE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|||||||
Reference in New Issue
Block a user