| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: fetch.c,v 1.11 2008/04/25 19:59:30 joerg Exp $ */ | | 1 | /* $NetBSD: fetch.c,v 1.12 2008/04/26 22:42:49 tnn Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav | | 3 | * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav |
4 | * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org> | | 4 | * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org> |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer | | 11 | * notice, this list of conditions and the following disclaimer |
12 | * in this position and unchanged. | | 12 | * in this position and unchanged. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -290,30 +290,31 @@ fetchMakeURL(const char *scheme, const c | | | @@ -290,30 +290,31 @@ fetchMakeURL(const char *scheme, const c |
290 | seturl(scheme); | | 290 | seturl(scheme); |
291 | seturl(host); | | 291 | seturl(host); |
292 | seturl(user); | | 292 | seturl(user); |
293 | seturl(pwd); | | 293 | seturl(pwd); |
294 | #undef seturl | | 294 | #undef seturl |
295 | u->port = port; | | 295 | u->port = port; |
296 | | | 296 | |
297 | return (u); | | 297 | return (u); |
298 | } | | 298 | } |
299 | | | 299 | |
300 | int | | 300 | int |
301 | fetch_urlpath_safe(char x) | | 301 | fetch_urlpath_safe(char x) |
302 | { | | 302 | { |
| | | 303 | if ((x >= '0' && x <= '9') || (x >= 'A' && x <= 'Z') || |
| | | 304 | (x >= 'a' && x <= 'z')) |
| | | 305 | return 1; |
| | | 306 | |
303 | switch (x) { | | 307 | switch (x) { |
304 | case 'a'...'z': | | | |
305 | case 'A'...'Z': | | | |
306 | case '0'...'9': | | | |
307 | case '$': | | 308 | case '$': |
308 | case '-': | | 309 | case '-': |
309 | case '_': | | 310 | case '_': |
310 | case '.': | | 311 | case '.': |
311 | case '+': | | 312 | case '+': |
312 | case '!': | | 313 | case '!': |
313 | case '*': | | 314 | case '*': |
314 | case '\'': | | 315 | case '\'': |
315 | case '(': | | 316 | case '(': |
316 | case ')': | | 317 | case ')': |
317 | case ',': | | 318 | case ',': |
318 | /* The following are allowed in segment and path components: */ | | 319 | /* The following are allowed in segment and path components: */ |
319 | case '?': | | 320 | case '?': |