Fri Oct 10 22:51:41 2008 UTC ()
libfetch-2.19:
Fix a conditional in my quoting code to not be always true.
This makes ~ be quoted as %7e as intended.


(joerg)
diff -r1.21 -r1.22 pkgsrc/net/libfetch/Makefile
diff -r1.13 -r1.14 pkgsrc/net/libfetch/files/fetch.c

cvs diff -r1.21 -r1.22 pkgsrc/net/libfetch/Makefile (expand / switch to unified diff)

--- pkgsrc/net/libfetch/Makefile 2008/10/08 15:11:21 1.21
+++ pkgsrc/net/libfetch/Makefile 2008/10/10 22:51:41 1.22
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.21 2008/10/08 15:11:21 joerg Exp $ 1# $NetBSD: Makefile,v 1.22 2008/10/10 22:51:41 joerg Exp $
2# 2#
3 3
4DISTNAME= libfetch-2.18 4DISTNAME= libfetch-2.19
5CATEGORIES= net 5CATEGORIES= net
6MASTER_SITES= # empty 6MASTER_SITES= # empty
7DISTFILES= # empty 7DISTFILES= # empty
8 8
9NO_CHECKSUM= yes 9NO_CHECKSUM= yes
10 10
11MAINTAINER= joerg@NetBSD.org 11MAINTAINER= joerg@NetBSD.org
12HOMEPAGE= http://www.FreeBSD.org/ 12HOMEPAGE= http://www.FreeBSD.org/
13COMMENT= Library to access HTTP/FTP server 13COMMENT= Library to access HTTP/FTP server
14#LICENSE= modified-bsd 14#LICENSE= modified-bsd
15 15
16PKG_DESTDIR_SUPPORT= user-destdir 16PKG_DESTDIR_SUPPORT= user-destdir
17 17

cvs diff -r1.13 -r1.14 pkgsrc/net/libfetch/files/fetch.c (expand / switch to unified diff)

--- pkgsrc/net/libfetch/files/fetch.c 2008/10/06 12:58:29 1.13
+++ pkgsrc/net/libfetch/files/fetch.c 2008/10/10 22:51:41 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fetch.c,v 1.13 2008/10/06 12:58:29 joerg Exp $ */ 1/* $NetBSD: fetch.c,v 1.14 2008/10/10 22:51:41 joerg 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
@@ -500,27 +500,27 @@ quote_doc: @@ -500,27 +500,27 @@ quote_doc:
500 500
501 if ((u->doc = malloc(count)) == NULL) { 501 if ((u->doc = malloc(count)) == NULL) {
502 fetch_syserr(); 502 fetch_syserr();
503 goto ouch; 503 goto ouch;
504 } 504 }
505 for (i = 0; *p != '\0'; ++p) { 505 for (i = 0; *p != '\0'; ++p) {
506 if ((!pre_quoted && *p == '%') || 506 if ((!pre_quoted && *p == '%') ||
507 !fetch_urlpath_safe(*p)) { 507 !fetch_urlpath_safe(*p)) {
508 u->doc[i++] = '%'; 508 u->doc[i++] = '%';
509 if ((unsigned char)*p < 160) 509 if ((unsigned char)*p < 160)
510 u->doc[i++] = '0' + ((unsigned char)*p) / 16; 510 u->doc[i++] = '0' + ((unsigned char)*p) / 16;
511 else 511 else
512 u->doc[i++] = 'a' - 10 + ((unsigned char)*p) / 16; 512 u->doc[i++] = 'a' - 10 + ((unsigned char)*p) / 16;
513 if ((unsigned char)*p % 16 < 16) 513 if ((unsigned char)*p % 16 < 10)
514 u->doc[i++] = '0' + ((unsigned char)*p) % 16; 514 u->doc[i++] = '0' + ((unsigned char)*p) % 16;
515 else 515 else
516 u->doc[i++] = 'a' - 10 + ((unsigned char)*p) % 16; 516 u->doc[i++] = 'a' - 10 + ((unsigned char)*p) % 16;
517 } else 517 } else
518 u->doc[i++] = *p; 518 u->doc[i++] = *p;
519 } 519 }
520 u->doc[i] = '\0'; 520 u->doc[i] = '\0';
521 521
522 return (u); 522 return (u);
523 523
524ouch: 524ouch:
525 free(u); 525 free(u);
526 return (NULL); 526 return (NULL);