summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sftp.c b/sftp.c
index b37c36b71..2c7b546f7 100644
--- a/sftp.c
+++ b/sftp.c
@@ -16,7 +16,7 @@
16 16
17#include "includes.h" 17#include "includes.h"
18 18
19RCSID("$OpenBSD: sftp.c,v 1.58 2004/11/25 22:22:14 markus Exp $"); 19RCSID("$OpenBSD: sftp.c,v 1.59 2004/11/29 07:41:24 djm Exp $");
20 20
21#ifdef USE_LIBEDIT 21#ifdef USE_LIBEDIT
22#include <histedit.h> 22#include <histedit.h>
@@ -160,9 +160,11 @@ static void
160cmd_interrupt(int signo) 160cmd_interrupt(int signo)
161{ 161{
162 const char msg[] = "\rInterrupt \n"; 162 const char msg[] = "\rInterrupt \n";
163 int olderrno = errno;
163 164
164 write(STDERR_FILENO, msg, sizeof(msg) - 1); 165 write(STDERR_FILENO, msg, sizeof(msg) - 1);
165 interrupted = 1; 166 interrupted = 1;
167 errno = olderrno;
166} 168}
167 169
168static void 170static void
@@ -262,7 +264,7 @@ path_strip(char *path, char *strip)
262 return (xstrdup(path)); 264 return (xstrdup(path));
263 265
264 len = strlen(strip); 266 len = strlen(strip);
265 if (strip != NULL && strncmp(path, strip, len) == 0) { 267 if (strncmp(path, strip, len) == 0) {
266 if (strip[len - 1] != '/' && path[len] == '/') 268 if (strip[len - 1] != '/' && path[len] == '/')
267 len++; 269 len++;
268 return (xstrdup(path + len)); 270 return (xstrdup(path + len));