From: jacob Date: Sat, 1 Jan 2005 16:43:19 +0000 (+0000) Subject: Localise "not connected to a host" messages. X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/commitdiff_plain/38f0c08ea9a626c97a1d97b6d56d6f44b6a14572?hp=f68363d29c314736cc8023a18d2b424a07c33c6d Localise "not connected to a host" messages. git-svn-id: svn://svn.tartarus.org/sgt/putty@5060 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/psftp.c b/psftp.c index 904ddb88..4678c97a 100644 --- a/psftp.c +++ b/psftp.c @@ -189,6 +189,11 @@ static int bare_name_compare(const void *av, const void *bv) return strcmp(*a, *b); } +static void not_connected(void) +{ + printf("psftp: not connected to a host; use \"open host.name\"\n"); +} + /* ---------------------------------------------------------------------- * The meat of the `get' and `put' commands. */ @@ -936,7 +941,7 @@ int sftp_cmd_quit(struct sftp_command *cmd) int sftp_cmd_close(struct sftp_command *cmd) { if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -966,7 +971,7 @@ int sftp_cmd_ls(struct sftp_command *cmd) int i; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1088,7 +1093,7 @@ int sftp_cmd_cd(struct sftp_command *cmd) char *dir; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1131,7 +1136,7 @@ int sftp_cmd_cd(struct sftp_command *cmd) int sftp_cmd_pwd(struct sftp_command *cmd) { if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1155,7 +1160,7 @@ int sftp_general_get(struct sftp_command *cmd, int restart, int multiple) int recurse = FALSE; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1269,7 +1274,7 @@ int sftp_general_put(struct sftp_command *cmd, int restart, int multiple) int recurse = FALSE; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1370,7 +1375,7 @@ int sftp_cmd_mkdir(struct sftp_command *cmd) int i, ret; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1431,7 +1436,7 @@ int sftp_cmd_rmdir(struct sftp_command *cmd) int i, ret; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1473,7 +1478,7 @@ int sftp_cmd_rm(struct sftp_command *cmd) int i, ret; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1568,7 +1573,7 @@ int sftp_cmd_mv(struct sftp_command *cmd) int i, ret; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; } @@ -1662,7 +1667,7 @@ int sftp_cmd_chmod(struct sftp_command *cmd) struct sftp_context_chmod actx, *ctx = &actx; if (back == NULL) { - printf("psftp: not connected to a host; use \"open host.name\"\n"); + not_connected(); return 0; }