Permalink
Browse files

Checking in changes prior to tagging of version 1.03.

Changelog diff is:

Index: CHANGES
===================================================================
--- CHANGES	(revision 10)
+++ CHANGES	(working copy)
@@ -1,8 +1,12 @@
-1.02
+1.03 (2010-12-20)
+   - patch from Andrea Nall to use STRLEN in XS, preventing crash
+     on 64-bit systems in some cases.  also const-ify stuff.
+
+1.02 (unreleased)
    - more tests from other utf8 scripts I had around
    - test plans
 
-1.01
+1.01 (2005-12-07)
    - bleh, fix broken tarball
 
 1.00


git-svn-id: http://code.sixapart.com/svn/Unicode-CheckUTF8/trunk@11 65dc5e48-8b0f-0410-ab0b-9e024c40a550
  • Loading branch information...
1 parent d3a5e79 commit 4df2c5bfc4ac044b19bd256a8b5a1778501cc7b5 @bradfitz committed Dec 20, 2010
Showing with 19 additions and 12 deletions.
  1. +3 −0 .shipit
  2. +6 −2 CHANGES
  3. +1 −1 CheckUTF8.pm
  4. +9 −9 CheckUTF8.xs
View
@@ -0,0 +1,3 @@
+steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN
+svn.tagpattern = Unicode-CheckUTF8-%v
+
View
@@ -1,8 +1,12 @@
-1.02
+1.03 (2010-12-20)
+ - patch from Andrea Nall to use STRLEN in XS, preventing crash
+ on 64-bit systems in some cases. also const-ify stuff.
+
+1.02 (unreleased)
- more tests from other utf8 scripts I had around
- test plans
-1.01
+1.01 (2005-12-07)
- bleh, fix broken tarball
1.00
View
@@ -34,7 +34,7 @@ package Unicode::CheckUTF8;
use base 'Exporter';
BEGIN {
- $VERSION = "1.02";
+ $VERSION = "1.03";
@EXPORT = qw();
@EXPORT_OK = qw(isLegalUTF8String is_utf8);
View
@@ -59,9 +59,9 @@ static const char trailingBytesForUTF8[256] = {
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
};
-static Boolean isLegalUTF8(UTF8 *source, int length) {
+static Boolean isLegalUTF8(const UTF8 *source, int length) {
UTF8 a;
- UTF8 *srcptr = source+length;
+ const UTF8 *srcptr = source+length;
switch (length) {
default: return false;
/* Everything else falls through when "true"... */
@@ -88,9 +88,9 @@ static Boolean isLegalUTF8(UTF8 *source, int length) {
*
*/
-int isLegalUTF8String(char *str, int len)
+int isLegalUTF8String(const char *str, int len)
{
- UTF8 *cp = str;
+ const UTF8 *cp = str;
int i;
while (*cp) {
/* how many bytes follow this character? */
@@ -111,7 +111,7 @@ int isLegalUTF8String(char *str, int len)
/* if we didn't make it to the end, there must've been an internal null
* in the perl string, which we're saying is bogus utf-8, since there's
* no point for users giving us null chars. */
- return (cp == str+len) ? 1 : 0;
+ return (cp == (UTF8*)(str+len)) ? 1 : 0;
}
MODULE = Unicode::CheckUTF8 PACKAGE = Unicode::CheckUTF8
@@ -122,14 +122,14 @@ int
is_utf8 (str)
SV * str
CODE:
- int len;
- char *c_str = SvPV(str, len);
+ STRLEN len;
+ const char *c_str = SvPV(str, len);
RETVAL = isLegalUTF8String(c_str, len);
OUTPUT:
RETVAL
int
isLegalUTF8String (str, len)
- char * str
- int len
+ const char * str
+ STRLEN len

0 comments on commit 4df2c5b

Please sign in to comment.