Skip to content

Commit

Permalink
Version 0.02
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.coderepos.org/share/lang/perl/URI-Escape-XS/trunk@12879 d0d07461-0603-4401-acd4-de1884942a52
  • Loading branch information
dankogai committed May 30, 2008
1 parent 8a0fae2 commit d80d635
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 29 deletions.
8 changes: 6 additions & 2 deletions Changes
@@ -1,9 +1,13 @@
#
# $Id$
# $Id: Changes,v 0.2 2008/05/30 23:53:13 dankogai Exp dankogai $
#
# Revision history for Revision history for URI-Escape-XS
#
$Revision: 0.1 $ $Date: 2007/04/27 17:17:46 $
$Revision: 0.2 $ $Date: 2008/05/30 23:53:13 $
! XS.xs
s/ishexnumber/isxdigit/g # for better compatibility
http://rt.cpan.org/Public/Bug/Display.html?id=32556
http://rt.cpan.org/Public/Bug/Display.html?id=28583
! lib/URI/Escape/XS.pm
POD fixes.

Expand Down
23 changes: 10 additions & 13 deletions META.yml
@@ -1,14 +1,11 @@
--- #YAML:1.0
name: URI-Escape-XS
version: 0.01
abstract: Drop-In replacement for URI::Escape
license: ~
author:
- Dan Kogai <dankogai@dan.co.jp>
generated_by: ExtUtils::MakeMaker version 6.42
distribution_type: module
requires:
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: URI-Escape-XS
version: 0.01
version_from: lib/URI/Escape/XS.pm
installdirs: site
requires:
Test::More: 0
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.3.html
version: 1.3

distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.30
2 changes: 1 addition & 1 deletion README
Expand Up @@ -2,7 +2,7 @@ NAME
URI::Escape::XS - Drop-In replacement for URI::Escape

VERSION
$Id: XS.pm,v 0.1 2007/04/27 17:17:46 dankogai Exp dankogai $
$Id: README,v 0.2 2008/05/30 23:53:13 dankogai Exp dankogai $

SYNOPSIS
# use it instead of URI::Escape
Expand Down
12 changes: 6 additions & 6 deletions XS.xs
@@ -1,5 +1,5 @@
/*
* $Id: XS.xs,v 0.1 2007/04/27 17:17:46 dankogai Exp dankogai $
* $Id: XS.xs,v 0.2 2008/05/30 23:53:13 dankogai Exp dankogai $
*/

#include "EXTERN.h"
Expand Down Expand Up @@ -73,15 +73,15 @@ SV *decode_uri_component(SV *uri){

for (i = 0; i < slen; i++){
if (src[i] == '%'){
if (ishexnumber(src[i+1]) && ishexnumber(src[i+2])){
if (isxdigit(src[i+1]) && isxdigit(src[i+2])){
strncpy((char *)buf, (char *)(src + i + 1), 2);
hi = strtol((char *)buf, NULL, 16);
dst[dlen++] = hi;
i += 2;
}
else if(src[i+1] == 'u'
&& ishexnumber(src[i+2]) && ishexnumber(src[i+3])
&& ishexnumber(src[i+4]) && ishexnumber(src[i+5])){
&& isxdigit(src[i+2]) && isxdigit(src[i+3])
&& isxdigit(src[i+4]) && isxdigit(src[i+5])){
strncpy((char *)buf, (char *)(src + i + 2), 4);
hi = strtol((char *)buf, NULL, 16);
i += 5;
Expand All @@ -95,8 +95,8 @@ SV *decode_uri_component(SV *uri){
}else{
i++;
if(src[i] == '%' && src[i+1] == 'u'
&& ishexnumber(src[i+2]) && ishexnumber(src[i+3])
&& ishexnumber(src[i+4]) && ishexnumber(src[i+5])){
&& isxdigit(src[i+2]) && isxdigit(src[i+3])
&& isxdigit(src[i+4]) && isxdigit(src[i+5])){
strncpy((char *)buf, (char *)(src + i + 2), 4);
lo = strtol((char *)buf, NULL, 16);
i += 5;
Expand Down
8 changes: 4 additions & 4 deletions lib/URI/Escape/XS.pm
@@ -1,6 +1,6 @@
package URI::Escape::XS;
#
# $Id: XS.pm,v 0.1 2007/04/27 17:17:46 dankogai Exp dankogai $
# $Id: XS.pm,v 0.2 2008/05/30 23:53:13 dankogai Exp dankogai $
#
use 5.008001;
use warnings;
Expand Down Expand Up @@ -56,7 +56,7 @@ URI::Escape::XS - Drop-In replacement for URI::Escape
=head1 VERSION
$Id: XS.pm,v 0.1 2007/04/27 17:17:46 dankogai Exp dankogai $
$Id: XS.pm,v 0.2 2008/05/30 23:53:13 dankogai Exp dankogai $
=cut
Expand Down Expand Up @@ -87,7 +87,7 @@ L</uri_escape> and L</uri_unescape>
=head2 encodeURIComponent
Does what JavaScript's encodeURIComponent does.
Does what JavaScript's encodeURIComponent does.
$uri = encodeURIComponent("http://www.example.com/");
# http%3A%2F%2Fwww.example.com%2F
Expand Down Expand Up @@ -247,7 +247,7 @@ Koichi Taniguchi for L<URI::Escape::JavaScript>
=head1 COPYRIGHT & LICENSE
Copyright 2007 Dan Kogai, all rights reserved.
Copyright 2007-2008 Dan Kogai, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Expand Down
2 changes: 1 addition & 1 deletion t/01-compat.t
@@ -1,6 +1,6 @@
#!perl -w
#
# $Id: 01-compat.t,v 0.1 2007/04/27 17:17:46 dankogai Exp dankogai $
# $Id: 01-compat.t,v 0.1 2007/04/27 17:17:46 dankogai Exp $
#
# Original as URI-1.35/t/escape.t
#
Expand Down
2 changes: 1 addition & 1 deletion t/02-basic.t
@@ -1,6 +1,6 @@
#!perl -w
#
# $Id: 02-basic.t,v 0.1 2007/04/27 17:17:46 dankogai Exp dankogai $
# $Id: 02-basic.t,v 0.1 2007/04/27 17:17:46 dankogai Exp $
#
# Original as URI-1.35/t/escape.t
#
Expand Down
2 changes: 1 addition & 1 deletion t/03-hashu.t
@@ -1,6 +1,6 @@
#!perl -w
#
# $Id: 03-hashu.t,v 0.1 2007/04/27 17:17:46 dankogai Exp dankogai $
# $Id: 03-hashu.t,v 0.1 2007/04/27 17:17:46 dankogai Exp $
#
# Original as URI-1.35/t/escape.t
#
Expand Down

0 comments on commit d80d635

Please sign in to comment.