r60471 - in /branches/upstream/libcss-minifier-xs-perl/current: Changes MANIFEST META.yml Makefile.PL README XS.xs lib/CSS/Minifier/XS.pm t/css/media.css t/css/media.min

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Thu Jul 22 11:31:24 UTC 2010


Author: ansgar-guest
Date: Thu Jul 22 11:31:17 2010
New Revision: 60471

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60471
Log:
[svn-upgrade] new version libcss-minifier-xs-perl (0.07)

Added:
    branches/upstream/libcss-minifier-xs-perl/current/t/css/media.css
    branches/upstream/libcss-minifier-xs-perl/current/t/css/media.min
Modified:
    branches/upstream/libcss-minifier-xs-perl/current/Changes
    branches/upstream/libcss-minifier-xs-perl/current/MANIFEST
    branches/upstream/libcss-minifier-xs-perl/current/META.yml
    branches/upstream/libcss-minifier-xs-perl/current/Makefile.PL
    branches/upstream/libcss-minifier-xs-perl/current/README
    branches/upstream/libcss-minifier-xs-perl/current/XS.xs
    branches/upstream/libcss-minifier-xs-perl/current/lib/CSS/Minifier/XS.pm

Modified: branches/upstream/libcss-minifier-xs-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/Changes?rev=60471&op=diff
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/Changes (original)
+++ branches/upstream/libcss-minifier-xs-perl/current/Changes Thu Jul 22 11:31:17 2010
@@ -1,4 +1,12 @@
 Revision history for Perl extension CSS::Minifier::XS.
+
+0.07        Wed Jul 21 21:09 PDT 2010
+    - RT #39978; use 'Newxz/Safefree' instead of 'malloc/free' for memory
+      allocation.  Thanks to Kenichi Ishigaki.
+
+0.06        Wed Jul 21 20:44 PDT 2010
+    - RT #59549; '(' should retain leading WS, as needed for @media queries.
+      Thanks to Mike Cardwell.
 
 0.05        Fri Apr 23 22:29 PDT 2010
     - Switch to Git

Modified: branches/upstream/libcss-minifier-xs-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/MANIFEST?rev=60471&op=diff
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/MANIFEST (original)
+++ branches/upstream/libcss-minifier-xs-perl/current/MANIFEST Thu Jul 22 11:31:17 2010
@@ -19,6 +19,8 @@
 t/css/comments-mac-ie-hack.min
 t/css/leading-whitespace.css
 t/css/leading-whitespace.min
+t/css/media.css
+t/css/media.min
 t/css/retain-whitespace-after-close-parenthesis.css
 t/css/retain-whitespace-after-close-parenthesis.min
 t/css/styles.css

Modified: branches/upstream/libcss-minifier-xs-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/META.yml?rev=60471&op=diff
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/META.yml (original)
+++ branches/upstream/libcss-minifier-xs-perl/current/META.yml Thu Jul 22 11:31:17 2010
@@ -1,21 +1,23 @@
 ---
 name: CSS-Minifier-XS
-version: 0.05
+version: 0.07
 author:
   - Graham TerMarsch (cpan at howlingfrog.com)
 abstract: XS based CSS minifier
 license: perl
 resources:
-  license: ~
+  license: http://dev.perl.org/licenses/
+build_requires:
+  Test::More: 0
 requires:
   perl: 5.006
-build_requires:
-  Test::More: 0
+configure_requires:
+  Module::Build: 0.35
 provides:
   CSS::Minifier::XS:
     file: lib/CSS/Minifier/XS.pm
-    version: 0.05
-generated_by: Module::Build version 0.32
+    version: 0.07
+generated_by: Module::Build version 0.35
 meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.2.html
-  version: 1.2
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4

Modified: branches/upstream/libcss-minifier-xs-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/Makefile.PL?rev=60471&op=diff
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/Makefile.PL (original)
+++ branches/upstream/libcss-minifier-xs-perl/current/Makefile.PL Thu Jul 22 11:31:17 2010
@@ -1,14 +1,15 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.32
+# Note: this file was auto-generated by Module::Build::Compat version 0.35
 require 5.006;
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
+          'PL_FILES' => {},
+          'INSTALLDIRS' => 'site',
           'NAME' => 'CSS::Minifier::XS',
+          'EXE_FILES' => [],
           'VERSION_FROM' => 'lib/CSS/Minifier/XS.pm',
           'PREREQ_PM' => {
                            'Test::More' => 0
-                         },
-          'INSTALLDIRS' => 'site',
-          'EXE_FILES' => []
+                         }
         )
 ;

Modified: branches/upstream/libcss-minifier-xs-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/README?rev=60471&op=diff
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/README (original)
+++ branches/upstream/libcss-minifier-xs-perl/current/README Thu Jul 22 11:31:17 2010
@@ -1,6 +1,6 @@
 CSS::Minifier::XS minifies CSS documents by removing un-necessary whitespace
 
-Copyright (C) 2007, Graham TerMarsch.  All Rights Reserved.
+Copyright (C) 2007-2010, Graham TerMarsch.  All Rights Reserved.
 
 This is free software; you can redistribute it and/or modify it under the same
 terms as Perl itself.

Modified: branches/upstream/libcss-minifier-xs-perl/current/XS.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/XS.xs?rev=60471&op=diff
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/XS.xs (original)
+++ branches/upstream/libcss-minifier-xs-perl/current/XS.xs Thu Jul 22 11:31:17 2010
@@ -38,10 +38,8 @@
 }
 int charIsInfix(char ch) {
     /* WS before+after these characters can be removed */
-    /* NOTE: ')' is -NOT- infix, its postfix; MSIE requires WS after it */
     if (ch == '{')  return 1;
     if (ch == '}')  return 1;
-    if (ch == '(')  return 1;
     if (ch == ';')  return 1;
     if (ch == ':')  return 1;
     if (ch == ',')  return 1;
@@ -50,11 +48,12 @@
 }
 int charIsPrefix(char ch) {
     /* WS after these characters can be removed */
+    if (ch == '(')  return 1;   /* requires leading WS when used in @media */
     return charIsInfix(ch);
 }
 int charIsPostfix(char ch) {
     /* WS before these characters can be removed */
-    if (ch == ')')  return 1;
+    if (ch == ')')  return 1;   /* requires trailing WS for MSIE */
     return charIsInfix(ch);
 }
 
@@ -168,7 +167,8 @@
  */
 /* allocates a new node */
 Node* CssAllocNode() {
-    Node* node = malloc(sizeof(Node));
+    Node* node;
+    Newxz(node, 1, Node);
     node->prev = NULL;
     node->next = NULL;
     node->contents = NULL;
@@ -181,8 +181,8 @@
 /* frees the memory used by a node */
 void CssFreeNode(Node* node) {
     if (node->contents)
-        free(node->contents);
-    free(node);
+        Safefree(node->contents);
+    Safefree(node);
 }
 void CssFreeNodeList(Node* head) {
     while (head) {
@@ -195,7 +195,7 @@
 /* clears the contents of a node */
 void CssClearNodeContents(Node* node) {
     if (node->contents)
-        free(node->contents);
+        Safefree(node->contents);
     node->contents = NULL;
     node->length = 0;
 }
@@ -205,8 +205,7 @@
     CssClearNodeContents(node);
     node->length = len;
     /* allocate string, fill with NULLs, and copy */
-    node->contents = malloc( sizeof(char) * (len+1) );
-    memset( node->contents, 0, len );
+    Newxz(node->contents, (len+1), char);
     strncpy( node->contents, string, len );
 }
 
@@ -538,7 +537,8 @@
         /* allocate the result buffer to the same size as the original CSS; in
          * a worst case scenario that's how much memory we'll need for it.
          */
-        ptr = results = malloc( sizeof(char) * (strlen(string)+1) );
+        Newxz(results, (strlen(string)+1), char);
+        ptr = results;
         /* copy node contents into result buffer */
         curr = head;
         while (curr) {
@@ -572,7 +572,7 @@
         /* hand back the minified CSS (if we had any) */
         if (buffer != NULL) {
             RETVAL = newSVpv(buffer, 0);
-            free( buffer );
+            Safefree( buffer );
         }
     OUTPUT:
         RETVAL

Modified: branches/upstream/libcss-minifier-xs-perl/current/lib/CSS/Minifier/XS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/lib/CSS/Minifier/XS.pm?rev=60471&op=diff
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/lib/CSS/Minifier/XS.pm (original)
+++ branches/upstream/libcss-minifier-xs-perl/current/lib/CSS/Minifier/XS.pm Thu Jul 22 11:31:17 2010
@@ -9,7 +9,7 @@
 our @ISA = qw(Exporter DynaLoader);
 our @EXPORT_OK = qw(minify);
 
-our $VERSION = '0.05';
+our $VERSION = '0.07';
 
 bootstrap CSS::Minifier::XS $VERSION;
 
@@ -130,7 +130,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (C) 2007, Graham TerMarsch.  All Rights Reserved.
+Copyright (C) 2007-2010, Graham TerMarsch.  All Rights Reserved.
 
 This is free software; you can redistribute it and/or modify it under the same
 license as Perl itself.

Added: branches/upstream/libcss-minifier-xs-perl/current/t/css/media.css
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/t/css/media.css?rev=60471&op=file
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/t/css/media.css (added)
+++ branches/upstream/libcss-minifier-xs-perl/current/t/css/media.css Thu Jul 22 11:31:17 2010
@@ -1,0 +1,4 @@
+/* CSS with media selector that requires '(' to have leading WS */
+ at media all and (max-width:100px) {
+    margin: 0px;
+}

Added: branches/upstream/libcss-minifier-xs-perl/current/t/css/media.min
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-minifier-xs-perl/current/t/css/media.min?rev=60471&op=file
==============================================================================
--- branches/upstream/libcss-minifier-xs-perl/current/t/css/media.min (added)
+++ branches/upstream/libcss-minifier-xs-perl/current/t/css/media.min Thu Jul 22 11:31:17 2010
@@ -1,0 +1,1 @@
+ at media all and (max-width:100px){margin:0px}




More information about the Pkg-perl-cvs-commits mailing list