summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-11-10 14:46:50 +0000
committerpeter <peter@FreeBSD.org>1996-11-10 14:46:50 +0000
commitfb2d026372cee084e1ebd0c1f34542a273a05389 (patch)
tree7009bfae5a95d778f75cbc50b87ba2786c7f48a6 /usr.bin/fetch
parent92ac74cfdeaefa706d97bde11e2b30856aadb7eb (diff)
downloadFreeBSD-src-fb2d026372cee084e1ebd0c1f34542a273a05389.zip
FreeBSD-src-fb2d026372cee084e1ebd0c1f34542a273a05389.tar.gz
Cosmetic bugfix. fetch was modifying it's argv[] strings in place, which
caused ps(1) to show strange things..
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 b9440bb..6f4d85c 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();
OpenPOWER on IntegriCloud