Deleted Added
full compact
fetch.c (87560) fetch.c (88769)
1/*-
2 * Copyright (c) 1998 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

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

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
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 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

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

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
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/lib/libfetch/fetch.c 87560 2001-12-09 15:05:19Z des $");
30__FBSDID("$FreeBSD: head/lib/libfetch/fetch.c 88769 2002-01-01 14:48:09Z des $");
31
32#include <sys/param.h>
33#include <sys/errno.h>
34
35#include <ctype.h>
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>

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

398 }
399 *doc = '\0';
400 } else if ((u->doc = strdup(p)) == NULL) {
401 _fetch_syserr();
402 goto ouch;
403 }
404
405 DEBUG(fprintf(stderr,
31
32#include <sys/param.h>
33#include <sys/errno.h>
34
35#include <ctype.h>
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>

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

398 }
399 *doc = '\0';
400 } else if ((u->doc = strdup(p)) == NULL) {
401 _fetch_syserr();
402 goto ouch;
403 }
404
405 DEBUG(fprintf(stderr,
406 "scheme: [\033[1m%s\033[m]\n"
407 "user: [\033[1m%s\033[m]\n"
408 "password: [\033[1m%s\033[m]\n"
409 "host: [\033[1m%s\033[m]\n"
410 "port: [\033[1m%d\033[m]\n"
411 "document: [\033[1m%s\033[m]\n",
406 "scheme: [%s]\n"
407 "user: [%s]\n"
408 "password: [%s]\n"
409 "host: [%s]\n"
410 "port: [%d]\n"
411 "document: [%s]\n",
412 u->scheme, u->user, u->pwd,
413 u->host, u->port, u->doc));
414
415 return u;
416
417ouch:
418 free(u);
419 return NULL;
420}
421
422/*
423 * Free a URL
424 */
425void
426fetchFreeURL(struct url *u)
427{
428 free(u->doc);
429 free(u);
430}
412 u->scheme, u->user, u->pwd,
413 u->host, u->port, u->doc));
414
415 return u;
416
417ouch:
418 free(u);
419 return NULL;
420}
421
422/*
423 * Free a URL
424 */
425void
426fetchFreeURL(struct url *u)
427{
428 free(u->doc);
429 free(u);
430}