summaryrefslogtreecommitdiff
path: root/net-misc/wput/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-02-05 18:44:56 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-02-05 18:44:56 +0000
commit29aabba0ea759c6a2864ff5631735b67ee38e5e0 (patch)
treeab466b4dfa7abecb401b2f8039d08af4689306bb /net-misc/wput/files
parentd42200bec37eef2a7478d88988ff00addd0a9202 (diff)
gentoo resync : 05.02.2020
Diffstat (limited to 'net-misc/wput/files')
-rw-r--r--net-misc/wput/files/wput-0.6.2-respect-destdir.patch23
-rw-r--r--net-misc/wput/files/wput-fix-crash.patch47
2 files changed, 70 insertions, 0 deletions
diff --git a/net-misc/wput/files/wput-0.6.2-respect-destdir.patch b/net-misc/wput/files/wput-0.6.2-respect-destdir.patch
new file mode 100644
index 000000000000..f0cbfcdebd69
--- /dev/null
+++ b/net-misc/wput/files/wput-0.6.2-respect-destdir.patch
@@ -0,0 +1,23 @@
+diff --git a/Makefile.in b/Makefile.in
+index 6756cd2..6debea8 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -16,12 +16,12 @@ win-clean:
+
+ install: all
+ cd po && $(MAKE) $(MAKEDEFS) $@
+- mkdir -p $(bindir)
+- mkdir -p $(mandir)
+- install -m0755 wput $(bindir)
+- install -m0644 doc/wput.1.gz $(mandir)
+- ln -s $(bindir)/wput $(bindir)/wdel
+- install -m0644 doc/wdel.1.gz $(mandir)
++ install -d $(DESTDIR)/$(bindir)
++ install -d $(DESTDIR)/$(mandir)
++ install -m0755 wput $(DESTDIR)/$(bindir)
++ install -m0644 doc/wput.1 $(DESTDIR)/$(mandir)
++ ln -s wput $(DESTDIR)/$(bindir)/wdel
++ install -m0644 doc/wdel.1 $(DESTDIR)/$(mandir)
+ @echo "----------------"
+ @echo "Wput and Wdel installed. See 'wput/wdel -h' or 'man wput/wdel' for"
+ @echo "usage information."
diff --git a/net-misc/wput/files/wput-fix-crash.patch b/net-misc/wput/files/wput-fix-crash.patch
new file mode 100644
index 000000000000..2afab8e59913
--- /dev/null
+++ b/net-misc/wput/files/wput-fix-crash.patch
@@ -0,0 +1,47 @@
+diff -ur wput-0.6.2+git20130413.orig/src/progress.c wput-0.6.2+git20130413/src/progress.c
+--- wput-0.6.2+git20130413.orig/src/progress.c 2013-07-15 00:05:50.000000000 +0200
++++ wput-0.6.2+git20130413/src/progress.c 2016-10-25 16:48:05.909105000 +0200
+@@ -181,7 +181,7 @@
+ static char output[15];
+ time_t secs = time (NULL);
+ struct tm *ptm = localtime (&secs);
+- sprintf (output, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
++ snprintf (output, sizeof(output), "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
+ return output;
+ }
+
+@@ -261,11 +261,11 @@
+ unit = 3, trate = trate / (1024 * 1024 * 1024);
+
+ if(trate < 100)
+- sprintf(buf, "%s%.2f%s", (trate < 10) ? " " : "", trate, units[sp][unit]);
++ snprintf(buf, sizeof(buf), "%s%.2f%s", (trate < 10) ? " " : "", trate, units[sp][unit]);
+ else if(trate < 1000)
+- sprintf(buf, "%.1f%s", trate, units[sp][unit]);
++ snprintf(buf, sizeof(buf), "%.1f%s", trate, units[sp][unit]);
+ else
+- sprintf(buf, " %d%s", (int) trate, units[sp][unit]);
++ snprintf(buf, sizeof(buf), " %d%s", (int) trate, units[sp][unit]);
+ return buf;
+ }
+ /* wrapper for our progress_bar */
+@@ -303,13 +303,15 @@
+ remain = (int) (WINCONV (fsession->local_fsize - transfered) * ((double) time_diff * 1000)
+ / (double) WINCONV tbytes / 1000);
+ if(remain < 60)
+- sprintf(buf, "ETA %02ds", remain);
++ snprintf(buf, sizeof(buf), "ETA %02ds", remain);
+ else if(remain < 3600)
+- sprintf(buf, "ETA %2d:%02dm", remain / 60, remain % 60);
++ snprintf(buf, sizeof(buf), "ETA %2d:%02dm", remain / 60, remain % 60);
+ else if(remain < 3600 * 24)
+- sprintf(buf, "ETA %2d:%02dh", remain / 3600, (remain % 3600) / 60);
++ snprintf(buf, sizeof(buf), "ETA %2d:%02dh", remain / 3600, (remain % 3600) / 60);
++ else if(remain < 3600 * 24 * 100)
++ snprintf(buf, sizeof(buf), "ETA %2d:%02dd", remain / (3600 * 24), (remain % (24 * 3600)) / 3600);
+ else
+- sprintf(buf, "ETA %2d:%02dd", remain / (3600 * 24), (remain % (24 * 3600)) / 3600);
++ snprintf(buf, sizeof(buf), "ETA **:** ");
+ /* NO, there won't be an eta of weeks or years! 14.4modem times are gone ;). god bless all gprs-users */
+
+ return buf;