Deleted Added
full compact
fetch.c (40975) fetch.c (41862)
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

--- 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) 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

--- 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 * $Id: fetch.c,v 1.5 1998/11/05 19:48:17 des Exp $
28 * $Id: fetch.c,v 1.6 1998/11/06 22:14:08 des Exp $
29 */
30
31#include <sys/param.h>
32#include <sys/errno.h>
33
34#include <ctype.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>
38
39#include "fetch.h"
40#include "common.h"
41
42
29 */
30
31#include <sys/param.h>
32#include <sys/errno.h>
33
34#include <ctype.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>
38
39#include "fetch.h"
40#include "common.h"
41
42
43int fetchLastErrCode;
44
45
43/*** Local data **************************************************************/
44
45/*
46 * Error messages for parser errors
47 */
48#define URL_MALFORMED 1
49#define URL_BAD_SCHEME 2
50#define URL_BAD_PORT 3

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

200 else URL++;
201 if (URL[1] != '/') {
202 p = URL;
203 goto nohost;
204 }
205 else URL += 2;
206
207 p = strpbrk(URL, "/@");
46/*** Local data **************************************************************/
47
48/*
49 * Error messages for parser errors
50 */
51#define URL_MALFORMED 1
52#define URL_BAD_SCHEME 2
53#define URL_BAD_PORT 3

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

203 else URL++;
204 if (URL[1] != '/') {
205 p = URL;
206 goto nohost;
207 }
208 else URL += 2;
209
210 p = strpbrk(URL, "/@");
208 if (*p == '@') {
211 if (p && *p == '@') {
209 /* username */
210 for (q = URL, i = 0; (*q != ':') && (*q != '@'); q++)
211 if (i < URL_USERLEN)
212 u->user[i++] = *q;
213
214 /* password */
215 if (*q == ':')
216 for (q++, i = 0; (*q != ':') && (*q != '@'); q++)

--- 58 unchanged lines hidden ---
212 /* username */
213 for (q = URL, i = 0; (*q != ':') && (*q != '@'); q++)
214 if (i < URL_USERLEN)
215 u->user[i++] = *q;
216
217 /* password */
218 if (*q == ':')
219 for (q++, i = 0; (*q != ':') && (*q != '@'); q++)

--- 58 unchanged lines hidden ---