Deleted Added
full compact
fetch.c (83217) fetch.c (83307)
1/*-
2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/usr.bin/fetch/fetch.c 83217 2001-09-08 15:17:15Z des $
28 * $FreeBSD: head/usr.bin/fetch/fetch.c 83307 2001-09-10 17:23:57Z mike $
29 */
30
31#include <sys/param.h>
32#include <sys/stat.h>
33#include <sys/socket.h>
34
35#include <ctype.h>
36#include <err.h>

--- 426 unchanged lines hidden (view full) ---

463
464 /* construct a temp file name */
465 if (sb.st_size != -1 && S_ISREG(sb.st_mode)) {
466 if ((slash = strrchr(path, '/')) == NULL)
467 slash = path;
468 else
469 ++slash;
470 asprintf(&tmppath, "%.*s.fetch.XXXXXX.%s",
29 */
30
31#include <sys/param.h>
32#include <sys/stat.h>
33#include <sys/socket.h>
34
35#include <ctype.h>
36#include <err.h>

--- 426 unchanged lines hidden (view full) ---

463
464 /* construct a temp file name */
465 if (sb.st_size != -1 && S_ISREG(sb.st_mode)) {
466 if ((slash = strrchr(path, '/')) == NULL)
467 slash = path;
468 else
469 ++slash;
470 asprintf(&tmppath, "%.*s.fetch.XXXXXX.%s",
471 slash - path, path, slash);
471 (int)(slash - path), path, slash);
472 }
473
474 if (tmppath != NULL) {
475 mkstemps(tmppath, strlen(slash) + 1);
476 warnx("tmppath: %s", tmppath);
477 of = fopen(tmppath, "w");
478 } else {
479 of = fopen(path, "w");

--- 410 unchanged lines hidden ---
472 }
473
474 if (tmppath != NULL) {
475 mkstemps(tmppath, strlen(slash) + 1);
476 warnx("tmppath: %s", tmppath);
477 of = fopen(tmppath, "w");
478 } else {
479 of = fopen(path, "w");

--- 410 unchanged lines hidden ---