|
Jakub Jelen |
67938e |
diff --git a/progressmeter.c b/progressmeter.c
|
|
Jakub Jelen |
67938e |
index 319b747..b54738c 100644
|
|
Jakub Jelen |
67938e |
--- a/progressmeter.c
|
|
Jakub Jelen |
67938e |
+++ b/progressmeter.c
|
|
Jakub Jelen |
67938e |
@@ -66,7 +66,8 @@ static void update_progress_meter(int);
|
|
Jakub Jelen |
67938e |
|
|
Jakub Jelen |
67938e |
static time_t start; /* start progress */
|
|
Jakub Jelen |
67938e |
static time_t last_update; /* last progress update */
|
|
Jakub Jelen |
67938e |
-static const char *file; /* name of the file being transferred */
|
|
Jakub Jelen |
67938e |
+static char *file; /* name of the file being transferred */
|
|
Jakub Jelen |
67938e |
+static size_t file_len = 0; /* allocated length of file */
|
|
Jakub Jelen |
67938e |
static off_t start_pos; /* initial position of transfer */
|
|
Jakub Jelen |
67938e |
static off_t end_pos; /* ending position of transfer */
|
|
Jakub Jelen |
67938e |
static off_t cur_pos; /* transfer position as of last refresh */
|
|
Jakub Jelen |
67938e |
@@ -250,7 +251,11 @@ update_progress_meter(int ignore)
|
|
Jakub Jelen |
67938e |
start_progress_meter(const char *f, off_t filesize, off_t *ctr)
|
|
Jakub Jelen |
67938e |
{
|
|
Jakub Jelen |
67938e |
start = last_update = monotime();
|
|
Jakub Jelen |
67938e |
- file = f;
|
|
Jakub Jelen |
67938e |
+ if (strlen(f) > file_len) {
|
|
Jakub Jelen |
67938e |
+ file_len = strlen(f);
|
|
Jakub Jelen |
67938e |
+ file = realloc(file, file_len * 4 + 1);
|
|
Jakub Jelen |
67938e |
+ }
|
|
Jakub Jelen |
67938e |
+ sanitize_utf8(file, f, file_len);
|
|
Jakub Jelen |
67938e |
start_pos = *ctr;
|
|
Jakub Jelen |
67938e |
end_pos = filesize;
|
|
Jakub Jelen |
67938e |
cur_pos = 0;
|
|
Jakub Jelen |
67938e |
diff --git a/Makefile.in b/Makefile.in
|
|
Jakub Jelen |
67938e |
index ac45b05..6978081 100644
|
|
Jakub Jelen |
67938e |
--- a/Makefile.in
|
|
Jakub Jelen |
67938e |
+++ b/Makefile.in
|
|
Jakub Jelen |
67938e |
@@ -173,8 +173,8 @@ ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
|
|
Jakub Jelen |
67938e |
sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS)
|
|
Jakub Jelen |
67938e |
$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS)
|
|
Jakub Jelen |
67938e |
|
|
Jakub Jelen |
67938e |
-scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o
|
|
Jakub Jelen |
67938e |
- $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Jakub Jelen |
67938e |
+scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o utf8_stringprep.o
|
|
Jakub Jelen |
67938e |
+ $(LD) -o $@ scp.o progressmeter.o bufaux.o utf8_stringprep.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Jakub Jelen |
67938e |
|
|
Jakub Jelen |
67938e |
ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o
|
|
Jakub Jelen |
67938e |
$(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|