aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1996-11-10 14:46:50 +0000
committerPeter Wemm <peter@FreeBSD.org>1996-11-10 14:46:50 +0000
commite721a581cbc9ba5707a24e3a36d29e4a1a5c285d (patch)
tree7009bfae5a95d778f75cbc50b87ba2786c7f48a6 /usr.bin/fetch
parentd66e3876dd6e023c45cf02bd32fff3db2ce906c9 (diff)
downloadsrc-e721a581cbc9ba5707a24e3a36d29e4a1a5c285d.tar.gz
src-e721a581cbc9ba5707a24e3a36d29e4a1a5c285d.zip
Cosmetic bugfix. fetch was modifying it's argv[] strings in place, which
caused ps(1) to show strange things..
Notes
Notes: svn path=/head/; revision=19611
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c
index b9440bbaaf21..6f4d85c38f19 100644
--- a/usr.bin/fetch/main.c
+++ b/usr.bin/fetch/main.c
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/* $Id: main.c,v 1.25 1996/10/24 00:15:44 adam Exp $ */
+/* $Id: main.c,v 1.26 1996/10/31 14:24:35 phk Exp $ */
#include <sys/types.h>
#include <sys/socket.h>
@@ -140,6 +140,7 @@ int
main(int argc, char **argv)
{
int c;
+ char *s;
while ((c = getopt (argc, argv, "D:HINPMT:V:Lqc:f:h:o:plmnrv")) != -1) {
switch (c) {
@@ -204,7 +205,10 @@ main(int argc, char **argv)
if (argv[0]) {
if (host || change_to_dir || file_to_get)
usage();
- parse(argv[0]);
+ s = strdup(argv[0]);
+ if (s == NULL)
+ s = argv[0]; /* optomistic, I know.. malloc just failed. */
+ parse(s);
} else {
if (!host || !file_to_get)
usage();