diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-12-06 22:45:53 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-12-06 22:45:53 +1100 |
commit | e2f189a841c9beecae75a2df3784d73f9e6dd762 (patch) | |
tree | dea0adc141a29896e19ba529107fead4f0849cae /sftp.c | |
parent | 0133a727acc7db7bd5a733ca0bed8a06a112f389 (diff) |
- djm@cvs.openbsd.org 2004/11/29 07:41:24
[sftp-client.h sftp.c]
Some small fixes from moritz@jodeit.org. ok deraadt@
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | 18 | ||
19 | RCSID("$OpenBSD: sftp.c,v 1.58 2004/11/25 22:22:14 markus Exp $"); | 19 | RCSID("$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 | |||
160 | cmd_interrupt(int signo) | 160 | cmd_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 | ||
168 | static void | 170 | static 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)); |